forked from ispras/lingvodoc-react
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.js
80 lines (79 loc) · 2.21 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
69
70
71
72
73
74
75
76
77
78
79
80
const sortGroups = {
groups: [
["^react", "^react-dom", "^semantic-ui-react", "^@?\\w"],
// Internal packages
["^(api|apolo|backend|components|config|ducks|graphql|hooks|images|Layout|pages|sagas|styles|utils)(/.*|$)"],
// Side effect imports
["^\\u0000"],
// Parent imports
["^\\.\\.(?!/?$)", "^\\.\\./?$"],
// Other relative imports
["^\\./(?=.*/)(?!/?$)", "^\\.(?!/?$)", "^\\./?$"],
// Style imports.
["^.+\\.s?css$", "^.+\\.scss$"]
]
};
module.exports = {
env: {
browser: true,
node: true,
es6: true
},
extends: [
"eslint:recommended",
"plugin:import/errors",
"plugin:import/warnings",
"plugin:react/recommended",
"plugin:react-hooks/recommended",
"prettier"
],
parserOptions: {
ecmaFeatures: {
jsx: true
},
ecmaVersion: "latest",
sourceType: "module"
},
plugins: ["import", "react", "react-hooks", "simple-import-sort"],
settings: {
react: {
version: "detect"
},
"import/resolver": {
node: {
extensions: [".js", ".jsx"],
paths: ["src"]
}
}
},
rules: {
"comma-spacing": ["warn", { before: false, after: true }],
curly: ["warn", "all"],
eqeqeq: ["error", "allow-null"],
"func-call-spacing": ["warn", "never"],
"key-spacing": ["warn", { beforeColon: false }],
"no-alert": process.env.NODE_ENV === "production" ? "off" : "warn",
"no-console": process.env.NODE_ENV === "production" ? "off" : "warn",
"no-debugger": process.env.NODE_ENV === "production" ? "off" : "warn",
"no-eval": "error",
"no-multi-spaces": "warn",
"no-shadow": "warn",
"no-unused-expressions": "warn",
"no-unused-vars": "warn",
"no-var": "error",
"prefer-const": "warn",
"prefer-template": "warn",
semi: ["error", "always"],
"sort-imports": "off",
"import/named": "off",
"import/newline-after-import": "warn",
"import/no-named-as-default": "off",
"import/no-named-as-default-member": "off",
"import/order": "off",
"react/jsx-fragments": "error",
"react/no-danger": "warn",
"react-hooks/rules-of-hooks": "error",
"react-hooks/exhaustive-deps": "warn",
"simple-import-sort/imports": ["warn", sortGroups]
}
};