-
-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy patheslint.config.js
54 lines (48 loc) · 1.73 KB
/
eslint.config.js
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
import eslint from "@eslint/js"
import tseslint from "typescript-eslint"
import stylistic from "@stylistic/eslint-plugin"
import tsdoc from "eslint-plugin-tsdoc"
export default tseslint.config(
// Global ignores for generated files.
{ ignores: ["dist/", "tests/examples/age.js"] },
eslint.configs.recommended,
tseslint.configs.recommendedTypeChecked,
tseslint.configs.stylisticTypeChecked,
{
languageOptions: {
parserOptions: {
projectService: {
// Allow slow "default project" for .js config files in the root.
allowDefaultProject: ["*.js"]
},
tsconfigRootDir: import.meta.dirname,
}
},
plugins: {
"@stylistic": stylistic,
"tsdoc": tsdoc
},
rules: {
"@stylistic/semi": ["error", "never"],
"@stylistic/quotes": ["error", "double", { "allowTemplateLiterals": true /*"avoidEscape"*/ }],
"@stylistic/brace-style": ["error", "1tbs", { "allowSingleLine": true }],
"@stylistic/indent": ["error", 4],
"curly": ["error", "multi-line"],
"eqeqeq": "error",
"no-var": "error",
"prefer-const": "error",
"no-constant-binary-expression": "error",
"no-self-compare": "error",
"tsdoc/syntax": "error"
}
},
// tsconfig.json (used by projectService) does not include .js files by default.
// Disable typed linting for the only .js files in the project, the examples.
{
files: ["tests/examples/*.js"],
extends: [tseslint.configs.disableTypeChecked],
rules: {
"no-undef": "off",
}
},
)