UNPKG

5.51 kBJavaScriptView Raw
1module.exports = {
2 root: true,
3 env: {
4 node: true,
5 browser: true,
6 es6: true
7 },
8 parserOptions: {
9 ecmaVersion: 6,
10 sourceType: 'module',
11 ecmaFeatures: {
12 experimentalObjectRestSpread: true
13 }
14 },
15 rules: {
16 /* Possible errors */
17 'comma-dangle': 2,
18 'no-cond-assign': 2,
19 'no-console': 1,
20 'no-constant-condition': 2,
21 'no-control-regex': 2,
22 'no-debugger': 2,
23 'no-dupe-args': 2,
24 'no-dupe-keys': 2,
25 'no-duplicate-case': 2,
26 'no-empty': 2,
27 'no-empty-character-class': 2,
28 'no-ex-assign': 2,
29 'no-extra-boolean-cast': 2,
30 'no-extra-semi': 2,
31 'no-func-assign': 2,
32 'no-inner-declarations': 2,
33 'no-invalid-regexp': 2,
34 'no-irregular-whitespace': 2,
35 'no-negated-in-lhs': 2,
36 'no-obj-calls': 2,
37 'no-regex-spaces': 2,
38 'no-sparse-arrays': 2,
39 'no-unexpected-multiline': 2,
40 'no-unreachable': 2,
41 'use-isnan': 2,
42 'valid-typeof': 2,
43
44 /* Best practices */
45 'accessor-pairs': 2,
46 'array-callback-return': 0,
47 'consistent-return': 0,
48 'curly': [2, 'multi-or-nest', 'consistent'],
49 'default-case': 2,
50 'dot-location': [2, 'property'],
51 'dot-notation': [2, {
52 'allowPattern': '^[a-z]+(_[a-z]+)+$'
53 }],
54 'eqeqeq': 1,
55 'no-alert': 2,
56 'no-caller': 2,
57 'no-case-declarations': 2,
58 'no-div-regex': 2,
59 'no-else-return': 2,
60 'no-empty-function': 2,
61 'no-empty-pattern': 2,
62 'no-eq-null': 1,
63 'no-eval': 2,
64 'no-extend-native': 2,
65 'no-extra-bind': 2,
66 'no-extra-label': 2,
67 'no-fallthrough': 2,
68 'no-floating-decimal': 2,
69 'no-implicit-coercion': 2,
70 'no-implicit-globals': 2,
71 'no-implied-eval': 2,
72 'no-invalid-this': 2,
73 'no-iterator': 2,
74 'no-labels': 2,
75 'no-lone-blocks': 2,
76 'no-loop-func': 2,
77 'no-magic-numbers': 0,
78 'no-multi-spaces': [2, {
79 exceptions: {
80 Array: true,
81 Property: true,
82 VariableDeclarator: true,
83 ImportDeclaration: true
84 }
85 }],
86 'no-multi-str': 2,
87 'no-native-reassign': 2,
88 'no-new': 2,
89 'no-new-func': 2,
90 'no-new-wrappers': 2,
91 'no-octal': 2,
92 'no-octal-escape': 2,
93 'no-param-reassign': 0,
94 'no-proto': 2,
95 'no-redeclare': 2,
96 'no-return-assign': 0,
97 'no-script-url': 2,
98 'no-self-assign': 2,
99 'no-self-compare': 2,
100 'no-sequences': 2,
101 'no-throw-literal': 2,
102 'no-unmodified-loop-condition': 2,
103 'no-unused-expressions': 0,
104 'no-unused-labels': 2,
105 'no-useless-call': 2,
106 'no-useless-concat': 2,
107 'no-useless-escape': 2,
108 'no-void': 2,
109 'no-with': 2,
110 'wrap-iife': 2,
111
112 /* Variables*/
113 'no-delete-var': 2,
114 'no-label-var': 2,
115 'no-restricted-globals': 2,
116 'no-shadow': 0,
117 'no-shadow-restricted-names': 2,
118 'no-undef': 2,
119 'no-undef-init': 2,
120 'no-unused-vars': [1, {
121 'vars': 'all',
122 'args': 'none'
123 }],
124 'no-use-before-define': [2, {
125 "functions": false
126 }],
127
128 /* Node.js and CommonJS */
129 'callback-return': 0,
130 'global-require': 2,
131 'handle-callback-err': 2,
132 'no-mixed-requires': 2,
133 'no-new-require': 2,
134 'no-path-concat': 2,
135 'no-process-env': 2,
136 'no-process-exit': 2,
137
138 /* Stylistic issues */
139 'array-bracket-spacing': [2, 'never'],
140 'block-spacing': [2, 'always'],
141 'brace-style': [2, '1tbs', {
142 "allowSingleLine": true
143 }],
144 'camelcase': 2,
145 'comma-spacing': 2,
146 'comma-style': [2, 'first', {
147 exceptions: {
148 ArrayExpression: true,
149 ObjectExpression: true
150 }
151 }],
152 'consistent-this': [2, 'self'],
153 'eol-last': 2,
154 'indent': [2, 2, {
155 MemberExpression: 'off',
156 VariableDeclarator: {
157 const: 2
158 },
159 FunctionExpression: {
160 parameters: 'first'
161 },
162 CallExpression: {
163 arguments: 'off'
164 },
165 ArrayExpression: 'first',
166 ObjectExpression: 'first'
167 }],
168 'key-spacing': [0, {
169 beforeColon: false,
170 afterColon: true,
171 mode: 'minimum'
172 }],
173 'keyword-spacing': 2,
174 'linebreak-style': 2,
175 'lines-around-comment': 2,
176 'max-depth': [2, 5],
177 'max-len': [2, 120],
178 'max-nested-callbacks': [2, 5],
179 'max-params': [2, 4],
180 'max-statements-per-line': 2,
181 'new-cap': [2, {
182 capIsNew: false
183 }],
184 'new-parens': 2,
185 'newline-after-var': 0,
186 'newline-before-return': 0,
187 'no-array-constructor': 2,
188 'no-bitwise': 0,
189 'no-continue': 2,
190 'no-lonely-if': 2,
191 'no-mixed-spaces-and-tabs': 2,
192 'no-negated-condition': 2,
193 'no-new-object': 2,
194 'no-spaced-func': 2,
195 'no-trailing-spaces': 1,
196 'no-unneeded-ternary': 2,
197 'no-whitespace-before-property': 2,
198 'object-curly-spacing': [2, 'always'],
199 'one-var-declaration-per-line': [2, 'always'],
200 'quote-props': [2, 'as-needed'],
201 'quotes': [2, 'single'],
202 'semi': [2, 'never'],
203 'space-before-blocks': 2,
204 'space-before-function-paren': [2, 'never'],
205 'space-infix-ops': 2,
206 'space-unary-ops': 2,
207 'spaced-comment': 2,
208
209 /* ES6 */
210 'arrow-spacing': 2,
211 'constructor-super': 2,
212 'no-class-assign': 2,
213 'no-confusing-arrow': 0,
214 'no-const-assign': 2,
215 'no-dupe-class-members': 2,
216 'no-duplicate-imports': 2,
217 'no-new-symbol': 2,
218 'no-this-before-super': 2,
219 'no-useless-constructor': 2,
220 'no-var': 2,
221 'object-shorthand': 0,
222 'prefer-arrow-callback': 0,
223 'prefer-const': 2,
224 'prefer-rest-params': 0,
225 'prefer-spread': 0
226 }
227}