@@ -6,13 +6,12 @@ module.exports = {
6
6
requireConfigFile : false ,
7
7
sourceType : 'script' ,
8
8
} ,
9
- plugins : [ 'markdown' , 'html' , 'fp' ] ,
9
+ plugins : [ 'markdown' , 'html' , 'fp' , 'unicorn' ] ,
10
10
extends : [
11
11
'eslint:recommended' ,
12
12
'standard' ,
13
13
'prettier' ,
14
14
'plugin:eslint-comments/recommended' ,
15
- 'plugin:unicorn/recommended' ,
16
15
'plugin:node/recommended' ,
17
16
'plugin:import/recommended' ,
18
17
'plugin:promise/recommended' ,
@@ -78,7 +77,8 @@ module.exports = {
78
77
] ,
79
78
'no-multi-assign' : 2 ,
80
79
'no-negated-condition' : 2 ,
81
- 'no-nested-ternary' : 2 ,
80
+ // Conflicts with unicorn/no-nested-ternary
81
+ 'no-nested-ternary' : 0 ,
82
82
'no-nonoctal-decimal-escape' : 2 ,
83
83
'no-param-reassign' : [
84
84
2 ,
@@ -182,7 +182,7 @@ module.exports = {
182
182
// TODO: remove once bug in eslint-plugin-node is fixed:
183
183
// https://github.com/mysticatea/eslint-plugin-node/issues/250
184
184
'node/no-unsupported-features/es-syntax' : [
185
- 'error' ,
185
+ 2 ,
186
186
{
187
187
ignores : [ 'modules' , 'dynamicImport' ] ,
188
188
} ,
@@ -210,7 +210,6 @@ module.exports = {
210
210
211
211
'react/prop-types' : 0 ,
212
212
213
- // Not enabled by default in unicorn/recommended, but still pretty useful
214
213
'unicorn/custom-error-definition' : 2 ,
215
214
'unicorn/no-unused-properties' : 2 ,
216
215
// The additional `non-zero` option is useful for code consistency
@@ -240,6 +239,92 @@ module.exports = {
240
239
// TODO: enable those rules
241
240
'unicorn/no-process-exit' : 0 ,
242
241
'unicorn/import-style' : 0 ,
242
+ // Useful rules
243
+ 'unicorn/catch-error-name' : 2 ,
244
+ 'unicorn/consistent-destructuring' : 2 ,
245
+ 'unicorn/consistent-function-scoping' : 2 ,
246
+ 'unicorn/empty-brace-spaces' : 2 ,
247
+ 'unicorn/error-message' : 2 ,
248
+ 'unicorn/escape-case' : 2 ,
249
+ 'unicorn/import-index' : 0 ,
250
+ 'unicorn/new-for-builtins' : 2 ,
251
+ 'unicorn/no-abusive-eslint-disable' : 2 ,
252
+ 'unicorn/no-array-method-this-argument' : 2 ,
253
+ 'unicorn/no-array-push-push' : 2 ,
254
+ 'unicorn/no-await-expression-member' : 2 ,
255
+ 'unicorn/no-console-spaces' : 2 ,
256
+ 'unicorn/no-document-cookie' : 2 ,
257
+ 'unicorn/no-empty-file' : 2 ,
258
+ 'unicorn/no-for-loop' : 2 ,
259
+ 'unicorn/no-hex-escape' : 2 ,
260
+ 'unicorn/no-instanceof-array' : 2 ,
261
+ 'unicorn/no-invalid-remove-event-listener' : 2 ,
262
+ 'unicorn/no-keyword-prefix' : 0 ,
263
+ 'unicorn/no-lonely-if' : 2 ,
264
+ 'unicorn/no-nested-ternary' : 2 ,
265
+ 'unicorn/no-new-array' : 2 ,
266
+ 'unicorn/no-new-buffer' : 2 ,
267
+ 'unicorn/no-object-as-default-parameter' : 2 ,
268
+ 'unicorn/no-static-only-class' : 2 ,
269
+ 'unicorn/no-thenable' : 2 ,
270
+ 'unicorn/no-this-assignment' : 2 ,
271
+ 'unicorn/no-unsafe-regex' : 0 ,
272
+ 'unicorn/no-useless-fallback-in-spread' : 2 ,
273
+ 'unicorn/no-useless-length-check' : 2 ,
274
+ 'unicorn/no-useless-promise-resolve-reject' : 2 ,
275
+ 'unicorn/no-useless-spread' : 2 ,
276
+ 'unicorn/no-useless-undefined' : 2 ,
277
+ 'unicorn/no-zero-fractions' : 2 ,
278
+ 'unicorn/numeric-separators-style' : 2 ,
279
+ 'unicorn/prefer-add-event-listener' : 2 ,
280
+ 'unicorn/prefer-array-find' : 2 ,
281
+ 'unicorn/prefer-array-flat' : 2 ,
282
+ 'unicorn/prefer-array-flat-map' : 2 ,
283
+ 'unicorn/prefer-array-index-of' : 2 ,
284
+ 'unicorn/prefer-array-some' : 2 ,
285
+ // TODO: Enable this by default when targeting a Node.js version that supports `Array#at`.
286
+ 'unicorn/prefer-at' : 0 ,
287
+ 'unicorn/prefer-code-point' : 2 ,
288
+ 'unicorn/prefer-date-now' : 2 ,
289
+ 'unicorn/prefer-default-parameters' : 2 ,
290
+ 'unicorn/prefer-dom-node-append' : 2 ,
291
+ 'unicorn/prefer-dom-node-dataset' : 2 ,
292
+ 'unicorn/prefer-dom-node-remove' : 2 ,
293
+ 'unicorn/prefer-dom-node-text-content' : 2 ,
294
+ 'unicorn/prefer-export-from' : 2 ,
295
+ 'unicorn/prefer-includes' : 2 ,
296
+ 'unicorn/prefer-json-parse-buffer' : 2 ,
297
+ 'unicorn/prefer-keyboard-event-key' : 2 ,
298
+ 'unicorn/prefer-math-trunc' : 2 ,
299
+ 'unicorn/prefer-modern-dom-apis' : 2 ,
300
+ 'unicorn/prefer-negative-index' : 2 ,
301
+ 'unicorn/prefer-number-properties' : 2 ,
302
+ 'unicorn/prefer-optional-catch-binding' : 2 ,
303
+ 'unicorn/prefer-prototype-methods' : 2 ,
304
+ 'unicorn/prefer-query-selector' : 2 ,
305
+ 'unicorn/prefer-reflect-apply' : 2 ,
306
+ 'unicorn/prefer-regexp-test' : 2 ,
307
+ 'unicorn/prefer-set-has' : 2 ,
308
+ 'unicorn/prefer-spread' : 2 ,
309
+ // TODO: Enable this by default when targeting Node.js 16.
310
+ 'unicorn/prefer-string-replace-all' : 0 ,
311
+ 'unicorn/prefer-string-slice' : 2 ,
312
+ 'unicorn/prefer-string-starts-ends-with' : 2 ,
313
+ 'unicorn/prefer-string-trim-start-end' : 2 ,
314
+ 'unicorn/prefer-switch' : 2 ,
315
+ 'unicorn/prefer-ternary' : 2 ,
316
+ // TODO: Enable this by default when targeting Node.js 14.
317
+ 'unicorn/prefer-top-level-await' : 0 ,
318
+ 'unicorn/prefer-type-error' : 2 ,
319
+ 'unicorn/relative-url-style' : 2 ,
320
+ 'unicorn/require-array-join-separator' : 2 ,
321
+ 'unicorn/require-number-to-fixed-digits-argument' : 2 ,
322
+ // Turned off because we can't distinguish `window.postMessage` and `{Worker,MessagePort,Client,BroadcastChannel}#postMessage()`
323
+ // See https://github.com/sindresorhus/eslint-plugin-unicorn/issues/1396
324
+ 'unicorn/require-post-message-target-origin' : 0 ,
325
+ 'unicorn/string-content' : 0 ,
326
+ 'unicorn/template-indent' : 1 ,
327
+ 'unicorn/throw-new-error' : 2 ,
243
328
} ,
244
329
overrides : [
245
330
{
0 commit comments