Repository navigation
Expand file tree
/
Copy patheslint.config.js
More file actions
64 lines (63 loc) · 1.82 KB
/
Copy patheslint.config.js
File metadata and controls
64 lines (63 loc) · 1.82 KB
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
import { globalIgnores } from "eslint/config";
import eslint from "@eslint/js";
import tseslint from "typescript-eslint";
import stylistic from "@stylistic/eslint-plugin";
export default tseslint.config(
globalIgnores(["tap-snapshots/**"]),
eslint.configs.recommended,
...tseslint.configs.recommendedTypeChecked,
...tseslint.configs.strict,
stylistic.configs.customize({
quotes: "double",
semi: true,
arrowParens: true,
braceStyle: "1tbs",
}),
{
rules: {
// emulate how typescript deals with unused vars
"@typescript-eslint/no-unused-vars": ["error", {
args: "all",
argsIgnorePattern: "^_",
caughtErrors: "all",
caughtErrorsIgnorePattern: "^_",
destructuredArrayIgnorePattern: "^_",
varsIgnorePattern: "^_",
ignoreRestSiblings: true,
}],
"@stylistic/max-len": ["error", {
code: 140,
ignoreStrings: true,
ignoreTemplateLiterals: true,
ignoreUrls: true,
}],
"@stylistic/object-curly-newline": ["error", {
multiline: true,
consistent: true,
}],
"@typescript-eslint/consistent-type-imports": ["error", {
fixStyle: "separate-type-imports",
prefer: "type-imports",
}],
},
languageOptions: {
parserOptions: {
projectService: true,
tsconfigRootDir: import.meta.dirname,
},
},
},
{
// allow non-null assertions in tests because they can be useful for more concise tests
files: ["test/**/*"],
rules: {
"@typescript-eslint/no-non-null-assertion": "off",
"@typescript-eslint/ban-ts-comment": "off",
"@typescript-eslint/consistent-type-imports": ["error", {
disallowTypeAnnotations: false,
fixStyle: "separate-type-imports",
prefer: "type-imports",
}],
},
},
);