forked from flimzy/react-for-geniuses
/
.eslintrc.js
73 lines (73 loc) · 1.91 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
module.exports = {
parser: "babel-eslint",
extends: ["eslint:recommended", "plugin:react/recommended"],
plugins: ["prettier", "import"],
parserOptions: {
sourceType: "module",
ecmaVersion: 2018,
ecmaFeatures: {
jsx: true,
},
},
env: {
browser: true,
node: true,
},
settings: {
react: {
version: "detect",
},
},
rules: {
"prettier/prettier": "error",
"react/react-in-jsx-scope": "off",
"react/prop-types": "off",
"import/order": [
"error",
{
groups: [
["builtin", "external"],
"internal",
"parent",
["sibling", "index"],
],
"newlines-between": "always",
alphabetize: {
caseInsensitive: true,
order: "asc",
},
},
],
"import/no-self-import": "error",
"import/no-useless-path-segments": [
"error",
{
noUselessIndex: true,
},
],
"import/newline-after-import": "error",
"import/no-unresolved": ["error", { commonjs: true }],
"import/no-absolute-path": "error",
// The use of dynamic requires is a powerful feature of CommonJS.
// We want to discourage it whenever possible, but when its true
// power is warranted you'll have to use:
// require(someVar) // eslint-disable-line import/no-dynamic-require
"import/no-dynamic-require": "error",
"import/no-internal-modules": "error",
// Use the Webpack module rules instead of putting them in your
// require statements.
"import/no-webpack-loader-syntax": "error",
"import/no-self-import": "error",
"import/no-cycle": "error",
"import/no-useless-path-segments": "error",
"import/no-extraneous-dependencies": [
"error",
{
devDependencies: ["*.js", "src/**/*.test.js"],
optionalDependencies: true,
peerDependencies: true,
bundledDependencies: true,
},
],
},
};