-
Notifications
You must be signed in to change notification settings - Fork 0
/
eslint.config.mjs
65 lines (64 loc) · 1.85 KB
/
eslint.config.mjs
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
65
import js from "@eslint/js";
import ts from "typescript-eslint";
import prettier from "eslint-plugin-prettier/recommended";
import react from "eslint-plugin-react/configs/recommended.js";
import reactHooks from "eslint-plugin-react-hooks";
import a11y from "eslint-plugin-jsx-a11y";
export default ts.config(
js.configs.recommended,
...ts.configs.recommended,
...ts.configs.strict,
...ts.configs.stylistic,
{
languageOptions: {
parserOptions: {
projectService: true,
tsconfigRootDir: import.meta.dirname
}
}
},
{
ignores: [
"node_modules/**",
"dist/**",
"public/**",
"app/**/*.js",
"eslint.config.mjs"
]
},
prettier,
react,
{
plugins: {
"react-hooks": reactHooks
},
rules: reactHooks.configs.recommended.rules
},
{
plugins: {
"jsx-a11y": a11y
}
},
{
rules: {
"no-console": ["error", { allow: ["info", "warn", "error", "assert"] }],
"require-await": "error",
"@typescript-eslint/no-empty-function": "off",
"@typescript-eslint/no-this-alias": "warn",
"@typescript-eslint/prefer-as-const": "warn",
"@typescript-eslint/prefer-enum-initializers": "warn",
"@typescript-eslint/prefer-for-of": "warn",
"@typescript-eslint/prefer-includes": "warn",
"@typescript-eslint/prefer-optional-chain": "warn",
"@typescript-eslint/prefer-regexp-exec": "warn",
"@typescript-eslint/prefer-string-starts-ends-with": "warn",
"react/no-string-refs": "warn",
"react/prop-types": "off",
"react/jsx-uses-vars": "error",
"react/jsx-uses-react": "error",
"jsx-a11y/anchor-is-valid": "off", // TODO: enable rule
"jsx-a11y/click-events-have-key-events": "off", // TODO: enable rule
"jsx-a11y/no-noninteractive-element-interactions": "off" // TODO: enable rule
}
}
);