Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

no-array-method-this-argument: Fix suggestion message #2263

Merged
merged 1 commit into from Jan 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion rules/no-array-method-this-argument.js
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
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.