Skip to content

Commit

Permalink
no-array-method-this-argument: Fix suggestion message (#2263)
Browse files Browse the repository at this point in the history
  • Loading branch information
fisker authored Jan 19, 2024
1 parent 797caee commit 331b306
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 21 deletions.
2 changes: 1 addition & 1 deletion rules/no-array-method-this-argument.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const SUGGESTION_REMOVE = 'suggestion-remove';
const messages = {
[ERROR_PROTOTYPE_METHOD]: 'Do not use the `this` argument in `Array#{{method}}()`.',
[ERROR_STATIC_METHOD]: 'Do not use the `this` argument in `Array.{{method}}()`.',
[SUGGESTION_REMOVE]: 'Remove the second argument.',
[SUGGESTION_REMOVE]: 'Remove this argument.',
[SUGGESTION_BIND]: 'Use a bound function.',
};

Expand Down
40 changes: 20 additions & 20 deletions test/snapshots/no-array-method-this-argument.mjs.md
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ Generated by [AVA](https://avajs.dev).
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ Do not use the \`this\` argument in \`Array#map()\`.␊
--------------------------------------------------------------------------------␊
Suggestion 1/1: Remove the second argument.␊
Suggestion 1/1: Remove this argument.␊
1 | array.map(() => {})␊
`

Expand All @@ -311,7 +311,7 @@ Generated by [AVA](https://avajs.dev).
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ Do not use the \`this\` argument in \`Array.from()\`.␊
--------------------------------------------------------------------------------␊
Suggestion 1/1: Remove the second argument.␊
Suggestion 1/1: Remove this argument.␊
1 | Array.from(iterableOrArrayLike, () => {})␊
`

Expand All @@ -330,7 +330,7 @@ Generated by [AVA](https://avajs.dev).
| ^^^^^^^^^^^^ Do not use the \`this\` argument in \`Array#map()\`.␊
--------------------------------------------------------------------------------␊
Suggestion 1/2: Remove the second argument.␊
Suggestion 1/2: Remove this argument.␊
1 | array.map(callback)␊
--------------------------------------------------------------------------------␊
Expand All @@ -353,7 +353,7 @@ Generated by [AVA](https://avajs.dev).
| ^^^^^^^^^^^^ Do not use the \`this\` argument in \`Array.from()\`.␊
--------------------------------------------------------------------------------␊
Suggestion 1/2: Remove the second argument.␊
Suggestion 1/2: Remove this argument.␊
1 | Array.from(iterableOrArrayLike, callback)␊
--------------------------------------------------------------------------------␊
Expand All @@ -376,7 +376,7 @@ Generated by [AVA](https://avajs.dev).
| ^^^^^^^^^^^^^^^ Do not use the \`this\` argument in \`Array#map()\`.␊
--------------------------------------------------------------------------------␊
Suggestion 1/2: Remove the second argument.␊
Suggestion 1/2: Remove this argument.␊
1 | array.map(callback)␊
--------------------------------------------------------------------------------␊
Expand All @@ -399,7 +399,7 @@ Generated by [AVA](https://avajs.dev).
| ^^^^^^^^^^^^^^^ Do not use the \`this\` argument in \`Array.from()\`.␊
--------------------------------------------------------------------------------␊
Suggestion 1/2: Remove the second argument.␊
Suggestion 1/2: Remove this argument.␊
1 | Array.from(iterableOrArrayLike, callback)␊
--------------------------------------------------------------------------------␊
Expand All @@ -422,7 +422,7 @@ Generated by [AVA](https://avajs.dev).
| ^^^^^^^^^^^^ Do not use the \`this\` argument in \`Array#map()\`.␊
--------------------------------------------------------------------------------␊
Suggestion 1/2: Remove the second argument.␊
Suggestion 1/2: Remove this argument.␊
1 | array.map(function () {})␊
--------------------------------------------------------------------------------␊
Expand All @@ -445,7 +445,7 @@ Generated by [AVA](https://avajs.dev).
| ^^^^^^^^^^^^ Do not use the \`this\` argument in \`Array.from()\`.␊
--------------------------------------------------------------------------------␊
Suggestion 1/2: Remove the second argument.␊
Suggestion 1/2: Remove this argument.␊
1 | Array.from(iterableOrArrayLike, function () {})␊
--------------------------------------------------------------------------------␊
Expand All @@ -468,7 +468,7 @@ Generated by [AVA](https://avajs.dev).
| ^^^^^^^^^^^^ Do not use the \`this\` argument in \`Array#map()\`.␊
--------------------------------------------------------------------------------␊
Suggestion 1/2: Remove the second argument.␊
Suggestion 1/2: Remove this argument.␊
1 | array.map(function callback () {})␊
--------------------------------------------------------------------------------␊
Expand All @@ -491,7 +491,7 @@ Generated by [AVA](https://avajs.dev).
| ^^^^^^^^^^^^ Do not use the \`this\` argument in \`Array.from()\`.␊
--------------------------------------------------------------------------------␊
Suggestion 1/2: Remove the second argument.␊
Suggestion 1/2: Remove this argument.␊
1 | Array.from(iterableOrArrayLike, function callback () {})␊
--------------------------------------------------------------------------------␊
Expand All @@ -514,7 +514,7 @@ Generated by [AVA](https://avajs.dev).
| ^^^^^^^^^^^^ Do not use the \`this\` argument in \`Array#map()\`.␊
--------------------------------------------------------------------------------␊
Suggestion 1/2: Remove the second argument.␊
Suggestion 1/2: Remove this argument.␊
1 | array.map( foo as bar,)␊
--------------------------------------------------------------------------------␊
Expand All @@ -537,7 +537,7 @@ Generated by [AVA](https://avajs.dev).
| ^^^^^^^^^^^^ Do not use the \`this\` argument in \`Array.from()\`.␊
--------------------------------------------------------------------------------␊
Suggestion 1/2: Remove the second argument.␊
Suggestion 1/2: Remove this argument.␊
1 | Array.from(iterableOrArrayLike, foo as bar,)␊
--------------------------------------------------------------------------------␊
Expand All @@ -560,7 +560,7 @@ Generated by [AVA](https://avajs.dev).
| ^^^^^^^^^^^^ Do not use the \`this\` argument in \`Array#map()\`.␊
--------------------------------------------------------------------------------␊
Suggestion 1/2: Remove the second argument.␊
Suggestion 1/2: Remove this argument.␊
1 | array.map( (( foo as bar )),)␊
--------------------------------------------------------------------------------␊
Expand All @@ -583,7 +583,7 @@ Generated by [AVA](https://avajs.dev).
| ^^^^^^^^^^^^ Do not use the \`this\` argument in \`Array.from()\`.␊
--------------------------------------------------------------------------------␊
Suggestion 1/2: Remove the second argument.␊
Suggestion 1/2: Remove this argument.␊
1 | Array.from(iterableOrArrayLike, (( foo as bar )),)␊
--------------------------------------------------------------------------------␊
Expand All @@ -606,7 +606,7 @@ Generated by [AVA](https://avajs.dev).
| ^^^^^^^^^^^^ Do not use the \`this\` argument in \`Array#map()\`.␊
--------------------------------------------------------------------------------␊
Suggestion 1/2: Remove the second argument.␊
Suggestion 1/2: Remove this argument.␊
1 | array.map( (( 0, callback )),)␊
--------------------------------------------------------------------------------␊
Expand All @@ -629,7 +629,7 @@ Generated by [AVA](https://avajs.dev).
| ^^^^^^^^^^^^ Do not use the \`this\` argument in \`Array.from()\`.␊
--------------------------------------------------------------------------------␊
Suggestion 1/2: Remove the second argument.␊
Suggestion 1/2: Remove this argument.␊
1 | Array.from(iterableOrArrayLike, (( 0, callback )),)␊
--------------------------------------------------------------------------------␊
Expand All @@ -652,7 +652,7 @@ Generated by [AVA](https://avajs.dev).
| ^^^^^^^^^^^^ Do not use the \`this\` argument in \`Array#map()\`.␊
--------------------------------------------------------------------------------␊
Suggestion 1/2: Remove the second argument.␊
Suggestion 1/2: Remove this argument.␊
1 | array.map((0, () => {}))␊
--------------------------------------------------------------------------------␊
Expand All @@ -675,7 +675,7 @@ Generated by [AVA](https://avajs.dev).
| ^^^^^^^^^^^^ Do not use the \`this\` argument in \`Array.from()\`.␊
--------------------------------------------------------------------------------␊
Suggestion 1/2: Remove the second argument.␊
Suggestion 1/2: Remove this argument.␊
1 | Array.from(iterableOrArrayLike, (0, () => {}))␊
--------------------------------------------------------------------------------␊
Expand All @@ -698,7 +698,7 @@ Generated by [AVA](https://avajs.dev).
| ^^^^^^^^^^^^ Do not use the \`this\` argument in \`Array#map()\`.␊
--------------------------------------------------------------------------------␊
Suggestion 1/2: Remove the second argument.␊
Suggestion 1/2: Remove this argument.␊
1 | array.map(callback.bind(foo))␊
--------------------------------------------------------------------------------␊
Expand All @@ -721,7 +721,7 @@ Generated by [AVA](https://avajs.dev).
| ^^^^^^^^^^^^ Do not use the \`this\` argument in \`Array.from()\`.␊
--------------------------------------------------------------------------------␊
Suggestion 1/2: Remove the second argument.␊
Suggestion 1/2: Remove this argument.␊
1 | Array.from(iterableOrArrayLike, callback.bind(foo))␊
--------------------------------------------------------------------------------␊
Expand Down
Binary file modified test/snapshots/no-array-method-this-argument.mjs.snap
Binary file not shown.

0 comments on commit 331b306

Please sign in to comment.