Skip to content

Commit

Permalink
chore: update test snapshots
Browse files Browse the repository at this point in the history
Most of the updates are the result of the reimplementation of how we calculate the text edits.
Previously, the text edit is acquired from a naive text diff of the code before and after commit.
We now populate the text edit struct manually when applying changes.

Some of the updates are the reuslt of discarding leading trivia when removing a node.
  • Loading branch information
Sec-ant committed Mar 31, 2024
1 parent 22780e8 commit 41bc14c
Show file tree
Hide file tree
Showing 39 changed files with 518 additions and 467 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,9 @@ file.astro:2:1 lint/suspicious/noDebugger FIXABLE ━━━━━━━━━
i Unsafe fix: Remove debugger statement
1 1 │
1 │ -
2 │ - debugger;
1 │ +
3 2 │
Expand All @@ -46,5 +47,3 @@ file.astro:2:1 lint/suspicious/noDebugger FIXABLE ━━━━━━━━━
Checked 1 file in <TIME>. No fixes needed.
Found 2 errors.
```


Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,12 @@ file.vue:4:8 lint/style/noInferrableTypes FIXABLE ━━━━━━━━━
i Safe fix: Remove the type annotation.
4 │ var·foo:·string·=·"";
│ --------
2 2 │ delete a.c;
3 3 │
4 │ - var·foo:·string·=·"";
4 │ + var·foo·=·"";
5 5 │
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,8 @@ file.js:1:1 suppressions/deprecatedSuppressionComment FIXABLE DEPRECATED ━
i Unsafe fix: Use // biome-ignore instead
1 │ - //·rome-ignore·lint(suspicious/noDoubleEquals):·test
2 │ - a·
1 │ + //·biome-ignore·lint(suspicious/noDoubleEquals):·test
2 │ + a·==·b;
2 2 │ a == b;
```
Expand Down Expand Up @@ -65,9 +64,8 @@ file.js:1:1 suppressions/deprecatedSuppressionComment FIXABLE DEPRECATED ━
i Unsafe fix: Use // biome-ignore instead
1 │ - //·rome-ignore·lint(suspicious/noDoubleEquals):·test
2 │ - a·
1 │ + //·biome-ignore·lint(suspicious/noDoubleEquals):·test
2 │ + a·==·b;
2 2 │ a == b;
```
Expand All @@ -89,5 +87,3 @@ file.js format ━━━━━━━━━━━━━━━━━━━━━
Checked 1 file in <TIME>. No fixes needed.
Found 3 errors.
```


Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,12 @@ file.js:1:1 suppressions/deprecatedSuppressionComment FIXABLE DEPRECATED ━
i Unsafe fix: Use // biome-ignore instead
1 │ - //·rome-ignore·lint(suspicious/noDoubleEquals):·test
2 │ - a·
1 │ + //·biome-ignore·lint(suspicious/noDoubleEquals):·test
2 │ + a·==·b;
2 2 │ a == b;
```

```block
Checked 1 file in <TIME>. No fixes needed.
```


Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ invalid.jsx:5:9 lint/a11y/useValidAriaProps FIXABLE ━━━━━━━━
Check the list of all valid aria-* attributes.
5 │ var·a·=·<div·aria-skldjfaria-foo1="foobar"·aria-skldjfaria-foo222="foobar"·/>;
------------------------------
│ ------------------------------
```

Expand Down Expand Up @@ -176,5 +176,3 @@ invalid.jsx:5:9 lint/a11y/useValidAriaProps FIXABLE ━━━━━━━━
│ --------------------------------
```


Original file line number Diff line number Diff line change
Expand Up @@ -371,8 +371,9 @@ invalid.jsonc:1:27 lint/complexity/noUselessLabel FIXABLE ━━━━━━
i Safe fix: Remove the unnecessary label.
You can achieve the same result without the label.
1 │ A:·while(true)·{·continue·A/*after*/;·}
│ --
- A:·while(true)·{·continue·A/*after*/;·}
+ A:·while(true)·{·continue/*after*/;·}
```

