Skip to content

Commit e24f19f

Browse files
authored
chore: adjust prettier printWidth (doocs#1553)
* chore: adjust prettier printWidth * chore: reformat
1 parent ab45c7a commit e24f19f

File tree

803 files changed

+1114
-4563
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

803 files changed

+1114
-4563
lines changed

.prettierrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"semi": true,
55
"singleQuote": true,
66
"trailingComma": "all",
7+
"printWidth": 100,
78
"bracketSpacing": true,
89
"arrowParens": "avoid",
910
"phpVersion": "8.1",

lcci/02.05.Sum Lists/README.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -199,10 +199,7 @@ func addTwoNumbers(l1 *ListNode, l2 *ListNode) *ListNode {
199199
* }
200200
*/
201201

202-
function addTwoNumbers(
203-
l1: ListNode | null,
204-
l2: ListNode | null,
205-
): ListNode | null {
202+
function addTwoNumbers(l1: ListNode | null, l2: ListNode | null): ListNode | null {
206203
if (l1 == null || l2 == null) {
207204
return l1 && l2;
208205
}

lcci/02.05.Sum Lists/README_EN.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -194,10 +194,7 @@ func addTwoNumbers(l1 *ListNode, l2 *ListNode) *ListNode {
194194
* }
195195
*/
196196

197-
function addTwoNumbers(
198-
l1: ListNode | null,
199-
l2: ListNode | null,
200-
): ListNode | null {
197+
function addTwoNumbers(l1: ListNode | null, l2: ListNode | null): ListNode | null {
201198
if (l1 == null || l2 == null) {
202199
return l1 && l2;
203200
}

lcci/02.05.Sum Lists/Solution.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,7 @@
1010
* }
1111
*/
1212

13-
function addTwoNumbers(
14-
l1: ListNode | null,
15-
l2: ListNode | null,
16-
): ListNode | null {
13+
function addTwoNumbers(l1: ListNode | null, l2: ListNode | null): ListNode | null {
1714
if (l1 == null || l2 == null) {
1815
return l1 && l2;
1916
}

lcci/03.02.Min Stack/README.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -172,9 +172,7 @@ class MinStack {
172172
}
173173

174174
getMin(): number {
175-
return this.mins.length == 0
176-
? Infinity
177-
: this.mins[this.mins.length - 1];
175+
return this.mins.length == 0 ? Infinity : this.mins[this.mins.length - 1];
178176
}
179177
}
180178

lcci/04.05.Legal Binary Search Tree/README.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -229,10 +229,7 @@ function isValidBST(root: TreeNode | null): boolean {
229229
if (val <= min || val >= max) {
230230
return false;
231231
}
232-
return (
233-
dfs(left, min, Math.min(val, max)) &&
234-
dfs(right, Math.max(val, min), max)
235-
);
232+
return dfs(left, min, Math.min(val, max)) && dfs(right, Math.max(val, min), max);
236233
};
237234
return dfs(left, -Infinity, val) && dfs(right, val, Infinity);
238235
}

lcci/04.05.Legal Binary Search Tree/README_EN.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -258,10 +258,7 @@ function isValidBST(root: TreeNode | null): boolean {
258258
if (val <= min || val >= max) {
259259
return false;
260260
}
261-
return (
262-
dfs(left, min, Math.min(val, max)) &&
263-
dfs(right, Math.max(val, min), max)
264-
);
261+
return dfs(left, min, Math.min(val, max)) && dfs(right, Math.max(val, min), max);
265262
};
266263
return dfs(left, -Infinity, val) && dfs(right, val, Infinity);
267264
}

lcci/04.10.Check SubTree/README.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -163,9 +163,7 @@ function checkSubTree(t1: TreeNode | null, t2: TreeNode | null): boolean {
163163
return false;
164164
}
165165
if (t1.val === t2.val) {
166-
return (
167-
checkSubTree(t1.left, t2.left) && checkSubTree(t1.right, t2.right)
168-
);
166+
return checkSubTree(t1.left, t2.left) && checkSubTree(t1.right, t2.right);
169167
}
170168
return checkSubTree(t1.left, t2) || checkSubTree(t1.right, t2);
171169
}

lcci/04.10.Check SubTree/README_EN.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -166,9 +166,7 @@ function checkSubTree(t1: TreeNode | null, t2: TreeNode | null): boolean {
166166
return false;
167167
}
168168
if (t1.val === t2.val) {
169-
return (
170-
checkSubTree(t1.left, t2.left) && checkSubTree(t1.right, t2.right)
171-
);
169+
return checkSubTree(t1.left, t2.left) && checkSubTree(t1.right, t2.right);
172170
}
173171
return checkSubTree(t1.left, t2) || checkSubTree(t1.right, t2);
174172
}

lcci/04.10.Check SubTree/Solution.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,7 @@ function checkSubTree(t1: TreeNode | null, t2: TreeNode | null): boolean {
2020
return false;
2121
}
2222
if (t1.val === t2.val) {
23-
return (
24-
checkSubTree(t1.left, t2.left) && checkSubTree(t1.right, t2.right)
25-
);
23+
return checkSubTree(t1.left, t2.left) && checkSubTree(t1.right, t2.right);
2624
}
2725
return checkSubTree(t1.left, t2) || checkSubTree(t1.right, t2);
2826
}

0 commit comments

Comments
 (0)