-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy path.eslintrc.js
85 lines (82 loc) · 2.35 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
module.exports = {
env: {
browser: true,
commonjs: true,
es6: true,
node: true,
mocha: true,
},
extends: [
'eslint:recommended',
'plugin:react/recommended',
'plugin:css-modules/recommended',
'airbnb',
],
parser: 'babel-eslint',
parserOptions: {
ecmaVersion: 2018,
ecmaFeatures: {
experimentalDecorators: true,
experimentalObjectRestSpread: true,
jsx: true,
classes: true,
},
sourceType: 'module'
},
globals: {
'google': true,
'ga': true,
'graphql': false,
'__VERSION__': true,
'__ENV__': true,
},
plugins: ['react', 'import', 'css-modules', 'json'],
rules: {
indent: ['error', 2],
quotes: ['error', 'single'],
semi: ['error', 'never'],
camelcase: 0,
'max-len': 0,
'linebreak-style': ['error', 'unix'],
'import/no-extraneous-dependencies': ['error', { devDependencies: true, optionalDependencies: false, peerDependencies: false }],
'no-param-reassign': ['error', { props: false }],
'object-curly-newline': [0],
'no-plusplus': ['error', { allowForLoopAfterthoughts: true }],
'lines-between-class-members': ['error', 'always'],
'arrow-body-style': 0,
'no-underscore-dangle': 0,
'no-nested-ternary': 1, // warning for now, merchant-portal used alot and related to logic
'jsx-a11y/label-has-for': 0,
'lines-between-class-members': 0,
// import
'import/no-unresolved': [2, { ignore: ['config/message$'] }],
'import/prefer-default-export': 0,
'import/no-extraneous-dependencies': 0,
// react
'react/sort-comp' : 0,
'react/prop-types': 0,
'react/prefer-stateless-function': 0,
'react/no-unescaped-entities': 0,
'react/forbid-prop-types': [2, { forbid: ['any'] }],
'react/jsx-filename-extension': [1, { extensions: ['.js', '.jsx'] }],
'react/no-array-index-key': 1, // warning for now, don't know how to fix
"jsx-a11y/anchor-is-valid": [ "error", {
components: [ "Link" ],
specialLink: [ "to" ],
aspects: [ "noHref", "invalidHref", "preferButton" ]
}],
'jsx-a11y/no-static-element-interactions': 0,
'jsx-a11y/click-events-have-key-events': 0,
// css
'css-modules/no-unused-class': 1,
},
overrides: [
{
files: ['**/stores/*.js'],
rules: {
'func-names': 0,
'consistent-return': 0,
},
},
],
};