Expand All @@ -395,8 +396,10 @@ invalid.jsonc:1:24 lint/complexity/noUselessLabel FIXABLE ━━━━━━
i Safe fix: Remove the unnecessary label.
You can achieve the same result without the label.
1 │ A:·while(true)·{·break·A·//after
│ --
1 │ - A:·while(true)·{·break·A·//after
1 │ + A:·while(true)·{·break·//after
2 2 │ }
```

Expand All @@ -419,8 +422,10 @@ invalid.jsonc:1:24 lint/complexity/noUselessLabel FIXABLE ━━━━━━
i Safe fix: Remove the unnecessary label.
You can achieve the same result without the label.
1 │ A:·while(true)·{·break·A·/*after*/
│ --
1 │ - A:·while(true)·{·break·A·/*after*/
1 │ + A:·while(true)·{·break·/*after*/
2 2 │ foo() }
```

Expand Down Expand Up @@ -467,5 +472,3 @@ invalid.jsonc:1:58 lint/complexity/noUselessLabel FIXABLE ━━━━━━
│ --
```


Original file line number Diff line number Diff line change
Expand Up @@ -244,9 +244,12 @@ invalid.js:24:21 lint/complexity/noUselessRename FIXABLE ━━━━━━━
i Safe fix: Remove the renaming.
24 │ export·{·/*before*/·foo·as·foo·/*after*/·}·from·"foo";
│ -------
22 22 │ export { /*before*/ foo as foo /*after*/ };
23 23 │
24 │ - export·{·/*before*/·foo·as·foo·/*after*/·}·from·"foo";
24 │ + export·{·/*before*/·foo·/*after*/·}·from·"foo";
25 25 │
26 26 │ // following cases are supported by ESLint
```


Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,8 @@ invalid.js:2:2 lint/complexity/noUselessSwitchCase FIXABLE ━━━━━━
1 1 │ switch (foo) {
2 │ - → case·0:
3 │ - → default:
2 │ + → default:
3 2 │ default:
4 3 │ break;
5 4 │ case 3:
```
Expand Down Expand Up @@ -84,10 +82,8 @@ invalid.js:10:14 lint/complexity/noUselessSwitchCase FIXABLE ━━━━━
8 8 │
9 9 │ switch (foo) {
10 │ - → /*·before·*/case·0:/*·after·*/
11 │ - → //·comment·for·default
10 │ + → //·comment·for·default
11 10 │ // comment for default
12 11 │ default:
13 12 │ case 1:
```
Expand Down Expand Up @@ -118,10 +114,8 @@ invalid.js:13:2 lint/complexity/noUselessSwitchCase FIXABLE ━━━━━━
11 11 │ // comment for default
12 12 │ default:
13 │ - → case·1:
14 │ - → case·2:/*·statements·*/
13 │ + → case·2:/*·statements·*/
14 13 │ case 2:/* statements */
15 14 │ break;
16 15 │ case 3:
```
Expand Down Expand Up @@ -155,14 +149,11 @@ invalid.js:14:2 lint/complexity/noUselessSwitchCase FIXABLE ━━━━━━
10 10 │ /* before */case 0:/* after */
11 │ - → //·comment·for·default
12 │ - → default:
13 │ - → case·1:
13 11 │ case 1:
14 │ - → case·2:/*·statements·*/
11 │ + → case·1:
12 │ + → default:/*·statements·*/
15 13 │ break;
16 14 │ case 3:
```


Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,8 @@ invalid.js:5:11 lint/complexity/noUselessThisAlias FIXABLE ━━━━━━
3 3 │ function f() {
4 │ - ····//·assignment·comment
5 │ - ····const·self·=·this;
6 │ - ····return·()·=>·{
6 4 │ return () => {
7 │ - ········/*a*/self/*b*/.g();
4 │ + ····return·()·=>·{
5 │ + ········/*a*/this/*b*/.g();
8 6 │ }
9 7 │ }
Expand All @@ -147,9 +146,8 @@ invalid.js:12:9 lint/complexity/noUselessThisAlias FIXABLE ━━━━━━
10 10 │
11 11 │ function f() {
12 │ - ····let·self·=·this;
13 │ - ····return·()·=>·{
13 12 │ return () => {
14 │ - ········self.g();
12 │ + ····return·()·=>·{
13 │ + ········this.g();
15 14 │ }
16 15 │ }
Expand Down Expand Up @@ -177,9 +175,8 @@ invalid.js:19:9 lint/complexity/noUselessThisAlias FIXABLE ━━━━━━
19 │ - ····var·self;
20 │ - ····self·=·this;
21 │ - ····self·=·this;
22 │ - ····return·()·=>·{
22 19 │ return () => {
23 │ - ········self.g();
19 │ + ····return·()·=>·{
20 │ + ········this.g();
24 21 │ }
25 22 │ }
Expand Down Expand Up @@ -227,5 +224,3 @@ invalid.js:32:13 lint/complexity/noUselessThisAlias FIXABLE ━━━━━━
```


Original file line number Diff line number Diff line change
Expand Up @@ -123,10 +123,7 @@ invalid.jsonc:1:26 lint/correctness/noNewSymbol FIXABLE ━━━━━━━
i Unsafe fix: Remove new.
- var·s·=·/*·prefix_cmt·*/·new·/*·suffix_cmt·*/·Symbol()·//·comment
+ var·s·=·/*·prefix_cmt·*/··/*·suffix_cmt·*/·Symbol()·//·comment
1 │ var·s·=·/*·prefix_cmt·*/·new·/*·suffix_cmt·*/·Symbol()·//·comment
│ ---
```


Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,9 @@ invalid.jsonc:1:22 lint/correctness/noSwitchDeclarations FIXABLE ━━━━
i Unsafe fix: Wrap the declaration in a block.
1 │ switch·(a)·{·case·1:·{·let·x·=·1;·break;·}}
│ ++ +
- switch·(a)·{·case·1:·let·x·=·1;·break;·}
+ switch·(a)·{·case·1:·{·let·x·=·1;·break;·}}
```

Expand All @@ -51,8 +52,9 @@ invalid.jsonc:1:23 lint/correctness/noSwitchDeclarations FIXABLE ━━━━
i Unsafe fix: Wrap the declaration in a block.
1 │ switch·(a)·{·default:·{·let·x·=·2;·break;·}}
│ ++ +
- switch·(a)·{·default:·let·x·=·2;·break;·}
+ switch·(a)·{·default:·{·let·x·=·2;·break;·}}
```

Expand All @@ -78,8 +80,9 @@ invalid.jsonc:1:22 lint/correctness/noSwitchDeclarations FIXABLE ━━━━
i Unsafe fix: Wrap the declaration in a block.
1 │ switch·(a)·{·case·1:·{·const·x·=·1;·break;·}}
│ ++ +
- switch·(a)·{·case·1:·const·x·=·1;·break;·}
+ switch·(a)·{·case·1:·{·const·x·=·1;·break;·}}
```

Expand All @@ -105,8 +108,9 @@ invalid.jsonc:1:23 lint/correctness/noSwitchDeclarations FIXABLE ━━━━
i Unsafe fix: Wrap the declaration in a block.
1 │ switch·(a)·{·default:·{·const·x·=·2;·break;·}}
│ ++ +
- switch·(a)·{·default:·const·x·=·2;·break;·}
+ switch·(a)·{·default:·{·const·x·=·2;·break;·}}
```

Expand All @@ -132,8 +136,9 @@ invalid.jsonc:1:22 lint/correctness/noSwitchDeclarations FIXABLE ━━━━
i Unsafe fix: Wrap the declaration in a block.
1 │ switch·(a)·{·case·1:·{·function·f()·{}·break;·}}
│ ++ +
- switch·(a)·{·case·1:·function·f()·{}·break;·}
+ switch·(a)·{·case·1:·{·function·f()·{}·break;·}}
```

Expand All @@ -159,8 +164,9 @@ invalid.jsonc:1:23 lint/correctness/noSwitchDeclarations FIXABLE ━━━━
i Unsafe fix: Wrap the declaration in a block.
1 │ switch·(a)·{·default:·{·function·f()·{}·break;·}}
│ ++ +
- switch·(a)·{·default:·function·f()·{}·break;·}
+ switch·(a)·{·default:·{·function·f()·{}·break;·}}
```

Expand All @@ -186,8 +192,9 @@ invalid.jsonc:1:22 lint/correctness/noSwitchDeclarations FIXABLE ━━━━
i Unsafe fix: Wrap the declaration in a block.
1 │ switch·(a)·{·case·1:·{·class·C·{}·break;·}}
│ ++ +
- switch·(a)·{·case·1:·class·C·{}·break;·}
+ switch·(a)·{·case·1:·{·class·C·{}·break;·}}
```

Expand All @@ -213,9 +220,8 @@ invalid.jsonc:1:23 lint/correctness/noSwitchDeclarations FIXABLE ━━━━
i Unsafe fix: Wrap the declaration in a block.
1 │ switch·(a)·{·default:·{·class·C·{}·break;·}}
│ ++ +
- switch·(a)·{·default:·class·C·{}·break;·}
+ switch·(a)·{·default:·{·class·C·{}·break;·}}
```


Loading

0 comments on commit 41bc14c

Please sign in to comment.