diff --git a/rules/no-array-method-this-argument.js b/rules/no-array-method-this-argument.js index 58afc6d0da..31f70fe04d 100644 --- a/rules/no-array-method-this-argument.js +++ b/rules/no-array-method-this-argument.js @@ -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.', }; diff --git a/test/snapshots/no-array-method-this-argument.mjs.md b/test/snapshots/no-array-method-this-argument.mjs.md index 9d9e3c3993..9691c03253 100644 --- a/test/snapshots/no-array-method-this-argument.mjs.md +++ b/test/snapshots/no-array-method-this-argument.mjs.md @@ -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(() => {})␊ ` @@ -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, () => {})␊ ` @@ -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)␊ ␊ --------------------------------------------------------------------------------␊ @@ -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)␊ ␊ --------------------------------------------------------------------------------␊ @@ -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)␊ ␊ --------------------------------------------------------------------------------␊ @@ -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)␊ ␊ --------------------------------------------------------------------------------␊ @@ -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 () {})␊ ␊ --------------------------------------------------------------------------------␊ @@ -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 () {})␊ ␊ --------------------------------------------------------------------------------␊ @@ -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 () {})␊ ␊ --------------------------------------------------------------------------------␊ @@ -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 () {})␊ ␊ --------------------------------------------------------------------------------␊ @@ -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,)␊ ␊ --------------------------------------------------------------------------------␊ @@ -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,)␊ ␊ --------------------------------------------------------------------------------␊ @@ -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 )),)␊ ␊ --------------------------------------------------------------------------------␊ @@ -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 )),)␊ ␊ --------------------------------------------------------------------------------␊ @@ -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 )),)␊ ␊ --------------------------------------------------------------------------------␊ @@ -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 )),)␊ ␊ --------------------------------------------------------------------------------␊ @@ -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, () => {}))␊ ␊ --------------------------------------------------------------------------------␊ @@ -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, () => {}))␊ ␊ --------------------------------------------------------------------------------␊ @@ -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))␊ ␊ --------------------------------------------------------------------------------␊ @@ -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))␊ ␊ --------------------------------------------------------------------------------␊ diff --git a/test/snapshots/no-array-method-this-argument.mjs.snap b/test/snapshots/no-array-method-this-argument.mjs.snap index cace872995..fbad733253 100644 Binary files a/test/snapshots/no-array-method-this-argument.mjs.snap and b/test/snapshots/no-array-method-this-argument.mjs.snap differ