-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy patheslint.config.js
79 lines (76 loc) · 2.06 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
// eslint.config.js
const global = require("globals");
const eslint = require("@eslint/js");
const reactPlugin = require("eslint-plugin-react");
const prettierPlugin = require("eslint-config-prettier");
const importPlugin = require("eslint-plugin-import");
const reactHookPlugin = require("eslint-plugin-react-hooks");
const airbnbPlugin = require("eslint-config-airbnb");
const { fixupPluginRules } = require("@eslint/compat");
module.exports = [
eslint.configs.recommended,
// run on all js and jsx files in the static directory and subdirectories
{ files: ["**/*.js", "**/*.jsx"] },
{
languageOptions: {
parser: require("@babel/eslint-parser"),
parserOptions: {
requireConfigFile: false,
babelOptions: {
presets: ["@babel/preset-env", "@babel/preset-react"],
},
ecmaFeatures: {
jsx: true,
},
},
globals: {
...global.browser,
},
},
},
{
plugins: {
import: importPlugin,
react: reactPlugin,
"react-hooks": fixupPluginRules(reactHookPlugin),
airbnb: airbnbPlugin,
prettier: prettierPlugin,
},
},
{
rules: {
...reactHookPlugin.configs.recommended.rules,
...prettierPlugin.rules,
camelcase: "off",
"no-unused-vars": "off",
"no-unsafe-optional-chaining": "off",
"no-useless-escape": "off",
"no-constant-binary-expression": "warn",
"jsx-a11y/click-events-have-key-events": 0,
"jsx-a11y/label-has-associated-control": 0,
"jsx-a11y/control-has-associated-label": 0,
"react-hooks/rules-of-hooks": "error",
"react-hooks/exhaustive-deps": "warn",
"react/jsx-wrap-multilines": 0,
"react/jsx-one-expression-per-line": 0,
"react/jsx-props-no-spreading": 0,
"react/jsx-curly-newline": 0,
"no-param-reassign": 0,
},
},
{
settings: {
import: {
resolver: {
node: {},
rspack: {
config: "rspack.config.js",
},
},
},
react: {
version: "detect",
},
},
},
];