-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy path.eslintrc.js
192 lines (182 loc) · 5.23 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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
'use strict';
module.exports = {
'extends': 'eslint-config-airbnb',
'env': {
'browser': true,
'node': true,
'jest': true
},
'parser': 'babel-eslint',
'rules': {
// eslint-config-airbnb-base/rules/best-practices.js
'block-scoped-var': 'warn',
'class-methods-use-this': 'off',
'curly': ['warn', 'multi-line'],
'dot-notation': 'off',
'guard-for-in': 'off',
'no-case-declarations': 'warn',
'no-implicit-coercion': ['warn', {
boolean: false,
number: true,
string: true,
allow: [],
}],
'no-multi-spaces': [
'warn', {
'exceptions': {
'VariableDeclarator': true,
'ImportDeclaration': true
}
}
],
'no-param-reassign': 'off',
'no-useless-concat': 'off',
'prefer-destructuring': 'off',
'no-restricted-globals': 'off',
// eslint-config-airbnb-base/rules/errors.js
'no-console': 'warn',
'prefer-promise-reject-errors': 'off',
// eslint-config-airbnb-base/rules/node.js
'global-require': 'off',
// eslint-config-airbnb-base/rules/style.js
'array-bracket-spacing': [ 'warn', 'always' ],
'brace-style': [ 'warn', 'stroustrup', {
'allowSingleLine': true
}],
'camelcase': 'warn',
'comma-dangle': [ 'warn', 'always-multiline' ],
'computed-property-spacing': 'off',
'func-names': 'warn',
'id-length': [
'warn', {
'min': 2,
'exceptions': [ '_', '$', 'i', 'j', 'k', 'x', 'y', 'e', 't' ]
}
],
'indent': [ 'warn', 2, {
'SwitchCase': 1
}],
'linebreak-style': [ 'warn', 'unix' ],
'lines-around-directive': 'off',
'max-len': [ 'warn', 250, 4, { 'ignoreComments': true } ],
'newline-per-chained-call': 'off',
'no-bitwise': 'off',
'no-continue': 'off',
'no-mixed-operators': 'off',
'no-multiple-empty-lines': [
'warn', {
'max': 2,
'maxEOF': 1
}
],
'no-nested-ternary': 'off',
'no-plusplus': 'off',
'no-restricted-syntax': [
'error',
'ForInStatement',
'LabeledStatement',
'WithStatement',
],
'no-trailing-spaces': [
'warn', {
'skipBlankLines': true
}
],
'no-underscore-dangle': 'off',
'object-curly-spacing': [ 'warn', 'always' ],
'padded-blocks': 'off',
'quotes': [ 'warn', 'single', 'avoid-escape' ],
'space-before-blocks': 'warn',
'space-before-function-paren': [ 'warn', {
'anonymous': 'always',
'named': 'never'
}],
'space-in-parens': 'off',
'spaced-comment': 'warn',
'keyword-spacing': 'warn',
'function-paren-newline': ['error', 'consistent'],
// eslint-config-airbnb-base/rules/variables.js
'no-shadow': 'warn',
'no-unused-vars': 'warn',
'no-use-before-define': 'warn',
'no-useless-escape': 'off',
// eslint-config-airbnb-base/rules/es6.js
'arrow-body-style': 'off',
'arrow-parens': [ 'warn', 'always' ],
'no-var': 'warn',
'object-shorthand': 'off',
'prefer-arrow-callback': 'warn',
'prefer-template': 'off',
// eslint-config-airbnb-base/rules/imports.js
'import/first': 'off',
'import/named': 'error',
'import/namespace': [ 'error', {
'allowComputed': false
}],
'import/no-extraneous-dependencies': [ 'error', {
'devDependencies': true
}],
'import/newline-after-import': 'off',
'import/imports-first': 'off',
'import/no-unresolved': [ 'error', {} ],
'import/no-named-as-default': 'error',
'import/extensions': [ 'warn', 'always', {
'': 'never',
'js': 'never',
}],
'import/no-deprecated': 'warn',
// eslint-config-airbnb/rules/react.js
"react/prop-types": "warn",
"react/forbid-prop-types": "off",
"react/forbid-foreign-prop-types": "off",
"react/no-unused-prop-types": "off",
"react/react-in-jsx-scope": "off",
"react/jsx-filename-extension": [ "warn", { "extensions": [ ".js", ".jsx" ] } ],
"react/jsx-uses-react": "error",
"react/jsx-uses-vars": "error",
"react/jsx-quotes": "off",
"react/jsx-first-prop-new-line": "off",
"react/jsx-closing-bracket-location": "off",
"react/jsx-curly-spacing": "off",
"react/jsx-indent": "off",
"react/self-closing-comp": [ "warn", { "component": true, "html": false } ],
"react/no-multi-comp": "off",
"react/sort-comp": "off",
"react/prefer-stateless-function": "warn",
"react/no-children-prop": "off",
"react/no-danger-with-children": "error",
"jsx-quotes": "error",
// eslint-config-airbnb/rules/react-a11y.js
"jsx-a11y/img-redundant-alt": "off",
"jsx-a11y/alt-text": "off",
"jsx-a11y/anchor-has-content": "off",
"jsx-a11y/anchor-is-valid": "off",
"jsx-a11y/no-static-element-interactions": "off",
"jsx-a11y/label-has-for": "off",
"jsx-a11y/click-events-have-key-events": "off",
"jsx-a11y/accessible-emoji": "off",
},
'plugins': [
'import',
],
'settings': {
'import/ignore': [
'node_modules',
'\\.(scss|less|css)$',
],
'import/resolver': {
'node': {
'moduleDirectory': [
'node_modules',
'./src',
],
},
},
},
"globals": {
"__CLIENT__": true,
"__SERVER__": true,
"__TEST__": true,
"__non_webpack_require__": false,
},
};