|
1 | 1 | { |
2 | 2 | "root": true, |
3 | 3 | "parser": "babel-eslint", |
4 | | - "env": { |
5 | | - "browser": true, |
6 | | - "es6": true |
7 | | - }, |
8 | | - "extends": "eslint:recommended", |
9 | | - "plugins": ["compat"], |
| 4 | + "extends": [ |
| 5 | + "plugin:import/errors", |
| 6 | + "plugin:import/warnings", |
| 7 | + "plugin:unicorn/recommended", |
| 8 | + "xo/esnext", |
| 9 | + "xo/browser" |
| 10 | + ], |
10 | 11 | "rules": { |
11 | | - // Possible Errors |
12 | | - "no-await-in-loop": "error", |
13 | | - "no-extra-parens": "error", |
14 | | - "no-prototype-builtins": "error", |
15 | | - "no-template-curly-in-string": "error", |
16 | | - "compat/compat": "warn", |
17 | | - "valid-jsdoc": "error", |
18 | | - |
19 | | - // Best Practices |
20 | | - "accessor-pairs": "error", |
21 | | - "array-callback-return": "error", |
22 | | - "block-scoped-var": "error", |
23 | | - "class-methods-use-this": "off", |
24 | | - "complexity": "error", |
25 | | - "consistent-return": "error", |
26 | | - "curly": "error", |
27 | | - "default-case": "error", |
28 | | - "dot-location": ["error", "property"], |
29 | | - "dot-notation": "error", |
30 | | - "eqeqeq": "error", |
31 | | - "guard-for-in": "error", |
32 | | - "no-alert": "error", |
33 | | - "no-caller": "error", |
34 | | - "no-console": "warn", |
35 | | - "no-div-regex": "error", |
36 | | - "no-else-return": "error", |
37 | | - "no-empty-function": "error", |
38 | | - "no-eq-null": "error", |
39 | | - "no-eval": "error", |
40 | | - "no-extend-native": "error", |
41 | | - "no-extra-bind": "error", |
42 | | - "no-extra-label": "error", |
43 | | - "no-floating-decimal": "error", |
44 | | - "no-implicit-coercion": "error", |
45 | | - "no-implicit-globals": "error", |
46 | | - "no-implied-eval": "error", |
47 | | - "no-invalid-this": "off", |
48 | | - "no-iterator": "error", |
49 | | - "no-labels": "error", |
50 | | - "no-lone-blocks": "error", |
51 | | - "no-loop-func": "error", |
52 | | - "no-magic-numbers": ["error", { |
53 | | - "ignore": [-1, 0, 1], |
54 | | - "ignoreArrayIndexes": true |
| 12 | + "capitalized-comments": "off", |
| 13 | + "indent": [ |
| 14 | + "error", |
| 15 | + 2, |
| 16 | + { |
| 17 | + "MemberExpression": "off", |
| 18 | + "SwitchCase": 1 |
55 | 19 | } |
56 | 20 | ], |
57 | | - "no-multi-spaces": ["error", { |
58 | | - "ignoreEOLComments": true, |
59 | | - "exceptions": { |
60 | | - "AssignmentExpression": true, |
61 | | - "ArrowFunctionExpression": true, |
62 | | - "CallExpression": true, |
63 | | - "VariableDeclarator": true |
64 | | - } |
65 | | - } |
| 21 | + "max-params": [ |
| 22 | + "warn", |
| 23 | + 5 |
66 | 24 | ], |
67 | | - "no-multi-str": "error", |
68 | | - "no-new": "error", |
69 | | - "no-new-func": "error", |
70 | | - "no-new-wrappers": "error", |
71 | | - "no-octal-escape": "error", |
72 | | - "no-param-reassign": "off", |
73 | | - "no-proto": "error", |
74 | | - "no-restricted-properties": "error", |
75 | | - "no-return-assign": "error", |
76 | | - "no-return-await": "error", |
77 | | - "no-script-url": "error", |
78 | | - "no-self-compare": "error", |
79 | | - "no-sequences": "error", |
80 | | - "no-throw-literal": "error", |
81 | | - "no-unmodified-loop-condition": "error", |
82 | | - "no-unused-expressions": "error", |
83 | | - "no-useless-call": "error", |
84 | | - "no-useless-concat": "error", |
85 | | - "no-useless-return": "error", |
86 | | - "no-void": "error", |
87 | | - "no-warning-comments": "off", |
88 | | - "no-with": "error", |
89 | | - "prefer-promise-reject-errors": "error", |
90 | | - "radix": "error", |
91 | | - "require-await": "error", |
92 | | - "vars-on-top": "error", |
93 | | - "wrap-iife": "error", |
94 | | - "yoda": "error", |
95 | | - |
96 | | - // Strict Mode |
97 | | - "strict": "error", |
98 | | - |
99 | | - // Variables |
100 | | - "init-declarations": "off", |
101 | | - "no-catch-shadow": "error", |
102 | | - "no-label-var": "error", |
103 | | - "no-restricted-globals": "error", |
104 | | - "no-shadow": "off", |
105 | | - "no-shadow-restricted-names": "error", |
106 | | - "no-undef-init": "error", |
107 | | - "no-undefined": "error", |
108 | | - "no-use-before-define": "off", |
109 | | - |
110 | | - // Node.js and CommonJS |
111 | | - "callback-return": "off", |
112 | | - "global-require": "error", |
113 | | - "handle-callback-err": "error", |
114 | | - "no-mixed-requires": "error", |
115 | | - "no-new-require": "error", |
116 | | - "no-path-concat": "error", |
117 | | - "no-process-env": "error", |
118 | | - "no-process-exit": "error", |
119 | | - "no-restricted-modules": "error", |
120 | | - "no-sync": "error", |
121 | | - |
122 | | - // Stylistic Issues |
123 | | - "array-bracket-spacing": "error", |
124 | | - "block-spacing": "error", |
125 | | - "brace-style": "error", |
126 | | - "camelcase": "error", |
127 | | - "capitalized-comments": "off", |
128 | | - "comma-dangle": "error", |
129 | | - "comma-spacing": "error", |
130 | | - "comma-style": "error", |
131 | | - "computed-property-spacing": "error", |
132 | | - "consistent-this": "error", |
133 | | - "eol-last": "error", |
134 | | - "func-call-spacing": "error", |
135 | | - "func-name-matching": "error", |
136 | | - "func-names": "off", |
137 | | - "func-style": ["error", "declaration", { "allowArrowFunctions": true }], |
138 | | - "id-blacklist": "error", |
139 | | - "id-length": "off", |
140 | | - "id-match": "error", |
141 | | - "indent": ["error", 2, { "SwitchCase": 1 }], |
142 | | - "jsx-quotes": "error", |
143 | | - "key-spacing": "off", |
144 | | - "keyword-spacing": "error", |
145 | | - "linebreak-style": ["error", "unix"], |
146 | | - "line-comment-position": "off", |
147 | | - "lines-around-comment": "off", |
148 | | - "lines-around-directive": "error", |
149 | | - "max-depth": ["error", 10], |
150 | | - "max-len": "off", |
151 | | - "max-lines": "off", |
152 | | - "max-nested-callbacks": "error", |
153 | | - "max-params": "off", |
154 | | - "max-statements": "off", |
155 | | - "max-statements-per-line": "error", |
156 | | - "multiline-ternary": "off", |
157 | | - "new-cap": ["error", { "capIsNewExceptionPattern": "$.*" }], |
158 | | - "newline-after-var": "off", |
159 | | - "newline-per-chained-call": ["error", { "ignoreChainWithDepth": 5 }], |
160 | | - "new-parens": "error", |
161 | | - "no-array-constructor": "error", |
162 | | - "no-bitwise": "error", |
163 | | - "no-continue": "off", |
164 | | - "no-inline-comments": "off", |
165 | | - "no-lonely-if": "error", |
| 25 | + "multiline-ternary": [ |
| 26 | + "error", |
| 27 | + "always-multiline" |
| 28 | + ], |
| 29 | + "new-cap": "off", |
166 | 30 | "no-mixed-operators": "off", |
167 | | - "no-multi-assign": "error", |
168 | | - "no-multiple-empty-lines": "error", |
169 | | - "nonblock-statement-body-position": "error", |
170 | | - "no-negated-condition": "off", |
171 | | - "no-nested-ternary": "error", |
172 | | - "no-new-object": "error", |
173 | | - "no-plusplus": "off", |
174 | | - "no-restricted-syntax": "error", |
175 | | - "no-tabs": "error", |
176 | | - "no-ternary": "off", |
177 | | - "no-trailing-spaces": "error", |
178 | | - "no-underscore-dangle": "off", |
179 | | - "no-unneeded-ternary": "error", |
180 | | - "no-whitespace-before-property": "error", |
181 | | - "object-curly-newline": ["error", { "minProperties": 1 }], |
182 | | - "object-curly-spacing": ["error", "always"], |
183 | | - "object-property-newline": "error", |
184 | | - "one-var": ["error", "never"], |
185 | | - "one-var-declaration-per-line": "error", |
186 | | - "operator-assignment": "error", |
187 | | - "operator-linebreak": "error", |
188 | | - "padded-blocks": ["error", "never"], |
189 | | - "padding-line-between-statements": "off", |
190 | | - "quote-props": ["error", "as-needed"], |
191 | | - "quotes": ["error", "single"], |
192 | | - "require-jsdoc": "off", |
193 | | - "semi": ["error", "never"], |
194 | | - "semi-spacing": "error", |
195 | | - "sort-keys": "off", |
196 | | - "sort-vars": "error", |
197 | | - "space-before-blocks": "error", |
198 | | - "space-before-function-paren": ["error", { |
199 | | - "anonymous": "always", |
200 | | - "named": "never" |
201 | | - }], |
202 | | - "space-in-parens": "error", |
203 | | - "space-infix-ops": "error", |
204 | | - "space-unary-ops": "error", |
205 | | - "spaced-comment": "error", |
206 | | - "template-tag-spacing": "error", |
207 | | - "unicode-bom": "error", |
208 | | - "wrap-regex": "off", |
209 | | - |
210 | | - // ECMAScript 6 |
211 | | - "arrow-body-style": ["error", "as-needed"], |
212 | | - "arrow-parens": "error", |
213 | | - "arrow-spacing": "error", |
214 | | - "generator-star-spacing": "error", |
215 | | - "no-confusing-arrow": "error", |
216 | | - "no-duplicate-imports": "error", |
217 | | - "no-restricted-imports": "error", |
218 | | - "no-useless-computed-key": "error", |
219 | | - "no-useless-constructor": "error", |
220 | | - "no-useless-rename": "error", |
221 | | - "no-var": "error", |
222 | | - "object-shorthand": "error", |
223 | | - "prefer-arrow-callback": "error", |
224 | | - "prefer-const": "error", |
225 | | - "prefer-destructuring": "off", |
226 | | - "prefer-numeric-literals": "error", |
227 | | - "prefer-rest-params": "error", |
228 | | - "prefer-spread": "error", |
229 | | - "prefer-template": "error", |
230 | | - "rest-spread-spacing": "error", |
231 | | - "sort-imports": "error", |
232 | | - "symbol-description": "error", |
233 | | - "template-curly-spacing": "error", |
234 | | - "yield-star-spacing": "error" |
| 31 | + "object-curly-spacing": [ |
| 32 | + "error", |
| 33 | + "always" |
| 34 | + ], |
| 35 | + "prefer-destructuring": [ |
| 36 | + "error", |
| 37 | + { |
| 38 | + "object": true, |
| 39 | + "array": false |
| 40 | + } |
| 41 | + ], |
| 42 | + "semi": [ |
| 43 | + "error", |
| 44 | + "never" |
| 45 | + ], |
| 46 | + "unicorn/explicit-length-check": "off", |
| 47 | + "unicorn/filename-case": "off", |
| 48 | + "unicorn/import-index": "off", |
| 49 | + "unicorn/no-unused-properties": "error", |
| 50 | + "unicorn/prefer-includes": "off", |
| 51 | + "unicorn/prefer-node-append": "off", |
| 52 | + "unicorn/prefer-node-remove": "off", |
| 53 | + "unicorn/prefer-query-selector": "off", |
| 54 | + "unicorn/prefer-text-content": "off", |
| 55 | + "unicorn/prevent-abbreviations": "off" |
235 | 56 | } |
236 | 57 | } |
0 commit comments