forked from mui/material-ui
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.js
151 lines (149 loc) · 5.24 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
module.exports = {
// So parent files don't get applied
root: true,
env: {
es6: true,
browser: true,
node: true,
},
extends: 'eslint:recommended',
parser: 'babel-eslint',
parserOptions: {
ecmaVersion: 7,
sourceType: 'module',
ecmaFeatures: {
jsx: true,
experimentalObjectRestSpread: true,
}
},
plugins: [
'babel',
'react',
'mocha',
'material-ui',
],
rules: {
'array-bracket-spacing': ['error', 'never'],
'arrow-spacing': 'error',
'arrow-parens': 'error',
'block-spacing': ['error', 'always'],
'brace-style': 'error',
'comma-dangle': ['error', 'always-multiline'],
'comma-spacing': ['error', {before: false, after: true}],
'comma-style': ['error', 'last'],
'computed-property-spacing': ['error', 'never'],
'consistent-this': ['error', 'self'],
'consistent-return': 'off', // Wishlist, one day
'dot-notation': 'error',
'dot-location': ['error', 'property'],
'eqeqeq': ['error', 'smart'],
'eol-last': 'error',
'indent': ['error', 2, {SwitchCase: 1}],
'id-blacklist': ['error', 'e'],
'jsx-quotes': ['error', 'prefer-double'],
'keyword-spacing': 'error',
'key-spacing': 'error',
'max-len': ['error', 120, 4],
'new-cap': ['off', {capIsNew: true, newIsCap: true}], // Wishlist, one day
'no-unused-expressions': 'error',
'no-unused-vars': 'error',
'no-shadow': 'off', // Wishlist, one day
'no-spaced-func': 'error',
'no-multiple-empty-lines': 'error',
'no-multi-spaces': 'error',
'no-undef': 'error',
'no-empty-pattern': 'error',
'no-dupe-keys': 'error',
'no-dupe-args': 'error',
'no-duplicate-case': 'error',
'no-cond-assign': 'error',
'no-extra-semi': 'error',
'no-extra-boolean-cast': 'error',
'no-trailing-spaces': 'error',
'no-underscore-dangle': 'error',
'no-unneeded-ternary': 'error',
'no-unreachable': 'error',
'no-var': 'error',
'one-var': ['error', 'never'],
'operator-linebreak': ['error', 'after'],
'padded-blocks': ['error', 'never'],
'prefer-arrow-callback': 'off', // Wishlist, one day
'prefer-const': 'error',
'prefer-template': 'error',
'quotes': ['error', 'single', 'avoid-escape'],
'semi': ['error', 'always'],
'space-before-blocks': ['error', 'always'],
'space-before-function-paren': ['error', 'never'],
'space-infix-ops': 'error',
'space-unary-ops': ['error', { words: true, nonwords: false }],
'spaced-comment': 'error',
'yoda': 'error',
'babel/object-curly-spacing': ['error', 'never'],
'babel/generator-star-spacing': 'error',
'babel/array-bracket-spacing': 'error',
'babel/arrow-parens': 'error',
'babel/no-await-in-loop': 'error',
'babel/func-params-comma-dangle': 'error',
'babel/flow-object-type': 'error',
'react/display-name': 'error',
'react/jsx-boolean-value': ['error', 'always'],
'react/jsx-closing-bracket-location': 'error',
'react/jsx-curly-spacing': 'error',
'react/jsx-equals-spacing': 'error',
'react/jsx-filename-extension': ['error', {extensions: ['.js']}],
'react/jsx-first-prop-new-line': ['error', 'multiline'],
'react/jsx-handler-names': 'error',
'react/jsx-indent': ['error', 2],
'react/jsx-indent-props': ['error', 2],
'react/jsx-max-props-per-line': ['error', {maximum: 3}],
'react/jsx-no-duplicate-props': 'error',
'react/jsx-no-undef': 'error',
'react/jsx-pascal-case': 'error',
'react/jsx-space-before-closing': 'error',
'react/jsx-uses-react': 'error',
'react/jsx-uses-vars': 'error',
'react/no-comment-textnodes': 'error',
'react/no-danger': 'error',
'react/no-deprecated': 'error',
'react/no-did-mount-set-state': 'error',
'react/no-did-update-set-state': 'error',
'react/no-direct-mutation-state': 'error',
'react/no-multi-comp': 'off', // Wishlist, one day
'react/no-render-return-value': 'error',
'react/no-is-mounted': 'error',
'react/no-unknown-property': 'error',
'react/prefer-arrow-callback': 'off', // Wishlist, one day
'react/prefer-es6-class': 'error',
'react/prop-types': 'error',
'react/react-in-jsx-scope': 'error',
'react/require-extension': 'error',
'react/require-render-return': 'error',
'react/self-closing-comp': 'error',
'react/sort-comp': 'error',
'react/sort-prop-types': 'error',
'react/wrap-multilines': 'error',
'material-ui/docgen-ignore-before-comment': 'error',
'mocha/handle-done-callback': 'error',
'mocha/no-exclusive-tests': 'error',
'mocha/no-global-tests': 'error',
'mocha/no-pending-tests': 'error',
'mocha/no-skipped-tests': 'error',
'react/no-string-refs': 'warn', // Whishlist, one day.
'strict': 'off',
'no-case-declarations': 'off',
'react/jsx-key': 'off',
'react/jsx-no-bind': 'off',
'react/jsx-no-literals': 'off',
'react/jsx-no-target-blank': 'off',
'react/jsx-sort-props': 'off',
'react/no-set-state': 'off',
'react/forbid-prop-types': 'off',
'react/prefer-stateless-function': 'off',
'react/require-optimization': 'off',
'mocha/no-synchronous-tests': 'off',
'mocha/valid-suite-description': 'off',
'mocha/valid-test-description': 'off',
'babel/object-shorthand': 'off',
'babel/new-cap': 'off',
},
};