Skip to content

Commit fa309b0

Browse files
committed
chore: lint for test fixtures
1 parent 13235eb commit fa309b0

16 files changed

+836
-840
lines changed

eslint.config.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,10 @@ export default antfu(
2525
'antfu/top-level-function': 'off',
2626
},
2727
},
28+
{
29+
files: ['**/*.test.ts'],
30+
rules: {
31+
'antfu/indent-unindent': 'error',
32+
},
33+
},
2834
)

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,13 +80,13 @@
8080
"eslint": "*"
8181
},
8282
"devDependencies": {
83-
"@antfu/eslint-config": "^2.16.2",
83+
"@antfu/eslint-config": "^2.17.0",
8484
"@antfu/ni": "^0.21.12",
85-
"@antfu/utils": "^0.7.7",
85+
"@antfu/utils": "^0.7.8",
8686
"@eslint/config-inspector": "^0.4.8",
8787
"@types/eslint": "^8.56.10",
8888
"@types/lodash.merge": "^4.6.9",
89-
"@types/node": "^20.12.10",
89+
"@types/node": "^20.12.11",
9090
"@types/semver": "^7.5.8",
9191
"@typescript-eslint/rule-tester": "^7.8.0",
9292
"@typescript-eslint/typescript-estree": "^7.8.0",
@@ -95,7 +95,7 @@
9595
"bumpp": "^9.4.1",
9696
"eslint": "^9.2.0",
9797
"eslint-define-config": "^2.1.0",
98-
"eslint-vitest-rule-tester": "^0.3.0",
98+
"eslint-vitest-rule-tester": "^0.3.2",
9999
"esno": "^4.7.0",
100100
"fast-glob": "^3.3.2",
101101
"lint-staged": "^15.2.2",

pnpm-lock.yaml

Lines changed: 127 additions & 265 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/commands/inline-arrow.test.ts

Lines changed: 26 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -6,46 +6,54 @@ run(
66
// no arrow function
77
{
88
code: $`
9-
///inline-arrow
10-
const a = 1`,
9+
///inline-arrow
10+
const a = 1
11+
`,
1112
errors: ['command-error'],
1213
},
1314
// multi statement
1415
{
1516
code: $`
16-
/// inline-arrow
17-
export const foo = arg => {
18-
const a = 1
19-
return a
20-
}`,
17+
/// inline-arrow
18+
export const foo = arg => {
19+
const a = 1
20+
return a
21+
}
22+
`,
2123
errors: ['command-error'],
2224
},
2325
{
2426
code: $`
25-
/// inline-arrow
26-
export const foo = <T = 1>(arg: Z): Bar => {
27-
return arg
28-
}`,
27+
/// inline-arrow
28+
export const foo = <T = 1>(arg: Z): Bar => {
29+
return arg
30+
}
31+
`,
2932
output: $`
30-
export const foo = <T = 1>(arg: Z): Bar => arg`,
33+
export const foo = <T = 1>(arg: Z): Bar => arg
34+
`,
3135
errors: ['command-fix'],
3236
},
3337
// no return statement
3438
{
3539
code: $`
36-
///inline-arrow
37-
const foo = () => {}`,
40+
///inline-arrow
41+
const foo = () => {}
42+
`,
3843
output: $`
39-
const foo = () => undefined`,
44+
const foo = () => undefined
45+
`,
4046
errors: ['command-fix'],
4147
},
4248
// without return argument
4349
{
4450
code: $`
45-
// /ia
46-
export default <T = 1>(arg: Z): Bar => { return }`,
51+
// /ia
52+
export default <T = 1>(arg: Z): Bar => { return }
53+
`,
4754
output: $`
48-
export default <T = 1>(arg: Z): Bar => undefined`,
55+
export default <T = 1>(arg: Z): Bar => undefined
56+
`,
4957
errors: ['command-fix'],
5058
},
5159
)

0 commit comments

Comments
 (0)