-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy path.eslintrc.js
51 lines (48 loc) · 1.57 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
// override rules
const rules = {
'no-prototype-builtins': 'off',
'no-restricted-syntax': 'warn',
'no-underscore-dangle': ['warn', { 'allow': ['_source', '_id']}],
'jsx-a11y/anchor-is-valid': [ "warn", {
components: [ 'Link' ],
specialLink: [ 'to' ],
aspects: ['invalidHref', 'preferButton'],
}],
'react/destructuring-assignment': 'off',
'react/jsx-one-expression-per-line': 'off',
// TODO: enable this rule again
'react-redux/prefer-separate-component-file': 'off',
'react/no-array-index-key': 'warn',
// TODO: allowed in react 16 (airbnb style update pending)
'react/no-did-update-set-state': 'off',
};
if (process.env.NODE_ENV === 'development' || process.NODE_ENV === undefined) {
// relax some rules in development mode
rules['object-curly-newline'] = 'warn';
rules['no-console'] = ['warn', { 'allow': ['warn', 'error']}];
rules['max-len'] = 'warn';
rules['quotes'] = 'warn';
rules['quote-props'] = 'warn';
// disallow declaration of variables that are not used in the code
rules['no-unused-vars'] = ['warn', { vars: 'all', args: 'after-used', ignoreRestSiblings: true }];
rules['import/first'] = ['warn', 'absolute-first'];
rules['import/no-named-as-default'] = 'off';
rules['linebreak-style'] = 'off';
}
module.exports = {
"parser": "babel-eslint",
// see: https://github.com/airbnb/javascript
"extends": [
"airbnb",
"plugin:react-redux/recommended",
"plugin:redux-saga/recommended",
],
"env": {
"browser": true
},
"rules": rules,
"plugins": [
"react-redux",
"redux-saga",
],
};