-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathreact.js
51 lines (50 loc) · 1.27 KB
/
react.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
/**
* Config base for projects using react.
*/
module.exports = {
env: {
browser: true,
es2022: true,
},
settings: { react: { version: "detect" } },
extends: require.resolve("./base.js"),
overrides: [
{
files: ["*.jsx", "*.ts?(x)"],
extends: [
"airbnb",
"airbnb/hooks",
"plugin:react/jsx-runtime",
"prettier",
],
plugins: ["react"],
rules: {
"no-console": ["error", { allow: ["warn", "error"] }],
"react/function-component-definition": [
"error",
{ namedComponents: "function-declaration" },
],
"no-restricted-syntax": [
"error",
{
selector: "LabeledStatement",
message:
"Labels are a form of GOTO; using them makes code confusing and hard to maintain and understand.",
},
{
selector: "WithStatement",
message:
"`with` is disallowed in strict mode because it makes code impossible to predict and optimize.",
},
],
},
},
{
files: ["*.{test,spec}.{j,t}s?(x)"],
rules: {
"no-param-reassign": ["error", { props: false }],
"react/jsx-props-no-spreading": "off",
},
},
],
};