-
-
Notifications
You must be signed in to change notification settings - Fork 48
/
Copy pathindent.ts
49 lines (44 loc) · 1.13 KB
/
indent.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
import { RuleTester } from "eslint"
import path from "path"
import rule from "../../../src/rules/indent"
import { loadTestCases } from "../../utils/utils"
const tester = new RuleTester({
parserOptions: {
ecmaVersion: 2020,
sourceType: "module",
parser: {
ts: "@typescript-eslint/parser",
js: "espree",
},
},
})
tester.run("indent", rule as any, loadTestCases("indent"))
const testerForTsParserV4 = new RuleTester({
parserOptions: {
ecmaVersion: 2020,
sourceType: "module",
parser: {
ts: "@typescript-eslint/parser-v4",
js: "espree",
},
},
})
describe("use @typescript-eslint/parser@4", () => {
testerForTsParserV4.run(
"indent",
rule as any,
loadTestCases("indent", {
filter(filename) {
if (
filename.endsWith("ts-class03-input.svelte") ||
filename.endsWith("ts-decorator01-input.svelte") ||
filename.endsWith("ts-decorator02-input.svelte")
) {
// Decorator nodes in ts4.8 are incompatible.
return false
}
return path.basename(path.dirname(filename)) === "ts"
},
}),
)
})