@@ -7,67 +7,77 @@ module.exports = {
77 "unicorn/catch-error-name" : [
88 "error" ,
99 {
10- name : "error" ,
1110 caughtErrorsIgnorePattern : "^ignore"
1211 }
1312 ] ,
13+ // Enforce correct `Error` subclassing.
14+ "unicorn/custom-error-definition" : "error" ,
15+ // Enforce passing a `message` value when throwing a built-in error.
16+ "unicorn/error-message" : "error" ,
17+ // Require escape sequences to use uppercase values
18+ "unicorn/escape-case" : "error" ,
1419 // Enforce explicitly comparing the `length` property of a value
1520 "unicorn/explicit-length-check" : "error" ,
1621 // Enforce a case style for filenames
1722 "unicorn/filename-case" : "off" ,
23+ // Enforce importing index files with `..`
24+ "unicorn/import-index" : "error" ,
25+ // Enforce the use of `new` for all builtins, except `String`, `Number` and `Boolean`.
26+ "unicorn/new-for-builtins" : "error" ,
1827 // Enforce specifying rules to disable in `eslint-disable` comments
1928 "unicorn/no-abusive-eslint-disable" : "error" ,
20- // Disallow `process.exit()`
21- // Use `no-process-exit` `eslint` rule
22- "unicorn/no-process-exit" : "off" ,
23- // Require new when throwing an error (fixable)
24- "unicorn/throw-new-error" : "error" ,
25- // Enforce lowercase identifier and uppercase value for number literals
26- // Use `prettier`
27- "unicorn/number-literal-case" : "off" ,
28- // Require escape sequences to use uppercase values
29- "unicorn/escape-case" : "error" ,
3029 // Require `Array.isArray()` instead of `instanceof Array`
3130 "unicorn/no-array-instanceof" : "error" ,
31+ // Do not use leading/trailing space between `console.log` parameters.
32+ "unicorn/no-console-spaces" : "error" ,
33+ // Prevents passing a function reference directly to iterator methods.
34+ "unicorn/no-fn-reference-in-iterator" : "off" ,
35+ // Do not use a `for` loop that can be replaced with a `for-of` loop
36+ "unicorn/no-for-loop" : "error" ,
37+ // Enforce the use of unicode escapes instead of hexadecimal escapes.
38+ "unicorn/no-hex-escape" : "error" ,
3239 // Enforce the use of `Buffer.from()` and `Buffer.alloc()` instead of the deprecated `new Buffer()`
3340 // Use `node/no-deprecated-api` rule.
3441 "unicorn/no-new-buffer" : "off" ,
35- // Enforce the use of unicode escapes instead of hexadecimal escapes.
36- "unicorn/no-hex-escape" : "error" ,
37- // Enforce correct `Error` subclassing.
38- "unicorn/custom-error-definition" : "error" ,
39- // Prefer `String#startsWith` & `String#endsWith` over more complex alternatives.
40- "unicorn/prefer-starts-ends-with" : "error" ,
41- // Need investigate
42- // Enforce throwing `TypeError` in type checking conditions.
43- "unicorn/prefer-type-error" : "off" ,
44- // Prevents passing a function reference directly to iterator methods.
45- "unicorn/no-fn-reference-in-iterator" : "off" ,
46- // Enforce importing index files with `..`
47- "unicorn/import-index" : "error" ,
48- // Enforce the use of `new` for all builtins, except `String`, `Number` and `Boolean`.
49- "unicorn/new-for-builtins" : "error" ,
50- // Enforce the use of regex shorthands to improve readability.
51- "unicorn/regex-shorthand" : "error" ,
52- // Prefer the spread operator over `Array.from()`.
53- "unicorn/prefer-spread" : "error" ,
54- // Enforce passing a `message` value when throwing a built-in error.
55- "unicorn/error-message" : "error" ,
42+ // Disallow `process.exit()`
43+ // Use `no-process-exit` `eslint` rule
44+ "unicorn/no-process-exit" : "off" ,
45+ // Disallow unreadable array destructuring.
46+ "unicorn/no-unreadable-array-destructuring" : "off" ,
5647 // Disallow unsafe regular expressions.
5748 "unicorn/no-unsafe-regex" : "off" ,
49+ // Disallow unused object properties.
50+ "unicorn/no-unused-properties" : "off" ,
51+ // Disallow number literals with zero fractions or dangling dots
52+ "unicorn/no-zero-fractions" : "error" ,
53+ // Enforce lowercase identifier and uppercase value for number literals
54+ // Use `prettier`
55+ "unicorn/number-literal-case" : "off" ,
5856 // Prefer `addEventListener` over `on`-functions.
5957 "unicorn/prefer-add-event-listener" : "error" ,
6058 // Prefer the exponentiation operator over Math.pow()
6159 "unicorn/prefer-exponentiation-operator" : "error" ,
62- // Do not use leading/trailing space between `console.log` parameters.
63- "unicorn/no-console-spaces" : "error" ,
64- // Disallow unreadable array destructuring.
65- "unicorn/no-unreadable-array-destructuring" : "off" ,
66- // Disallow unused object properties.
67- "unicorn/no-unused-properties" : "off" ,
60+ // Prefer `.includes()` over `.indexOf()` when checking for existence or non-existence
61+ "unicorn/prefer-includes" : "error" ,
6862 // Prefer `append` over `appendChild`.
6963 "unicorn/prefer-node-append" : "error" ,
70- // Prefer `querySelector` over `getElementById`, `querySelectorAll` over g`etElementsByClassName` and `getElementsByTagName`
71- // Need enable in future
72- "unicorn/prefer-query-selector" : "off"
64+ // Prefer `remove` over `parentNode.removeChild` and `parentElement.removeChild`.
65+ "unicorn/prefer-node-remove" : "error" ,
66+ // Prefer `querySelector` over `getElementById`, `querySelectorAll` over `getElementsByClassName` and `getElementsByTagName`
67+ "unicorn/prefer-query-selector" : "error" ,
68+ // Prefer the spread operator over `Array.from()`.
69+ "unicorn/prefer-spread" : "error" ,
70+ // Prefer `String#startsWith` & `String#endsWith` over more complex alternatives.
71+ "unicorn/prefer-starts-ends-with" : "error" ,
72+ // Prefer `textContent` over `innerText`
73+ "unicorn/prefer-text-content" : "error" ,
74+ // Maybe enable in future
75+ // Enforce throwing `TypeError` in type checking conditions.
76+ "unicorn/prefer-type-error" : "off" ,
77+ // Prevent abbreviations
78+ "unicorn/prevent-abbreviations" : "off" ,
79+ // Enforce the use of regex shorthands to improve readability.
80+ "unicorn/regex-shorthand" : "error" ,
81+ // Require new when throwing an error (fixable)
82+ "unicorn/throw-new-error" : "error"
7383} ;
0 commit comments