forked from jackyef/react-boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.js
107 lines (107 loc) · 3.04 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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
module.exports = {
extends: ['eslint:recommended', 'plugin:react/recommended', 'plugin:import/errors', 'plugin:import/warnings'],
parser: 'babel-eslint',
parserOptions: {
ecmaVersion: 6,
sourceType: 'module',
ecmaFeatures: {
jsx: true,
},
},
plugins: ['react', 'import', 'jest', 'react-hooks'],
env: {
amd: true,
browser: true,
commonjs: true,
es6: true,
jquery: true,
node: true,
'jest/globals': true,
},
settings: {
'import/ignore': '.(scss|less|css|png|jpg|jpeg|bmp|gif|svg)$',
'import/extensions': ['.js', '.jsx'],
},
rules: {
'block-scoped-var': 2,
curly: [2, 'all'],
eqeqeq: 2,
'jsx-quotes': [2, 'prefer-double'],
'max-len': [
2,
120,
2,
{
ignoreUrls: true,
ignoreComments: false,
ignoreRegExpLiterals: true,
ignoreStrings: true,
ignoreTemplateLiterals: true,
},
],
'no-console': 0,
'no-eval': 2,
'no-multiple-empty-lines': [2, { max: 1, maxEOF: 1 }],
'no-unused-vars': [2, { vars: 'local', args: 'after-used', argsIgnorePattern: '^_' }],
'no-useless-concat': 2,
'no-useless-escape': 2,
'no-useless-return': 2,
'no-with': 2,
'object-curly-spacing': [2, 'always'],
'padding-line-between-statements': [
2,
{ blankLine: 'always', prev: ['const', 'let', 'var', 'if'], next: '*' },
{ blankLine: 'any', prev: ['const', 'let', 'var'], next: ['const', 'let', 'var'] },
{ blankLine: 'always', prev: '*', next: ['if', 'return'] },
],
'prefer-template': 1,
radix: 2,
yoda: [2, 'never'],
'import/no-unresolved': [1, { commonjs: true, amd: true }],
'import/named': 0,
'import/namespace': 2,
'import/default': 0,
'import/export': 2,
'import/newline-after-import': 2,
'import/prefer-default-export': 0,
'import/first': 0,
'react/forbid-prop-types': [1, { forbid: ['any', 'array'] }],
'react/jsx-boolean-value': 2,
'react/jsx-closing-bracket-location': 1,
'react/jsx-curly-spacing': 1,
'react/jsx-handler-names': 1,
'react/jsx-indent': [2, 2],
'react/jsx-max-props-per-line': [1, { maximum: 5 }],
'react/jsx-no-bind': 0,
'react/jsx-pascal-case': 2,
'react/jsx-sort-default-props': [1, { ignoreCase: true }],
'react/jsx-wrap-multilines': 2,
'react/no-danger': 0,
'react/no-deprecated': 1,
'react/no-did-mount-set-state': 2,
'react/no-did-update-set-state': 2,
'react/no-direct-mutation-state': 2,
'react/no-is-mounted': 2,
'react/prop-types': 1,
'react/react-in-jsx-scope': 2,
'react/require-default-props': [2, { forbidDefaultForRequired: true }],
'react/self-closing-comp': 2,
'react/sort-comp': 2,
'react/sort-prop-types': [
1,
{
callbacksLast: true,
ignoreCase: true,
requiredFirst: false,
sortShapeProp: true,
},
],
},
globals: {
// put global variables here so eslint knows about them
__SERVER__: true,
__CLIENT__: true,
__PROD__: true,
__DEV__: true,
},
};