Skip to content

Commit 20c6341

Browse files
authored
Rename rules (#959)
1 parent e1e4e94 commit 20c6341

File tree

58 files changed

+139
-81
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+139
-81
lines changed

docs/deprecated-rules.md

+50-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,57 @@
11
# Deprecated Rules
22

3+
## no-fn-reference-in-iterator
4+
5+
This rule was renamed to [`no-array-callback-reference`](rules/no-array-callback-reference.md) to avoid using the abbreviation `fn` in the name.
6+
7+
## no-array-instanceof
8+
9+
This rule was renamed to [`no-instanceof-array`](rules/no-instanceof-array.md) to be more correct.
10+
11+
## no-reduce
12+
13+
This rule was renamed to [`no-array-reduce`](rules/no-array-reduce.md) to be more specific.
14+
15+
## prefer-dataset
16+
17+
This rule was renamed to [`prefer-dom-node-dataset`](rules/prefer-dom-node-dataset.md) to be more specific.
18+
19+
## prefer-event-key
20+
21+
This rule was renamed to [`prefer-keyboard-event-key`](rules/prefer-keyboard-event-key.md) to be more specific.
22+
323
## prefer-exponentiation-operator
424

5-
This rule is deprecated in favor of the built-in ESLint [`prefer-exponentiation-operator`](https://eslint.org/docs/rules/prefer-exponentiation-operator) rule.
25+
This rule was deprecated in favor of the built-in ESLint [`prefer-exponentiation-operator`](https://eslint.org/docs/rules/prefer-exponentiation-operator) rule.
26+
27+
## prefer-flat-map
28+
29+
This rule was renamed to [`prefer-array-flat-map`](rules/prefer-array-flat-map.md) to be more specific.
30+
31+
## prefer-node-append
32+
33+
This rule was renamed to [`prefer-dom-node-append`](rules/prefer-dom-node-append.md) to be less ambiguous.
34+
35+
## prefer-node-remove
36+
37+
This rule was renamed to [`prefer-dom-node-remove`](rules/prefer-dom-node-remove.md) to be less ambiguous.
38+
39+
## prefer-replace-all
40+
41+
This rule was renamed to [`prefer-string-replace-all`](rules/prefer-string-replace-all.md) to be more specific.
42+
43+
## prefer-starts-ends-with
44+
45+
This rule was renamed to [`prefer-string-starts-ends-with`](rules/prefer-string-starts-ends-with.md) to be more specific.
46+
47+
## prefer-text-content
48+
49+
This rule was renamed to [`prefer-dom-node-text-content`](rules/prefer-dom-node-text-content.md) to be more specific.
50+
51+
## prefer-trim-start-end
52+
53+
This rule was renamed to [`prefer-string-trim-start-end`](rules/prefer-string-trim-start-end.md) to be more specific.
654

755
## regex-shorthand
856

9-
This rule was renamed to [`better-regex`](rules/better-regex.md).
57+
This rule was renamed to [`better-regex`](rules/better-regex.md) as it does more than just preferring the shorthand.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

index.js

+26-14
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,19 @@ const createDeprecatedRules = require('./rules/utils/create-deprecated-rules');
55

66
const deprecatedRules = createDeprecatedRules({
77
// {ruleId: ReplacementRuleId | ReplacementRuleId[]}, if no replacement, use `{ruleId: []}`
8+
'no-array-instanceof': 'unicorn/no-instanceof-array',
9+
'no-fn-reference-in-iterator': 'unicorn/no-array-callback-reference',
10+
'no-reduce': 'unicorn/no-array-reduce',
11+
'prefer-event-key': 'unicorn/prefer-keyboard-event-key',
812
'prefer-exponentiation-operator': 'prefer-exponentiation-operator',
13+
'prefer-dataset': 'unicorn/prefer-dom-node-dataset',
14+
'prefer-flat-map': 'unicorn/prefer-array-flat-map',
15+
'prefer-node-append': 'unicorn/prefer-dom-node-append',
16+
'prefer-node-remove': 'unicorn/prefer-dom-node-remove',
17+
'prefer-replace-all': 'unicorn/prefer-string-replace-all',
18+
'prefer-starts-ends-with': 'unicorn/prefer-string-starts-ends-with',
19+
'prefer-text-content': 'unicorn/prefer-dom-node-text-content',
20+
'prefer-trim-start-end': 'unicorn/prefer-string-trim-start-end',
921
'regex-shorthand': 'unicorn/better-regex'
1022
});
1123

@@ -41,11 +53,12 @@ module.exports = {
4153
'unicorn/import-style': 'error',
4254
'unicorn/new-for-builtins': 'error',
4355
'unicorn/no-abusive-eslint-disable': 'error',
44-
'unicorn/no-array-instanceof': 'error',
56+
'unicorn/no-array-callback-reference': 'error',
57+
'unicorn/no-array-reduce': 'error',
4558
'unicorn/no-console-spaces': 'error',
46-
'unicorn/no-fn-reference-in-iterator': 'error',
4759
'unicorn/no-for-loop': 'error',
4860
'unicorn/no-hex-escape': 'error',
61+
'unicorn/no-instanceof-array': 'error',
4962
'unicorn/no-keyword-prefix': 'off',
5063
'unicorn/no-lonely-if': 'error',
5164
'no-nested-ternary': 'off',
@@ -54,7 +67,6 @@ module.exports = {
5467
'unicorn/no-null': 'error',
5568
'unicorn/no-object-as-default-parameter': 'error',
5669
'unicorn/no-process-exit': 'error',
57-
'unicorn/no-reduce': 'error',
5870
'unicorn/no-unreadable-array-destructuring': 'error',
5971
'unicorn/no-unsafe-regex': 'off',
6072
'unicorn/no-unused-properties': 'off',
@@ -65,32 +77,32 @@ module.exports = {
6577
'unicorn/numeric-separators-style': 'off',
6678
'unicorn/prefer-add-event-listener': 'error',
6779
'unicorn/prefer-array-find': 'error',
80+
// TODO: Enable this by default when targeting Node.js 12.
81+
'unicorn/prefer-array-flat-map': 'off',
6882
'unicorn/prefer-array-some': 'error',
69-
'unicorn/prefer-dataset': 'error',
7083
'unicorn/prefer-date-now': 'error',
7184
'unicorn/prefer-default-parameters': 'error',
72-
'unicorn/prefer-event-key': 'error',
73-
// TODO: Enable this by default when targeting Node.js 12.
74-
'unicorn/prefer-flat-map': 'off',
85+
'unicorn/prefer-dom-node-append': 'error',
86+
'unicorn/prefer-dom-node-dataset': 'error',
87+
'unicorn/prefer-dom-node-remove': 'error',
88+
'unicorn/prefer-dom-node-text-content': 'error',
7589
'unicorn/prefer-includes': 'error',
90+
'unicorn/prefer-keyboard-event-key': 'error',
7691
'unicorn/prefer-math-trunc': 'error',
7792
'unicorn/prefer-modern-dom-apis': 'error',
7893
'unicorn/prefer-negative-index': 'error',
79-
'unicorn/prefer-node-append': 'error',
80-
'unicorn/prefer-node-remove': 'error',
8194
'unicorn/prefer-number-properties': 'error',
8295
'unicorn/prefer-optional-catch-binding': 'error',
8396
'unicorn/prefer-query-selector': 'error',
8497
'unicorn/prefer-reflect-apply': 'error',
85-
// TODO: Enable this by default when targeting Node.js 16.
86-
'unicorn/prefer-replace-all': 'off',
8798
'unicorn/prefer-set-has': 'error',
8899
'unicorn/prefer-spread': 'error',
89-
'unicorn/prefer-starts-ends-with': 'error',
100+
// TODO: Enable this by default when targeting Node.js 16.
101+
'unicorn/prefer-string-replace-all': 'off',
90102
'unicorn/prefer-string-slice': 'error',
103+
'unicorn/prefer-string-starts-ends-with': 'error',
104+
'unicorn/prefer-string-trim-start-end': 'error',
91105
'unicorn/prefer-ternary': 'error',
92-
'unicorn/prefer-text-content': 'error',
93-
'unicorn/prefer-trim-start-end': 'error',
94106
'unicorn/prefer-type-error': 'error',
95107
'unicorn/prevent-abbreviations': 'error',
96108
'unicorn/string-content': 'off',

readme.md

+24-24
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,12 @@ Configure it in `package.json`.
4747
"unicorn/import-style": "error",
4848
"unicorn/new-for-builtins": "error",
4949
"unicorn/no-abusive-eslint-disable": "error",
50-
"unicorn/no-array-instanceof": "error",
50+
"unicorn/no-array-callback-reference": "error",
51+
"unicorn/no-array-reduce": "error",
5152
"unicorn/no-console-spaces": "error",
52-
"unicorn/no-fn-reference-in-iterator": "error",
5353
"unicorn/no-for-loop": "error",
5454
"unicorn/no-hex-escape": "error",
55+
"unicorn/no-instanceof-array": "error",
5556
"unicorn/no-keyword-prefix": "off",
5657
"unicorn/no-lonely-if": "error",
5758
"no-nested-ternary": "off",
@@ -60,7 +61,6 @@ Configure it in `package.json`.
6061
"unicorn/no-null": "error",
6162
"unicorn/no-object-as-default-parameter": "error",
6263
"unicorn/no-process-exit": "error",
63-
"unicorn/no-reduce": "error",
6464
"unicorn/no-unreadable-array-destructuring": "error",
6565
"unicorn/no-unsafe-regex": "off",
6666
"unicorn/no-unused-properties": "off",
@@ -70,30 +70,30 @@ Configure it in `package.json`.
7070
"unicorn/numeric-separators-style": "off",
7171
"unicorn/prefer-add-event-listener": "error",
7272
"unicorn/prefer-array-find": "error",
73+
"unicorn/prefer-array-flat-map": "error",
7374
"unicorn/prefer-array-some": "error",
74-
"unicorn/prefer-dataset": "error",
7575
"unicorn/prefer-date-now": "error",
7676
"unicorn/prefer-default-parameters": "error",
77-
"unicorn/prefer-event-key": "error",
78-
"unicorn/prefer-flat-map": "error",
77+
"unicorn/prefer-dom-node-append": "error",
78+
"unicorn/prefer-dom-node-dataset": "error",
79+
"unicorn/prefer-dom-node-remove": "error",
80+
"unicorn/prefer-dom-node-text-content": "error",
7981
"unicorn/prefer-includes": "error",
82+
"unicorn/prefer-keyboard-event-key": "error",
8083
"unicorn/prefer-math-trunc": "error",
8184
"unicorn/prefer-modern-dom-apis": "error",
8285
"unicorn/prefer-negative-index": "error",
83-
"unicorn/prefer-node-append": "error",
84-
"unicorn/prefer-node-remove": "error",
8586
"unicorn/prefer-number-properties": "error",
8687
"unicorn/prefer-optional-catch-binding": "error",
8788
"unicorn/prefer-query-selector": "error",
8889
"unicorn/prefer-reflect-apply": "error",
89-
"unicorn/prefer-replace-all": "off",
9090
"unicorn/prefer-set-has": "error",
9191
"unicorn/prefer-spread": "error",
92-
"unicorn/prefer-starts-ends-with": "error",
92+
"unicorn/prefer-string-replace-all": "off",
9393
"unicorn/prefer-string-slice": "error",
94+
"unicorn/prefer-string-starts-ends-with": "error",
95+
"unicorn/prefer-string-trim-start-end": "error",
9496
"unicorn/prefer-ternary": "off",
95-
"unicorn/prefer-text-content": "error",
96-
"unicorn/prefer-trim-start-end": "error",
9797
"unicorn/prefer-type-error": "error",
9898
"unicorn/prevent-abbreviations": "error",
9999
"unicorn/string-content": "off",
@@ -119,19 +119,19 @@ Configure it in `package.json`.
119119
- [import-style](docs/rules/import-style.md) - Enforce specific import styles per module.
120120
- [new-for-builtins](docs/rules/new-for-builtins.md) - Enforce the use of `new` for all builtins, except `String`, `Number`, `Boolean`, `Symbol` and `BigInt`. *(partly fixable)*
121121
- [no-abusive-eslint-disable](docs/rules/no-abusive-eslint-disable.md) - Enforce specifying rules to disable in `eslint-disable` comments.
122-
- [no-array-instanceof](docs/rules/no-array-instanceof.md) - Require `Array.isArray()` instead of `instanceof Array`. *(fixable)*
122+
- [no-array-callback-reference](docs/rules/no-array-callback-reference.md) - Prevent passing a function reference directly to iterator methods.
123+
- [no-array-reduce](docs/rules/no-array-reduce.md) - Disallow `Array#reduce()` and `Array#reduceRight()`.
123124
- [no-console-spaces](docs/rules/no-console-spaces.md) - Do not use leading/trailing space between `console.log` parameters. *(fixable)*
124-
- [no-fn-reference-in-iterator](docs/rules/no-fn-reference-in-iterator.md) - Prevent passing a function reference directly to iterator methods.
125125
- [no-for-loop](docs/rules/no-for-loop.md) - Do not use a `for` loop that can be replaced with a `for-of` loop. *(partly fixable)*
126126
- [no-hex-escape](docs/rules/no-hex-escape.md) - Enforce the use of Unicode escapes instead of hexadecimal escapes. *(fixable)*
127+
- [no-instanceof-array](docs/rules/no-instanceof-array.md) - Require `Array.isArray()` instead of `instanceof Array`. *(fixable)*
127128
- [no-keyword-prefix](docs/rules/no-keyword-prefix.md) - Disallow identifiers starting with `new` or `class`.
128129
- [no-lonely-if](docs/rules/no-lonely-if.md) - Disallow `if` statements as the only statement in `if` blocks without `else`. *(fixable)*
129130
- [no-nested-ternary](docs/rules/no-nested-ternary.md) - Disallow nested ternary expressions. *(partly fixable)*
130131
- [no-new-buffer](docs/rules/no-new-buffer.md) - Enforce the use of `Buffer.from()` and `Buffer.alloc()` instead of the deprecated `new Buffer()`. *(fixable)*
131132
- [no-null](docs/rules/no-null.md) - Disallow the use of the `null` literal.
132133
- [no-object-as-default-parameter](docs/rules/no-object-as-default-parameter.md) - Disallow the use of objects as default parameters.
133134
- [no-process-exit](docs/rules/no-process-exit.md) - Disallow `process.exit()`.
134-
- [no-reduce](docs/rules/no-reduce.md) - Disallow `Array#reduce()` and `Array#reduceRight()`.
135135
- [no-unreadable-array-destructuring](docs/rules/no-unreadable-array-destructuring.md) - Disallow unreadable array destructuring.
136136
- [no-unsafe-regex](docs/rules/no-unsafe-regex.md) - Disallow unsafe regular expressions.
137137
- [no-unused-properties](docs/rules/no-unused-properties.md) - Disallow unused object properties.
@@ -141,30 +141,30 @@ Configure it in `package.json`.
141141
- [numeric-separators-style](docs/rules/numeric-separators-style.md) - Enforce the style of numeric separators by correctly grouping digits. *(fixable)*
142142
- [prefer-add-event-listener](docs/rules/prefer-add-event-listener.md) - Prefer `.addEventListener()` and `.removeEventListener()` over `on`-functions. *(partly fixable)*
143143
- [prefer-array-find](docs/rules/prefer-array-find.md) - Prefer `.find(…)` over the first element from `.filter(…)`. *(partly fixable)*
144+
- [prefer-array-flat-map](docs/rules/prefer-array-flat-map.md) - Prefer `.flatMap(…)` over `.map(…).flat()`. *(fixable)*
144145
- [prefer-array-some](docs/rules/prefer-array-some.md) - Prefer `.some(…)` over `.find(…)`.
145-
- [prefer-dataset](docs/rules/prefer-dataset.md) - Prefer using `.dataset` on DOM elements over `.setAttribute(…)`. *(fixable)*
146146
- [prefer-date-now](docs/rules/prefer-date-now.md) - Prefer `Date.now()` to get the number of milliseconds since the Unix Epoch. *(fixable)*
147147
- [prefer-default-parameters](docs/rules/prefer-default-parameters.md) - Prefer default parameters over reassignment. *(fixable)*
148-
- [prefer-event-key](docs/rules/prefer-event-key.md) - Prefer `KeyboardEvent#key` over `KeyboardEvent#keyCode`. *(partly fixable)*
149-
- [prefer-flat-map](docs/rules/prefer-flat-map.md) - Prefer `.flatMap(…)` over `.map(…).flat()`. *(fixable)*
148+
- [prefer-dom-node-append](docs/rules/prefer-dom-node-append.md) - Prefer `Node#append()` over `Node#appendChild()`. *(fixable)*
149+
- [prefer-dom-node-dataset](docs/rules/prefer-dom-node-dataset.md) - Prefer using `.dataset` on DOM elements over `.setAttribute(…)`. *(fixable)*
150+
- [prefer-dom-node-remove](docs/rules/prefer-dom-node-remove.md) - Prefer `childNode.remove()` over `parentNode.removeChild(childNode)`. *(fixable)*
151+
- [prefer-dom-node-text-content](docs/rules/prefer-dom-node-text-content.md) - Prefer `.textContent` over `.innerText`. *(fixable)*
150152
- [prefer-includes](docs/rules/prefer-includes.md) - Prefer `.includes()` over `.indexOf()` when checking for existence or non-existence. *(fixable)*
153+
- [prefer-keyboard-event-key](docs/rules/prefer-keyboard-event-key.md) - Prefer `KeyboardEvent#key` over `KeyboardEvent#keyCode`. *(partly fixable)*
151154
- [prefer-math-trunc](docs/rules/prefer-math-trunc.md) - Enforce the use of `Math.trunc` instead of bitwise operators. *(partly fixable)*
152155
- [prefer-modern-dom-apis](docs/rules/prefer-modern-dom-apis.md) - Prefer `.before()` over `.insertBefore()`, `.replaceWith()` over `.replaceChild()`, prefer one of `.before()`, `.after()`, `.append()` or `.prepend()` over `insertAdjacentText()` and `insertAdjacentElement()`. *(fixable)*
153156
- [prefer-negative-index](docs/rules/prefer-negative-index.md) - Prefer negative index over `.length - index` for `{String,Array,TypedArray}#slice()` and `Array#splice()`. *(fixable)*
154-
- [prefer-node-append](docs/rules/prefer-node-append.md) - Prefer `Node#append()` over `Node#appendChild()`. *(fixable)*
155-
- [prefer-node-remove](docs/rules/prefer-node-remove.md) - Prefer `childNode.remove()` over `parentNode.removeChild(childNode)`. *(fixable)*
156157
- [prefer-number-properties](docs/rules/prefer-number-properties.md) - Prefer `Number` static properties over global ones. *(fixable)*
157158
- [prefer-optional-catch-binding](docs/rules/prefer-optional-catch-binding.md) - Prefer omitting the `catch` binding parameter. *(fixable)*
158159
- [prefer-query-selector](docs/rules/prefer-query-selector.md) - Prefer `.querySelector()` over `.getElementById()`, `.querySelectorAll()` over `.getElementsByClassName()` and `.getElementsByTagName()`. *(partly fixable)*
159160
- [prefer-reflect-apply](docs/rules/prefer-reflect-apply.md) - Prefer `Reflect.apply()` over `Function#apply()`. *(fixable)*
160-
- [prefer-replace-all](docs/rules/prefer-replace-all.md) - Prefer `String#replaceAll()` over regex searches with the global flag. *(fixable)*
161161
- [prefer-set-has](docs/rules/prefer-set-has.md) - Prefer `Set#has()` over `Array#includes()` when checking for existence or non-existence. *(fixable)*
162162
- [prefer-spread](docs/rules/prefer-spread.md) - Prefer the spread operator over `Array.from()`. *(fixable)*
163-
- [prefer-starts-ends-with](docs/rules/prefer-starts-ends-with.md) - Prefer `String#startsWith()` & `String#endsWith()` over more complex alternatives. *(partly fixable)*
163+
- [prefer-string-replace-all](docs/rules/prefer-string-replace-all.md) - Prefer `String#replaceAll()` over regex searches with the global flag. *(fixable)*
164164
- [prefer-string-slice](docs/rules/prefer-string-slice.md) - Prefer `String#slice()` over `String#substr()` and `String#substring()`. *(partly fixable)*
165+
- [prefer-string-starts-ends-with](docs/rules/prefer-string-starts-ends-with.md) - Prefer `String#startsWith()` & `String#endsWith()` over more complex alternatives. *(partly fixable)*
166+
- [prefer-string-trim-start-end](docs/rules/prefer-string-trim-start-end.md) - Prefer `String#trimStart()` / `String#trimEnd()` over `String#trimLeft()` / `String#trimRight()`. *(fixable)*
165167
- [prefer-ternary](docs/rules/prefer-ternary.md) - Prefer ternary expressions over simple `if-else` statements. *(fixable)*
166-
- [prefer-text-content](docs/rules/prefer-text-content.md) - Prefer `.textContent` over `.innerText`. *(fixable)*
167-
- [prefer-trim-start-end](docs/rules/prefer-trim-start-end.md) - Prefer `String#trimStart()` / `String#trimEnd()` over `String#trimLeft()` / `String#trimRight()`. *(fixable)*
168168
- [prefer-type-error](docs/rules/prefer-type-error.md) - Enforce throwing `TypeError` in type checking conditions. *(fixable)*
169169
- [prevent-abbreviations](docs/rules/prevent-abbreviations.md) - Prevent abbreviations. *(partly fixable)*
170170
- [string-content](docs/rules/string-content.md) - Enforce better string content. *(fixable)*
File renamed without changes.
File renamed without changes.

rules/no-array-instanceof.js rules/no-instanceof-array.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
'use strict';
22
const getDocumentationUrl = require('./utils/get-documentation-url');
33

4-
const MESSAGE_ID = 'no-array-instanceof';
4+
const MESSAGE_ID = 'no-instanceof-array';
55
const messages = {
66
[MESSAGE_ID]: 'Use `Array.isArray()` instead of `instanceof Array`.'
77
};
File renamed without changes.

rules/prefer-node-append.js rules/prefer-dom-node-append.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ const isValueNotUsable = require('./utils/is-value-not-usable');
44
const methodSelector = require('./utils/method-selector');
55
const {notDomNodeSelector} = require('./utils/not-dom-node');
66

7-
const MESSAGE_ID = 'prefer-node-append';
7+
const MESSAGE_ID = 'prefer-dom-node-append';
88
const messages = {
99
[MESSAGE_ID]: 'Prefer `Node#append()` over `Node#appendChild()`.'
1010
};

rules/prefer-dataset.js rules/prefer-dom-node-dataset.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ const isValidVariableName = require('./utils/is-valid-variable-name');
44
const quoteString = require('./utils/quote-string');
55
const methodSelector = require('./utils/method-selector');
66

7-
const MESSAGE_ID = 'prefer-dataset';
7+
const MESSAGE_ID = 'prefer-dom-node-dataset';
88
const messages = {
99
[MESSAGE_ID]: 'Prefer `.dataset` over `setAttribute(…)`.'
1010
};
File renamed without changes.

rules/prefer-text-content.js rules/prefer-dom-node-text-content.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
'use strict';
22
const getDocumentationUrl = require('./utils/get-documentation-url');
33

4-
const MESSAGE_ID = 'prefer-text-content';
4+
const MESSAGE_ID = 'prefer-dom-node-text-content';
55
const messages = {
66
[MESSAGE_ID]: 'Prefer `.textContent` over `.innerText`.'
77
};

rules/prefer-event-key.js rules/prefer-keyboard-event-key.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
const getDocumentationUrl = require('./utils/get-documentation-url');
33
const quoteString = require('./utils/quote-string');
44

5-
const MESSAGE_ID = 'prefer-event-key';
5+
const MESSAGE_ID = 'prefer-keyboard-event-key';
66
const messages = {
77
[MESSAGE_ID]: 'Use `.key` instead of `.{{name}}`.'
88
};

rules/prefer-replace-all.js rules/prefer-string-replace-all.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ const getDocumentationUrl = require('./utils/get-documentation-url');
33
const quoteString = require('./utils/quote-string');
44
const methodSelector = require('./utils/method-selector');
55

6-
const MESSAGE_ID = 'prefer-replace-all';
6+
const MESSAGE_ID = 'prefer-string-replace-all';
77
const messages = {
88
[MESSAGE_ID]: 'Prefer `String#replaceAll()` over `String#replace()`.'
99
};
File renamed without changes.
File renamed without changes.

test/no-fn-reference-in-iterator.js test/no-array-callback-reference.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,9 @@ const invalidTestCase = (({code, method, name, suggestions}) => ({
5050
suggestions: suggestions.map(output => suggestionOutput(output))
5151
}
5252
]
53-
5453
}));
5554

56-
ruleTester.run('no-fn-reference-in-iterator', rule, {
55+
ruleTester.run('no-array-callback-reference', rule, {
5756
valid: [
5857
...simpleMethods.map(method => `foo.${method}(element => fn(element))`),
5958
...reduceLikeMethods.map(method => `foo.${method}((accumulator, element) => fn(element))`),

0 commit comments

Comments
 (0)