-
Notifications
You must be signed in to change notification settings - Fork 7
/
.eslintrc.js
68 lines (67 loc) · 1.9 KB
/
.eslintrc.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
module.exports = {
env: {
browser: true,
es2021: true,
jest: true,
},
extends: ["plugin:react/recommended", "airbnb", "prettier"],
globals: {
Atomics: "readonly",
SharedArrayBuffer: "readonly",
},
parserOptions: {
ecmaFeatures: {
jsx: true,
},
ecmaVersion: 12,
sourceType: "module",
},
plugins: ["react", "prettier"],
rules: {
"react/react-in-jsx-scope": "off",
"import/no-duplicates": "error",
"import/no-unresolved": "error",
"import/named": "error",
"prettier/prettier": "error",
"react/jsx-filename-extension": [1, { extensions: [".js", ".jsx"] }],
"react/state-in-constructor": "off",
"react/prop-types": "off",
"react/no-access-state-in-setstate": "error",
"react/no-danger": "error",
"react/no-did-mount-set-state": "error",
"react/no-did-update-set-state": "error",
"react/no-will-update-set-state": "error",
"react/no-redundant-should-component-update": "error",
"react/no-this-in-sfc": "error",
"react/no-typos": "error",
"react/no-unused-state": "error",
"react/jsx-no-bind": "error",
"no-useless-call": "error",
"no-useless-computed-key": "error",
"no-useless-concat": "error",
"no-useless-constructor": "error",
"no-useless-rename": "error",
"no-useless-return": "error",
"react/jsx-props-no-spreading": "off",
// overriding recommended rules
"no-constant-condition": ["error", { checkLoops: false }],
"no-console": ["error", { allow: ["log", "warn", "error"] }],
"no-unused-vars": ["error", { argsIgnorePattern: "^_" }],
"no-underscore-dangle": ["error"],
},
settings: {
"import/resolver": {
node: {
paths: ["."],
},
alias: {
map: [
["@/public", "./public"],
["@/config", "./config"],
// Add more here
],
extensions: [".js", ".jsx"],
},
},
},
};