From 1d32db4905912eb84e30efca1e7d42bef3c51b1c Mon Sep 17 00:00:00 2001 From: Tomas Zaicevas Date: Fri, 1 Apr 2022 11:06:36 +0200 Subject: [PATCH] `no-array-for-each`: Handle optional chaining (#1753) Co-authored-by: fisker Cheung --- docs/rules/no-array-for-each.md | 8 +- readme.md | 2 +- rules/no-array-for-each.js | 80 +- test/no-array-for-each.mjs | 767 +++--- test/snapshots/no-array-for-each.mjs.md | 2574 ++++++++++++++++++--- test/snapshots/no-array-for-each.mjs.snap | Bin 5271 -> 9952 bytes 6 files changed, 2762 insertions(+), 669 deletions(-) diff --git a/docs/rules/no-array-for-each.md b/docs/rules/no-array-for-each.md index 036d6f7e6f..967d3f318d 100644 --- a/docs/rules/no-array-for-each.md +++ b/docs/rules/no-array-for-each.md @@ -4,7 +4,7 @@ βœ… *This rule is part of the [recommended](https://github.com/sindresorhus/eslint-plugin-unicorn#recommended-config) config.* -πŸ”§ *This rule is [auto-fixable](https://eslint.org/docs/user-guide/command-line-interface#fixing-problems).* +πŸ”§πŸ’‘ *This rule is [auto-fixable](https://eslint.org/docs/user-guide/command-line-interface#fixing-problems) and provides [suggestions](https://eslint.org/docs/developer-guide/working-with-rules#providing-suggestions).* Benefits of [`for…of` statement](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for...of) over [`Array#forEach(…)`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach) can include: @@ -21,6 +21,12 @@ array.forEach(element => { }); ``` +```js +array?.forEach(element => { + bar(element); +}); +``` + ```js array.forEach((element, index) => { bar(element, index); diff --git a/readme.md b/readme.md index bb77e05536..2e6c45119b 100644 --- a/readme.md +++ b/readme.md @@ -69,7 +69,7 @@ Each rule has emojis denoting: | [new-for-builtins](docs/rules/new-for-builtins.md) | Enforce the use of `new` for all builtins, except `String`, `Number`, `Boolean`, `Symbol` and `BigInt`. | βœ… | πŸ”§ | | | [no-abusive-eslint-disable](docs/rules/no-abusive-eslint-disable.md) | Enforce specifying rules to disable in `eslint-disable` comments. | βœ… | | | | [no-array-callback-reference](docs/rules/no-array-callback-reference.md) | Prevent passing a function reference directly to iterator methods. | βœ… | | πŸ’‘ | -| [no-array-for-each](docs/rules/no-array-for-each.md) | Prefer `for…of` over `Array#forEach(…)`. | βœ… | πŸ”§ | | +| [no-array-for-each](docs/rules/no-array-for-each.md) | Prefer `for…of` over `Array#forEach(…)`. | βœ… | πŸ”§ | πŸ’‘ | | [no-array-method-this-argument](docs/rules/no-array-method-this-argument.md) | Disallow using the `this` argument in array methods. | βœ… | πŸ”§ | πŸ’‘ | | [no-array-push-push](docs/rules/no-array-push-push.md) | Enforce combining multiple `Array#push()` into one call. | βœ… | πŸ”§ | πŸ’‘ | | [no-array-reduce](docs/rules/no-array-reduce.md) | Disallow `Array#reduce()` and `Array#reduceRight()`. | βœ… | | | diff --git a/rules/no-array-for-each.js b/rules/no-array-for-each.js index 74e6cb8e02..a1f74fc9fc 100644 --- a/rules/no-array-for-each.js +++ b/rules/no-array-for-each.js @@ -6,20 +6,24 @@ const { isSemicolonToken, isClosingParenToken, findVariable, + hasSideEffect, } = require('eslint-utils'); const {methodCallSelector, referenceIdentifierSelector} = require('./selectors/index.js'); const {extendFixRange} = require('./fix/index.js'); const needsSemicolon = require('./utils/needs-semicolon.js'); const shouldAddParenthesesToExpressionStatementExpression = require('./utils/should-add-parentheses-to-expression-statement-expression.js'); +const shouldAddParenthesesToMemberExpressionObject = require('./utils/should-add-parentheses-to-member-expression-object.js'); const {getParentheses} = require('./utils/parentheses.js'); const isFunctionSelfUsedInside = require('./utils/is-function-self-used-inside.js'); const {isNodeMatches} = require('./utils/is-node-matches.js'); const assertToken = require('./utils/assert-token.js'); const {fixSpaceAroundKeyword} = require('./fix/index.js'); -const MESSAGE_ID = 'no-array-for-each'; +const MESSAGE_ID_ERROR = 'no-array-for-each/error'; +const MESSAGE_ID_SUGGESTION = 'no-array-for-each/suggestion'; const messages = { - [MESSAGE_ID]: 'Use `for…of` instead of `Array#forEach(…)`.', + [MESSAGE_ID_ERROR]: 'Use `for…of` instead of `Array#forEach(…)`.', + [MESSAGE_ID_SUGGESTION]: 'Switch to `for…of`.', }; const arrayForEachCallSelector = methodCallSelector({ @@ -36,6 +40,11 @@ const continueAbleNodeTypes = new Set([ 'ForInStatement', ]); +const stripChainExpression = node => + (node.parent.type === 'ChainExpression' && node.parent.expression === node) + ? node.parent + : node; + function isReturnStatementInContinueAbleNodes(returnStatement, callbackFunction) { for (let node = returnStatement; node && node !== callbackFunction; node = node.parent) { if (continueAbleNodeTypes.has(node.type)) { @@ -73,6 +82,9 @@ function getFixFunction(callExpression, functionInfo, context) { const parameters = callback.params; const array = callExpression.callee.object; const {returnStatements} = functionInfo.get(callback); + const isOptionalArray = callExpression.callee.optional; + const expressionStatement = stripChainExpression(callExpression).parent; + const arrayText = sourceCode.getText(array); const getForOfLoopHeadText = () => { const [elementText, indexText] = parameters.map(parameter => sourceCode.getText(parameter)); @@ -84,12 +96,16 @@ function getFixFunction(callExpression, functionInfo, context) { text += useEntries ? `[${indexText}, ${elementText}]` : elementText; text += ' of '; - let arrayText = sourceCode.getText(array); - if (isParenthesized(array, sourceCode)) { - arrayText = `(${arrayText})`; - } + const shouldAddParenthesesToArray + = isParenthesized(array, sourceCode) + || ( + // `1?.forEach()` -> `(1).entries()` + isOptionalArray + && useEntries + && shouldAddParenthesesToMemberExpressionObject(array, sourceCode) + ); - text += arrayText; + text += shouldAddParenthesesToArray ? `(${arrayText})` : arrayText; if (useEntries) { text += '.entries()'; @@ -228,7 +244,7 @@ function getFixFunction(callExpression, functionInfo, context) { yield * replaceReturnStatement(returnStatement, fixer); } - const expressionStatementLastToken = sourceCode.getLastToken(callExpression.parent); + const expressionStatementLastToken = sourceCode.getLastToken(expressionStatement); // Remove semicolon if it's not needed anymore // foo.forEach(bar => {}); // ^ @@ -238,6 +254,10 @@ function getFixFunction(callExpression, functionInfo, context) { yield * fixSpaceAroundKeyword(fixer, callExpression.parent, sourceCode); + if (isOptionalArray) { + yield fixer.insertTextBefore(callExpression, `if (${arrayText}) `); + } + // Prevent possible variable conflicts yield * extendFixRange(fixer, callExpression.parent.range); }; @@ -302,19 +322,12 @@ function isFunctionParameterVariableReassigned(callbackFunction, context) { }); } -const isExpressionStatement = node => { - if (node.type === 'ChainExpression') { - node = node.parent; - } - - return node.type === 'ExpressionStatement'; -}; - function isFixable(callExpression, {scope, functionInfo, allIdentifiers, context}) { const sourceCode = context.getSourceCode(); // Check `CallExpression` if ( callExpression.optional + // TODO: Parenthesized should also be fixable. || isParenthesized(callExpression, sourceCode) || callExpression.arguments.length !== 1 ) { @@ -322,12 +335,7 @@ function isFixable(callExpression, {scope, functionInfo, allIdentifiers, context } // Check ancestors, we only fix `ExpressionStatement` - if (!isExpressionStatement(callExpression.parent)) { - return false; - } - - // Check `CallExpression.callee` - if (callExpression.callee.optional) { + if (stripChainExpression(callExpression).parent.type !== 'ExpressionStatement') { return false; } @@ -379,6 +387,7 @@ const create = context => { const callExpressions = []; const allIdentifiers = []; const functionInfo = new Map(); + const sourceCode = context.getSourceCode(); return { ':function'(node) { @@ -411,13 +420,31 @@ const create = context => { }, * 'Program:exit'() { for (const {node, scope} of callExpressions) { + // TODO: Rename this to iteratable + const array = node.callee; + const problem = { - node: node.callee.property, - messageId: MESSAGE_ID, + node: array.property, + messageId: MESSAGE_ID_ERROR, }; - if (isFixable(node, {scope, allIdentifiers, functionInfo, context})) { - problem.fix = getFixFunction(node, functionInfo, context); + if (!isFixable(node, {scope, allIdentifiers, functionInfo, context})) { + yield problem; + continue; + } + + const shouldUseSuggestion = array.optional && hasSideEffect(array, sourceCode); + const fix = getFixFunction(node, functionInfo, context); + + if (shouldUseSuggestion) { + problem.suggest = [ + { + messageId: MESSAGE_ID_SUGGESTION, + fix, + }, + ]; + } else { + problem.fix = fix; } yield problem; @@ -435,6 +462,7 @@ module.exports = { description: 'Prefer `for…of` over `Array#forEach(…)`.', }, fixable: 'code', + hasSuggestions: true, messages, }, }; diff --git a/test/no-array-for-each.mjs b/test/no-array-for-each.mjs index e3df34b062..7a35962bf6 100644 --- a/test/no-array-for-each.mjs +++ b/test/no-array-for-each.mjs @@ -19,404 +19,415 @@ test.snapshot({ `, ], invalid: [ - // Not fixable 'foo.forEach?.(element => bar(element))', - '(foo.forEach(element => bar(element)))', - 'foo.forEach(element => bar(element), thisArgument)', - 'foo.forEach()', - 'const baz = foo.forEach(element => bar(element))', - 'foo?.forEach(element => bar(element))', - 'foo.forEach(bar)', - 'foo.forEach(async function(element) {})', - 'foo.forEach(function * (element) {})', - 'foo.forEach(() => bar())', - 'foo.forEach((element, index, array) => bar())', - 'property.forEach(({property}) => bar(property))', + ...[ + // Not fixable + '(foo.forEach(element => bar(element)))', + 'foo.forEach(element => bar(element), thisArgument)', + 'foo.forEach()', + 'const baz = foo.forEach(element => bar(element))', + 'foo.forEach(bar)', + 'foo.forEach(async function(element) {})', + 'foo.forEach(function * (element) {})', + 'foo.forEach(() => bar())', + 'foo.forEach((element, index, array) => bar())', + 'property.forEach(({property}) => bar(property))', + '() => foo.forEach()', - // Can't turn `return` to `continue` - outdent` - foo.forEach(element => { - do { - return - } while (element) - }); - `, - outdent` - foo.forEach(element => { - while (element) { - return; - } - }); - `, - outdent` - foo.forEach(element => { - for (let i = 0; i < 2; i++) { - return; - } - }); - `, - outdent` - foo.forEach(element => { - for (let i in element) { - return; - } - }); - `, - outdent` - foo.forEach(element => { - for (let i of element) { - return; - } - }); - `, - // `ReturnStatement` in `switch` is fixable - outdent` - foo.forEach(element => { - switch (element) { - case 1: - break; - case 2: + // Can't turn `return` to `continue` + outdent` + foo.forEach(element => { + do { + return + } while (element) + }); + `, + outdent` + foo.forEach(element => { + while (element) { return; - } - }); - `, + } + }); + `, + outdent` + foo.forEach(element => { + for (let i = 0; i < 2; i++) { + return; + } + }); + `, + outdent` + foo.forEach(element => { + for (let i in element) { + return; + } + }); + `, + outdent` + foo.forEach(element => { + for (let i of element) { + return; + } + }); + `, + // `ReturnStatement` in `switch` is fixable + outdent` + foo.forEach(element => { + switch (element) { + case 1: + break; + case 2: + return; + } + }); + `, - // `parameters` - 'foo.forEach(foo => bar());', - outdent` - const foo = []; - foo.forEach(foo => bar()); - `, - outdent` - const foo = []; - function unicorn() { + // `parameters` + 'foo.forEach(foo => bar());', + outdent` + const foo = []; foo.forEach(foo => bar()); - } - `, - 'index.forEach((a, index) => bar());', - outdent` - const index = []; - index.forEach((a, index) => bar()); - `, - outdent` - const index = []; - function unicorn() { + `, + outdent` + const foo = []; + function unicorn() { + foo.forEach(foo => bar()); + } + `, + 'index.forEach((a, index) => bar());', + outdent` + const index = []; index.forEach((a, index) => bar()); - } - `, - 'a[foo].forEach(foo => bar());', - outdent` - const foo = 1; - a[foo].forEach(foo => bar()); - `, - outdent` - const foo = 1; - function unicorn() { + `, + outdent` + const index = []; + function unicorn() { + index.forEach((a, index) => bar()); + } + `, + 'a[foo].forEach(foo => bar());', + outdent` + const foo = 1; a[foo].forEach(foo => bar()); - } - `, - 'a[index].forEach((b, index) => bar());', - 'a((foo) => foo).forEach(foo => bar());', - 'a((foo, index) => foo + index).forEach((foo, index) => bar());', - outdent` - const foo = []; - const index = 1; - a.forEach((foo, index) => foo[index]); - `, - - // `FunctionExpression.id` - outdent` - foo.forEach(function a(element) { - bar(a) - }) - `, - outdent` - foo.forEach(function a(element) { - function b() { - bar(a) + `, + outdent` + const foo = 1; + function unicorn() { + a[foo].forEach(foo => bar()); } - }) - `, - outdent` - foo.forEach(function a(element) { - function b(a) { + `, + 'a[index].forEach((b, index) => bar());', + 'a((foo) => foo).forEach(foo => bar());', + 'a((foo, index) => foo + index).forEach((foo, index) => bar());', + outdent` + const foo = []; + const index = 1; + a.forEach((foo, index) => foo[index]); + `, + + // `FunctionExpression.id` + outdent` + foo.forEach(function a(element) { bar(a) - } - }) - `, + }) + `, + outdent` + foo.forEach(function a(element) { + function b() { + bar(a) + } + }) + `, + outdent` + foo.forEach(function a(element) { + function b(a) { + bar(a) + } + }) + `, - // This - outdent` - foo.forEach(function(element) { - bar(this) - }) - `, - outdent` - foo.forEach(function(element) { - function b() { + // This + outdent` + foo.forEach(function(element) { bar(this) - } - }) - `, - outdent` - foo.forEach(function(element) { - const x = b => { + }) + `, + outdent` + foo.forEach(function(element) { + function b() { + bar(this) + } + }) + `, + outdent` + foo.forEach(function(element) { + const x = b => { + bar(this) + } + }) + `, + outdent` + foo.forEach((element) => { bar(this) - } - }) - `, - outdent` - foo.forEach((element) => { - bar(this) - }) - `, + }) + `, - // `arguments` - outdent` - foo.forEach(function(element) { - bar(arguments) - }) - `, - outdent` - foo.forEach(function(element) { - function b() { + // `arguments` + outdent` + foo.forEach(function(element) { bar(arguments) - } - }) - `, - outdent` - foo.forEach(function(element) { - const b = () => { + }) + `, + outdent` + foo.forEach(function(element) { + function b() { + bar(arguments) + } + }) + `, + outdent` + foo.forEach(function(element) { + const b = () => { + bar(arguments) + } + }) + `, + outdent` + foo.forEach((element) => { bar(arguments) - } - }) - `, - outdent` - foo.forEach((element) => { - bar(arguments) - }) - `, - 'a = foo?.bar.forEach((element) => bar(element));', + }) + `, + 'a = foo?.bar.forEach((element) => bar(element));', - // Auto-fix - outdent` - foo.forEach(function (element) { - bar(element); - }); - `, - outdent` - foo.forEach(function withName(element) { - bar(element); - }); - `, - outdent` - foo.forEach((element) => { - bar(element); - }); - `, - 'foo.forEach((element) => bar(element));', - outdent` - foo.forEach(function (element, index) { - bar(element, index); - }); - `, - outdent` - foo.forEach(function withName(element, index) { - bar(element, index); - }); - `, - outdent` - foo.forEach((element, index) => { - bar(element, index); - }); - `, - 'foo.forEach((element, index) => bar(element, index));', - 'foo?.bar.forEach((element) => bar(element));', - // Array is parenthesized - '(foo).forEach((element, index) => bar(element, index))', - '(0, foo).forEach((element, index) => bar(element, index))', - // Trailing comma - outdent` - foo.forEach(function (element) { - bar(element); - },); - `, - outdent` - foo.forEach(function withName(element) { - bar(element); - },); - `, - outdent` - foo.forEach((element) => { - bar(element); - },); - `, - 'foo.forEach((element) => bar(element),);', - // Last semi token - outdent` - foo.forEach((element) => bar(element)) - ;[foo].pop(); - `, - outdent` - foo.forEach((element) => { - bar(element); - }); - function noneRelatedFunction() { - while (element) { - return; - } - } - `, - // A test to make sure function head part range correctly calculated - 'foo.forEach(element => ({}))', - // `callback` is parenthesized - 'foo.forEach((((((element => bar(element)))))));', - outdent` - foo.forEach((element) => { - if (1) { - return; - } - if (1) { - return - } - if (1) { - return!true; - } - if (1) { - return!true - } - if (1) { - return bar(); - } - if (1) { - return bar() - unreachable(); - } - if (1) { - return {}; - } - if (1) { - return ({}); - } - if (1) { - return {a} = a; - } - if (1) { - return [a] = a; - } - if (1) { - foo - return [] - } - if (1) { - foo - return [foo] = bar; - } - }); - `, - 'node.children.index.forEach((children, index) => process(children, index))', - '(node?.children?.index).forEach((children, index) => process(children, index))', - 'node[children].index.forEach((children, index) => process(children, index))', - '(node.children?.[index]).forEach((children, index) => process(children, index))', - '[{children: 1, index: 1}].forEach((children, index) => process(children, index))', - '[{[children]: 1, index: 1}].forEach((children, index) => process(children, index))', - '[{[children]: 1, [index]: 1}].forEach((children, index) => process(children, index))', - '[{children, index: 1}].forEach((children, index) => process(children, index))', - '[{children: 1, index}].forEach((children, index) => process(children, index))', - '[function name() {}].forEach((name, index) => process(name, index))', - outdent` - [ - function () { - function index() {} - } - ].forEach((name, index) => process(name, index)) - `, - outdent` - [ - function () { - class index {} - } - ].forEach((name, index) => process(name, index)) - `, - '[class Foo{}].forEach((Foo, index) => process(Foo, index))', - '[class Foo{}].forEach((X, Foo) => process(X, Foo))', - outdent` - [ - class Foo { - bar() {} + // Auto-fix + outdent` + foo.forEach(function (element) { + bar(element); + }); + `, + outdent` + foo.forEach(function withName(element) { + bar(element); + }); + `, + outdent` + foo.forEach((element) => { + bar(element); + }); + `, + 'foo.forEach((element) => bar(element));', + outdent` + foo.forEach(function (element, index) { + bar(element, index); + }); + `, + outdent` + foo.forEach(function withName(element, index) { + bar(element, index); + }); + `, + outdent` + foo.forEach((element, index) => { + bar(element, index); + }); + `, + 'foo.forEach((element, index) => bar(element, index));', + 'foo?.bar.forEach((element) => bar(element));', + 'foo.bar.forEach((element) => log(element))', + 'foo.bar().forEach((element) => log(element))', + '(a ? b : c).forEach((element) => log(element))', + '(a ? b : c()).forEach((element) => log(element))', + '(foo || bar).forEach((element) => log(element))', + '(foo || bar()).forEach((element) => log(element))', + // Array is parenthesized + '(foo).forEach((element, index) => bar(element, index))', + '(0, foo).forEach((element, index) => bar(element, index))', + // Trailing comma + outdent` + foo.forEach(function (element) { + bar(element); + },); + `, + outdent` + foo.forEach(function withName(element) { + bar(element); + },); + `, + outdent` + foo.forEach((element) => { + bar(element); + },); + `, + 'foo.forEach((element) => bar(element),);', + // Last semi token + outdent` + foo.forEach((element) => bar(element)) + ;[foo].pop(); + `, + outdent` + foo.forEach((element) => { + bar(element); + }); + function noneRelatedFunction() { + while (element) { + return; + } } - ].forEach((Foo, bar) => process(Foo, bar)) - `, - 'foo.React.Children.forEach(bar)', - 'NotReact.Children.forEach(bar)', - 'React.NotChildren.forEach(bar)', - 'React?.Children.forEach(bar)', - 'NotChildren.forEach(bar)', - // Parameters are reassigned - outdent` - foo.forEach(element => { - element ++; - }) - `, - outdent` - foo.forEach(element => { - const a = -- element; - }) - `, - outdent` - foo.forEach((element, index) => { - index ++; - element = 2 - }); - `, - outdent` - foo.forEach((element, index) => { - element >>>= 2; - }); - `, - outdent` - foo.forEach((element, index) => { - const a = element = 1; - }); - `, - outdent` - foo.forEach((element, index) => { - let a; - a >>>= element; - }); - `, + `, + // A test to make sure function head part range correctly calculated + 'foo.forEach(element => ({}))', + // `callback` is parenthesized + 'foo.forEach((((((element => bar(element)))))));', + outdent` + foo.forEach((element) => { + if (1) { + return; + } + if (1) { + return + } + if (1) { + return!true; + } + if (1) { + return!true + } + if (1) { + return bar(); + } + if (1) { + return bar() + unreachable(); + } + if (1) { + return {}; + } + if (1) { + return ({}); + } + if (1) { + return {a} = a; + } + if (1) { + return [a] = a; + } + if (1) { + foo + return [] + } + if (1) { + foo + return [foo] = bar; + } + }); + `, + 'node.children.index.forEach((children, index) => process(children, index))', + '(node?.children?.index).forEach((children, index) => process(children, index))', + 'node[children].index.forEach((children, index) => process(children, index))', + '(node.children?.[index]).forEach((children, index) => process(children, index))', + '[{children: 1, index: 1}].forEach((children, index) => process(children, index))', + '[{[children]: 1, index: 1}].forEach((children, index) => process(children, index))', + '[{[children]: 1, [index]: 1}].forEach((children, index) => process(children, index))', + '[{children, index: 1}].forEach((children, index) => process(children, index))', + '[{children: 1, index}].forEach((children, index) => process(children, index))', + '[function name() {}].forEach((name, index) => process(name, index))', + outdent` + [ + function () { + function index() {} + } + ].forEach((name, index) => process(name, index)) + `, + outdent` + [ + function () { + class index {} + } + ].forEach((name, index) => process(name, index)) + `, + '[class Foo{}].forEach((Foo, index) => process(Foo, index))', + '[class Foo{}].forEach((X, Foo) => process(X, Foo))', + outdent` + [ + class Foo { + bar() {} + } + ].forEach((Foo, bar) => process(Foo, bar)) + `, + 'foo.React.Children.forEach(bar)', + 'NotReact.Children.forEach(bar)', + 'React.NotChildren.forEach(bar)', + 'React?.Children.forEach(bar)', + 'NotChildren.forEach(bar)', + // Parameters are reassigned + outdent` + foo.forEach(element => { + element ++; + }) + `, + outdent` + foo.forEach(element => { + const a = -- element; + }) + `, + outdent` + foo.forEach((element, index) => { + index ++; + element = 2 + }); + `, + outdent` + foo.forEach((element, index) => { + element >>>= 2; + }); + `, + outdent` + foo.forEach((element, index) => { + const a = element = 1; + }); + `, + outdent` + foo.forEach((element, index) => { + let a; + a >>>= element; + }); + `, - // Complicated parameters - 'foo.forEach(({property}) => {bar(property)})', - 'foo.forEach(({foo: {foo: [property]}}) => {bar(property, index)})', - 'foo.forEach((element, {bar: {bar: [index]}}) => {bar(element, index)})', - 'foo.forEach((element = elementDefaultValue, index = indexDefaultValue) => {})', - 'foo.forEach(({}) => {})', - 'foo.forEach(function foo({a, b, c, d}) {})', - 'foo.forEach(function foo({a, b, c, d, foo}) {})', - 'foo.forEach(({foo: property}) => {bar(property)})', - 'foo.forEach(({[foo]: property}) => {bar(property)})', - outdent` - foo.forEach(({element}, index) => { - element &&= 2; - }); - `, + // Complicated parameters + 'foo.forEach(({property}) => {bar(property)})', + 'foo.forEach(({foo: {foo: [property]}}) => {bar(property, index)})', + 'foo.forEach((element, {bar: {bar: [index]}}) => {bar(element, index)})', + 'foo.forEach((element = elementDefaultValue, index = indexDefaultValue) => {})', + 'foo.forEach(({}) => {})', + 'foo.forEach(function foo({a, b, c, d}) {})', + 'foo.forEach(function foo({a, b, c, d, foo}) {})', + 'foo.forEach(({foo: property}) => {bar(property)})', + 'foo.forEach(({[foo]: property}) => {bar(property)})', + outdent` + foo.forEach(({element}, index) => { + element &&= 2; + }); + `, - // Need switch to `BlockStatement`, #1318 - outdent` - foo.forEach(_ => { - if (true) return {}; - }) - `, - outdent` - foo.forEach(_ => { - if (true); - else return {}; - }) - `, + // Need switch to `BlockStatement`, #1318 + outdent` + foo.forEach(_ => { + if (true) return {}; + }) + `, + outdent` + foo.forEach(_ => { + if (true); + else return {}; + }) + `, + + // Need insert space after keyword + 'if (true) {} else[foo].forEach((element) => {})', + ].flatMap(code => [code, code.replace('.forEach', '?.forEach')]), - // Need insert space after keyword - 'if (true) {} else[foo].forEach((element) => {})', + // Should not fix to invalid code + '1?.forEach((a, b) => call(a, b))', ], }); diff --git a/test/snapshots/no-array-for-each.mjs.md b/test/snapshots/no-array-for-each.mjs.md index e1c0d5eff6..667ab195a2 100644 --- a/test/snapshots/no-array-for-each.mjs.md +++ b/test/snapshots/no-array-for-each.mjs.md @@ -25,6 +25,16 @@ Generated by [AVA](https://avajs.dev). ` ## Invalid #3 + 1 | (foo?.forEach(element => bar(element))) + +> Error 1/1 + + `␊ + > 1 | (foo?.forEach(element => bar(element)))␊ + | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ + ` + +## Invalid #4 1 | foo.forEach(element => bar(element), thisArgument) > Error 1/1 @@ -34,7 +44,17 @@ Generated by [AVA](https://avajs.dev). | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ ` -## Invalid #4 +## Invalid #5 + 1 | foo?.forEach(element => bar(element), thisArgument) + +> Error 1/1 + + `␊ + > 1 | foo?.forEach(element => bar(element), thisArgument)␊ + | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ + ` + +## Invalid #6 1 | foo.forEach() > Error 1/1 @@ -44,7 +64,17 @@ Generated by [AVA](https://avajs.dev). | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ ` -## Invalid #5 +## Invalid #7 + 1 | foo?.forEach() + +> Error 1/1 + + `␊ + > 1 | foo?.forEach()␊ + | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ + ` + +## Invalid #8 1 | const baz = foo.forEach(element => bar(element)) > Error 1/1 @@ -54,17 +84,17 @@ Generated by [AVA](https://avajs.dev). | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ ` -## Invalid #6 - 1 | foo?.forEach(element => bar(element)) +## Invalid #9 + 1 | const baz = foo?.forEach(element => bar(element)) > Error 1/1 `␊ - > 1 | foo?.forEach(element => bar(element))␊ - | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ + > 1 | const baz = foo?.forEach(element => bar(element))␊ + | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ ` -## Invalid #7 +## Invalid #10 1 | foo.forEach(bar) > Error 1/1 @@ -74,7 +104,17 @@ Generated by [AVA](https://avajs.dev). | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ ` -## Invalid #8 +## Invalid #11 + 1 | foo?.forEach(bar) + +> Error 1/1 + + `␊ + > 1 | foo?.forEach(bar)␊ + | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ + ` + +## Invalid #12 1 | foo.forEach(async function(element) {}) > Error 1/1 @@ -84,7 +124,17 @@ Generated by [AVA](https://avajs.dev). | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ ` -## Invalid #9 +## Invalid #13 + 1 | foo?.forEach(async function(element) {}) + +> Error 1/1 + + `␊ + > 1 | foo?.forEach(async function(element) {})␊ + | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ + ` + +## Invalid #14 1 | foo.forEach(function * (element) {}) > Error 1/1 @@ -94,7 +144,17 @@ Generated by [AVA](https://avajs.dev). | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ ` -## Invalid #10 +## Invalid #15 + 1 | foo?.forEach(function * (element) {}) + +> Error 1/1 + + `␊ + > 1 | foo?.forEach(function * (element) {})␊ + | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ + ` + +## Invalid #16 1 | foo.forEach(() => bar()) > Error 1/1 @@ -104,7 +164,17 @@ Generated by [AVA](https://avajs.dev). | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ ` -## Invalid #11 +## Invalid #17 + 1 | foo?.forEach(() => bar()) + +> Error 1/1 + + `␊ + > 1 | foo?.forEach(() => bar())␊ + | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ + ` + +## Invalid #18 1 | foo.forEach((element, index, array) => bar()) > Error 1/1 @@ -114,7 +184,17 @@ Generated by [AVA](https://avajs.dev). | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ ` -## Invalid #12 +## Invalid #19 + 1 | foo?.forEach((element, index, array) => bar()) + +> Error 1/1 + + `␊ + > 1 | foo?.forEach((element, index, array) => bar())␊ + | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ + ` + +## Invalid #20 1 | property.forEach(({property}) => bar(property)) > Error 1/1 @@ -124,7 +204,37 @@ Generated by [AVA](https://avajs.dev). | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ ` -## Invalid #13 +## Invalid #21 + 1 | property?.forEach(({property}) => bar(property)) + +> Error 1/1 + + `␊ + > 1 | property?.forEach(({property}) => bar(property))␊ + | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ + ` + +## Invalid #22 + 1 | () => foo.forEach() + +> Error 1/1 + + `␊ + > 1 | () => foo.forEach()␊ + | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ + ` + +## Invalid #23 + 1 | () => foo?.forEach() + +> Error 1/1 + + `␊ + > 1 | () => foo?.forEach()␊ + | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ + ` + +## Invalid #24 1 | foo.forEach(element => { 2 | do { 3 | return @@ -142,7 +252,25 @@ Generated by [AVA](https://avajs.dev). 5 | });␊ ` -## Invalid #14 +## Invalid #25 + 1 | foo?.forEach(element => { + 2 | do { + 3 | return + 4 | } while (element) + 5 | }); + +> Error 1/1 + + `␊ + > 1 | foo?.forEach(element => {␊ + | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ + 2 | do {␊ + 3 | return␊ + 4 | } while (element)␊ + 5 | });␊ + ` + +## Invalid #26 1 | foo.forEach(element => { 2 | while (element) { 3 | return; @@ -160,7 +288,25 @@ Generated by [AVA](https://avajs.dev). 5 | });␊ ` -## Invalid #15 +## Invalid #27 + 1 | foo?.forEach(element => { + 2 | while (element) { + 3 | return; + 4 | } + 5 | }); + +> Error 1/1 + + `␊ + > 1 | foo?.forEach(element => {␊ + | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ + 2 | while (element) {␊ + 3 | return;␊ + 4 | }␊ + 5 | });␊ + ` + +## Invalid #28 1 | foo.forEach(element => { 2 | for (let i = 0; i < 2; i++) { 3 | return; @@ -178,7 +324,25 @@ Generated by [AVA](https://avajs.dev). 5 | });␊ ` -## Invalid #16 +## Invalid #29 + 1 | foo?.forEach(element => { + 2 | for (let i = 0; i < 2; i++) { + 3 | return; + 4 | } + 5 | }); + +> Error 1/1 + + `␊ + > 1 | foo?.forEach(element => {␊ + | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ + 2 | for (let i = 0; i < 2; i++) {␊ + 3 | return;␊ + 4 | }␊ + 5 | });␊ + ` + +## Invalid #30 1 | foo.forEach(element => { 2 | for (let i in element) { 3 | return; @@ -196,7 +360,25 @@ Generated by [AVA](https://avajs.dev). 5 | });␊ ` -## Invalid #17 +## Invalid #31 + 1 | foo?.forEach(element => { + 2 | for (let i in element) { + 3 | return; + 4 | } + 5 | }); + +> Error 1/1 + + `␊ + > 1 | foo?.forEach(element => {␊ + | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ + 2 | for (let i in element) {␊ + 3 | return;␊ + 4 | }␊ + 5 | });␊ + ` + +## Invalid #32 1 | foo.forEach(element => { 2 | for (let i of element) { 3 | return; @@ -214,7 +396,25 @@ Generated by [AVA](https://avajs.dev). 5 | });␊ ` -## Invalid #18 +## Invalid #33 + 1 | foo?.forEach(element => { + 2 | for (let i of element) { + 3 | return; + 4 | } + 5 | }); + +> Error 1/1 + + `␊ + > 1 | foo?.forEach(element => {␊ + | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ + 2 | for (let i of element) {␊ + 3 | return;␊ + 4 | }␊ + 5 | });␊ + ` + +## Invalid #34 1 | foo.forEach(element => { 2 | switch (element) { 3 | case 1: @@ -251,7 +451,44 @@ Generated by [AVA](https://avajs.dev). 8 | });␊ ` -## Invalid #19 +## Invalid #35 + 1 | foo?.forEach(element => { + 2 | switch (element) { + 3 | case 1: + 4 | break; + 5 | case 2: + 6 | return; + 7 | } + 8 | }); + +> Output + + `␊ + 1 | if (foo) for (const element of foo) {␊ + 2 | switch (element) {␊ + 3 | case 1:␊ + 4 | break;␊ + 5 | case 2:␊ + 6 | continue;␊ + 7 | }␊ + 8 | }␊ + ` + +> Error 1/1 + + `␊ + > 1 | foo?.forEach(element => {␊ + | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ + 2 | switch (element) {␊ + 3 | case 1:␊ + 4 | break;␊ + 5 | case 2:␊ + 6 | return;␊ + 7 | }␊ + 8 | });␊ + ` + +## Invalid #36 1 | foo.forEach(foo => bar()); > Error 1/1 @@ -261,7 +498,17 @@ Generated by [AVA](https://avajs.dev). | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ ` -## Invalid #20 +## Invalid #37 + 1 | foo?.forEach(foo => bar()); + +> Error 1/1 + + `␊ + > 1 | foo?.forEach(foo => bar());␊ + | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ + ` + +## Invalid #38 1 | const foo = []; 2 | foo.forEach(foo => bar()); @@ -273,7 +520,19 @@ Generated by [AVA](https://avajs.dev). | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ ` -## Invalid #21 +## Invalid #39 + 1 | const foo = []; + 2 | foo?.forEach(foo => bar()); + +> Error 1/1 + + `␊ + 1 | const foo = [];␊ + > 2 | foo?.forEach(foo => bar());␊ + | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ + ` + +## Invalid #40 1 | const foo = []; 2 | function unicorn() { 3 | foo.forEach(foo => bar()); @@ -289,8 +548,24 @@ Generated by [AVA](https://avajs.dev). 4 | }␊ ` -## Invalid #22 - 1 | index.forEach((a, index) => bar()); +## Invalid #41 + 1 | const foo = []; + 2 | function unicorn() { + 3 | foo?.forEach(foo => bar()); + 4 | } + +> Error 1/1 + + `␊ + 1 | const foo = [];␊ + 2 | function unicorn() {␊ + > 3 | foo?.forEach(foo => bar());␊ + | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ + 4 | }␊ + ` + +## Invalid #42 + 1 | index.forEach((a, index) => bar()); > Error 1/1 @@ -299,7 +574,17 @@ Generated by [AVA](https://avajs.dev). | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ ` -## Invalid #23 +## Invalid #43 + 1 | index?.forEach((a, index) => bar()); + +> Error 1/1 + + `␊ + > 1 | index?.forEach((a, index) => bar());␊ + | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ + ` + +## Invalid #44 1 | const index = []; 2 | index.forEach((a, index) => bar()); @@ -311,7 +596,19 @@ Generated by [AVA](https://avajs.dev). | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ ` -## Invalid #24 +## Invalid #45 + 1 | const index = []; + 2 | index?.forEach((a, index) => bar()); + +> Error 1/1 + + `␊ + 1 | const index = [];␊ + > 2 | index?.forEach((a, index) => bar());␊ + | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ + ` + +## Invalid #46 1 | const index = []; 2 | function unicorn() { 3 | index.forEach((a, index) => bar()); @@ -327,7 +624,23 @@ Generated by [AVA](https://avajs.dev). 4 | }␊ ` -## Invalid #25 +## Invalid #47 + 1 | const index = []; + 2 | function unicorn() { + 3 | index?.forEach((a, index) => bar()); + 4 | } + +> Error 1/1 + + `␊ + 1 | const index = [];␊ + 2 | function unicorn() {␊ + > 3 | index?.forEach((a, index) => bar());␊ + | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ + 4 | }␊ + ` + +## Invalid #48 1 | a[foo].forEach(foo => bar()); > Error 1/1 @@ -337,7 +650,17 @@ Generated by [AVA](https://avajs.dev). | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ ` -## Invalid #26 +## Invalid #49 + 1 | a[foo]?.forEach(foo => bar()); + +> Error 1/1 + + `␊ + > 1 | a[foo]?.forEach(foo => bar());␊ + | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ + ` + +## Invalid #50 1 | const foo = 1; 2 | a[foo].forEach(foo => bar()); @@ -349,7 +672,19 @@ Generated by [AVA](https://avajs.dev). | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ ` -## Invalid #27 +## Invalid #51 + 1 | const foo = 1; + 2 | a[foo]?.forEach(foo => bar()); + +> Error 1/1 + + `␊ + 1 | const foo = 1;␊ + > 2 | a[foo]?.forEach(foo => bar());␊ + | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ + ` + +## Invalid #52 1 | const foo = 1; 2 | function unicorn() { 3 | a[foo].forEach(foo => bar()); @@ -365,7 +700,23 @@ Generated by [AVA](https://avajs.dev). 4 | }␊ ` -## Invalid #28 +## Invalid #53 + 1 | const foo = 1; + 2 | function unicorn() { + 3 | a[foo]?.forEach(foo => bar()); + 4 | } + +> Error 1/1 + + `␊ + 1 | const foo = 1;␊ + 2 | function unicorn() {␊ + > 3 | a[foo]?.forEach(foo => bar());␊ + | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ + 4 | }␊ + ` + +## Invalid #54 1 | a[index].forEach((b, index) => bar()); > Error 1/1 @@ -375,7 +726,17 @@ Generated by [AVA](https://avajs.dev). | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ ` -## Invalid #29 +## Invalid #55 + 1 | a[index]?.forEach((b, index) => bar()); + +> Error 1/1 + + `␊ + > 1 | a[index]?.forEach((b, index) => bar());␊ + | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ + ` + +## Invalid #56 1 | a((foo) => foo).forEach(foo => bar()); > Output @@ -391,7 +752,21 @@ Generated by [AVA](https://avajs.dev). | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ ` -## Invalid #30 +## Invalid #57 + 1 | a((foo) => foo)?.forEach(foo => bar()); + +> Error 1/1 + + `␊ + > 1 | a((foo) => foo)?.forEach(foo => bar());␊ + | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ + ␊ + --------------------------------------------------------------------------------␊ + Suggestion 1/1: Switch to \`for…of\`.␊ + 1 | if (a((foo) => foo)) for (const foo of a((foo) => foo)) bar();␊ + ` + +## Invalid #58 1 | a((foo, index) => foo + index).forEach((foo, index) => bar()); > Output @@ -407,7 +782,21 @@ Generated by [AVA](https://avajs.dev). | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ ` -## Invalid #31 +## Invalid #59 + 1 | a((foo, index) => foo + index)?.forEach((foo, index) => bar()); + +> Error 1/1 + + `␊ + > 1 | a((foo, index) => foo + index)?.forEach((foo, index) => bar());␊ + | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ + ␊ + --------------------------------------------------------------------------------␊ + Suggestion 1/1: Switch to \`for…of\`.␊ + 1 | if (a((foo, index) => foo + index)) for (const [index, foo] of a((foo, index) => foo + index).entries()) bar();␊ + ` + +## Invalid #60 1 | const foo = []; 2 | const index = 1; 3 | a.forEach((foo, index) => foo[index]); @@ -429,7 +818,29 @@ Generated by [AVA](https://avajs.dev). | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ ` -## Invalid #32 +## Invalid #61 + 1 | const foo = []; + 2 | const index = 1; + 3 | a?.forEach((foo, index) => foo[index]); + +> Output + + `␊ + 1 | const foo = [];␊ + 2 | const index = 1;␊ + 3 | if (a) for (const [index, foo] of a.entries()) foo[index];␊ + ` + +> Error 1/1 + + `␊ + 1 | const foo = [];␊ + 2 | const index = 1;␊ + > 3 | a?.forEach((foo, index) => foo[index]);␊ + | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ + ` + +## Invalid #62 1 | foo.forEach(function a(element) { 2 | bar(a) 3 | }) @@ -443,7 +854,21 @@ Generated by [AVA](https://avajs.dev). 3 | })␊ ` -## Invalid #33 +## Invalid #63 + 1 | foo?.forEach(function a(element) { + 2 | bar(a) + 3 | }) + +> Error 1/1 + + `␊ + > 1 | foo?.forEach(function a(element) {␊ + | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ + 2 | bar(a)␊ + 3 | })␊ + ` + +## Invalid #64 1 | foo.forEach(function a(element) { 2 | function b() { 3 | bar(a) @@ -461,7 +886,25 @@ Generated by [AVA](https://avajs.dev). 5 | })␊ ` -## Invalid #34 +## Invalid #65 + 1 | foo?.forEach(function a(element) { + 2 | function b() { + 3 | bar(a) + 4 | } + 5 | }) + +> Error 1/1 + + `␊ + > 1 | foo?.forEach(function a(element) {␊ + | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ + 2 | function b() {␊ + 3 | bar(a)␊ + 4 | }␊ + 5 | })␊ + ` + +## Invalid #66 1 | foo.forEach(function a(element) { 2 | function b(a) { 3 | bar(a) @@ -489,7 +932,35 @@ Generated by [AVA](https://avajs.dev). 5 | })␊ ` -## Invalid #35 +## Invalid #67 + 1 | foo?.forEach(function a(element) { + 2 | function b(a) { + 3 | bar(a) + 4 | } + 5 | }) + +> Output + + `␊ + 1 | if (foo) for (const element of foo) {␊ + 2 | function b(a) {␊ + 3 | bar(a)␊ + 4 | }␊ + 5 | }␊ + ` + +> Error 1/1 + + `␊ + > 1 | foo?.forEach(function a(element) {␊ + | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ + 2 | function b(a) {␊ + 3 | bar(a)␊ + 4 | }␊ + 5 | })␊ + ` + +## Invalid #68 1 | foo.forEach(function(element) { 2 | bar(this) 3 | }) @@ -503,7 +974,21 @@ Generated by [AVA](https://avajs.dev). 3 | })␊ ` -## Invalid #36 +## Invalid #69 + 1 | foo?.forEach(function(element) { + 2 | bar(this) + 3 | }) + +> Error 1/1 + + `␊ + > 1 | foo?.forEach(function(element) {␊ + | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ + 2 | bar(this)␊ + 3 | })␊ + ` + +## Invalid #70 1 | foo.forEach(function(element) { 2 | function b() { 3 | bar(this) @@ -531,9 +1016,9 @@ Generated by [AVA](https://avajs.dev). 5 | })␊ ` -## Invalid #37 - 1 | foo.forEach(function(element) { - 2 | const x = b => { +## Invalid #71 + 1 | foo?.forEach(function(element) { + 2 | function b() { 3 | bar(this) 4 | } 5 | }) @@ -541,8 +1026,8 @@ Generated by [AVA](https://avajs.dev). > Output `␊ - 1 | for (const element of foo) {␊ - 2 | const x = b => {␊ + 1 | if (foo) for (const element of foo) {␊ + 2 | function b() {␊ 3 | bar(this)␊ 4 | }␊ 5 | }␊ @@ -551,42 +1036,120 @@ Generated by [AVA](https://avajs.dev). > Error 1/1 `␊ - > 1 | foo.forEach(function(element) {␊ - | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ - 2 | const x = b => {␊ + > 1 | foo?.forEach(function(element) {␊ + | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ + 2 | function b() {␊ 3 | bar(this)␊ 4 | }␊ 5 | })␊ ` -## Invalid #38 - 1 | foo.forEach((element) => { - 2 | bar(this) - 3 | }) +## Invalid #72 + 1 | foo.forEach(function(element) { + 2 | const x = b => { + 3 | bar(this) + 4 | } + 5 | }) > Output `␊ 1 | for (const element of foo) {␊ - 2 | bar(this)␊ - 3 | }␊ + 2 | const x = b => {␊ + 3 | bar(this)␊ + 4 | }␊ + 5 | }␊ ` > Error 1/1 `␊ - > 1 | foo.forEach((element) => {␊ + > 1 | foo.forEach(function(element) {␊ | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ - 2 | bar(this)␊ - 3 | })␊ + 2 | const x = b => {␊ + 3 | bar(this)␊ + 4 | }␊ + 5 | })␊ ` -## Invalid #39 - 1 | foo.forEach(function(element) { - 2 | bar(arguments) - 3 | }) +## Invalid #73 + 1 | foo?.forEach(function(element) { + 2 | const x = b => { + 3 | bar(this) + 4 | } + 5 | }) -> Error 1/1 +> Output + + `␊ + 1 | if (foo) for (const element of foo) {␊ + 2 | const x = b => {␊ + 3 | bar(this)␊ + 4 | }␊ + 5 | }␊ + ` + +> Error 1/1 + + `␊ + > 1 | foo?.forEach(function(element) {␊ + | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ + 2 | const x = b => {␊ + 3 | bar(this)␊ + 4 | }␊ + 5 | })␊ + ` + +## Invalid #74 + 1 | foo.forEach((element) => { + 2 | bar(this) + 3 | }) + +> Output + + `␊ + 1 | for (const element of foo) {␊ + 2 | bar(this)␊ + 3 | }␊ + ` + +> Error 1/1 + + `␊ + > 1 | foo.forEach((element) => {␊ + | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ + 2 | bar(this)␊ + 3 | })␊ + ` + +## Invalid #75 + 1 | foo?.forEach((element) => { + 2 | bar(this) + 3 | }) + +> Output + + `␊ + 1 | if (foo) for (const element of foo) {␊ + 2 | bar(this)␊ + 3 | }␊ + ` + +> Error 1/1 + + `␊ + > 1 | foo?.forEach((element) => {␊ + | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ + 2 | bar(this)␊ + 3 | })␊ + ` + +## Invalid #76 + 1 | foo.forEach(function(element) { + 2 | bar(arguments) + 3 | }) + +> Error 1/1 `␊ > 1 | foo.forEach(function(element) {␊ @@ -595,7 +1158,21 @@ Generated by [AVA](https://avajs.dev). 3 | })␊ ` -## Invalid #40 +## Invalid #77 + 1 | foo?.forEach(function(element) { + 2 | bar(arguments) + 3 | }) + +> Error 1/1 + + `␊ + > 1 | foo?.forEach(function(element) {␊ + | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ + 2 | bar(arguments)␊ + 3 | })␊ + ` + +## Invalid #78 1 | foo.forEach(function(element) { 2 | function b() { 3 | bar(arguments) @@ -615,295 +1192,803 @@ Generated by [AVA](https://avajs.dev). > Error 1/1 `␊ - > 1 | foo.forEach(function(element) {␊ - | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ - 2 | function b() {␊ - 3 | bar(arguments)␊ - 4 | }␊ - 5 | })␊ + > 1 | foo.forEach(function(element) {␊ + | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ + 2 | function b() {␊ + 3 | bar(arguments)␊ + 4 | }␊ + 5 | })␊ + ` + +## Invalid #79 + 1 | foo?.forEach(function(element) { + 2 | function b() { + 3 | bar(arguments) + 4 | } + 5 | }) + +> Output + + `␊ + 1 | if (foo) for (const element of foo) {␊ + 2 | function b() {␊ + 3 | bar(arguments)␊ + 4 | }␊ + 5 | }␊ + ` + +> Error 1/1 + + `␊ + > 1 | foo?.forEach(function(element) {␊ + | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ + 2 | function b() {␊ + 3 | bar(arguments)␊ + 4 | }␊ + 5 | })␊ + ` + +## Invalid #80 + 1 | foo.forEach(function(element) { + 2 | const b = () => { + 3 | bar(arguments) + 4 | } + 5 | }) + +> Output + + `␊ + 1 | for (const element of foo) {␊ + 2 | const b = () => {␊ + 3 | bar(arguments)␊ + 4 | }␊ + 5 | }␊ + ` + +> Error 1/1 + + `␊ + > 1 | foo.forEach(function(element) {␊ + | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ + 2 | const b = () => {␊ + 3 | bar(arguments)␊ + 4 | }␊ + 5 | })␊ + ` + +## Invalid #81 + 1 | foo?.forEach(function(element) { + 2 | const b = () => { + 3 | bar(arguments) + 4 | } + 5 | }) + +> Output + + `␊ + 1 | if (foo) for (const element of foo) {␊ + 2 | const b = () => {␊ + 3 | bar(arguments)␊ + 4 | }␊ + 5 | }␊ + ` + +> Error 1/1 + + `␊ + > 1 | foo?.forEach(function(element) {␊ + | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ + 2 | const b = () => {␊ + 3 | bar(arguments)␊ + 4 | }␊ + 5 | })␊ + ` + +## Invalid #82 + 1 | foo.forEach((element) => { + 2 | bar(arguments) + 3 | }) + +> Output + + `␊ + 1 | for (const element of foo) {␊ + 2 | bar(arguments)␊ + 3 | }␊ + ` + +> Error 1/1 + + `␊ + > 1 | foo.forEach((element) => {␊ + | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ + 2 | bar(arguments)␊ + 3 | })␊ + ` + +## Invalid #83 + 1 | foo?.forEach((element) => { + 2 | bar(arguments) + 3 | }) + +> Output + + `␊ + 1 | if (foo) for (const element of foo) {␊ + 2 | bar(arguments)␊ + 3 | }␊ + ` + +> Error 1/1 + + `␊ + > 1 | foo?.forEach((element) => {␊ + | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ + 2 | bar(arguments)␊ + 3 | })␊ + ` + +## Invalid #84 + 1 | a = foo?.bar.forEach((element) => bar(element)); + +> Error 1/1 + + `␊ + > 1 | a = foo?.bar.forEach((element) => bar(element));␊ + | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ + ` + +## Invalid #85 + 1 | a = foo?.bar?.forEach((element) => bar(element)); + +> Error 1/1 + + `␊ + > 1 | a = foo?.bar?.forEach((element) => bar(element));␊ + | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ + ` + +## Invalid #86 + 1 | foo.forEach(function (element) { + 2 | bar(element); + 3 | }); + +> Output + + `␊ + 1 | for (const element of foo) {␊ + 2 | bar(element);␊ + 3 | }␊ + ` + +> Error 1/1 + + `␊ + > 1 | foo.forEach(function (element) {␊ + | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ + 2 | bar(element);␊ + 3 | });␊ + ` + +## Invalid #87 + 1 | foo?.forEach(function (element) { + 2 | bar(element); + 3 | }); + +> Output + + `␊ + 1 | if (foo) for (const element of foo) {␊ + 2 | bar(element);␊ + 3 | }␊ + ` + +> Error 1/1 + + `␊ + > 1 | foo?.forEach(function (element) {␊ + | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ + 2 | bar(element);␊ + 3 | });␊ + ` + +## Invalid #88 + 1 | foo.forEach(function withName(element) { + 2 | bar(element); + 3 | }); + +> Output + + `␊ + 1 | for (const element of foo) {␊ + 2 | bar(element);␊ + 3 | }␊ + ` + +> Error 1/1 + + `␊ + > 1 | foo.forEach(function withName(element) {␊ + | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ + 2 | bar(element);␊ + 3 | });␊ + ` + +## Invalid #89 + 1 | foo?.forEach(function withName(element) { + 2 | bar(element); + 3 | }); + +> Output + + `␊ + 1 | if (foo) for (const element of foo) {␊ + 2 | bar(element);␊ + 3 | }␊ + ` + +> Error 1/1 + + `␊ + > 1 | foo?.forEach(function withName(element) {␊ + | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ + 2 | bar(element);␊ + 3 | });␊ + ` + +## Invalid #90 + 1 | foo.forEach((element) => { + 2 | bar(element); + 3 | }); + +> Output + + `␊ + 1 | for (const element of foo) {␊ + 2 | bar(element);␊ + 3 | }␊ + ` + +> Error 1/1 + + `␊ + > 1 | foo.forEach((element) => {␊ + | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ + 2 | bar(element);␊ + 3 | });␊ + ` + +## Invalid #91 + 1 | foo?.forEach((element) => { + 2 | bar(element); + 3 | }); + +> Output + + `␊ + 1 | if (foo) for (const element of foo) {␊ + 2 | bar(element);␊ + 3 | }␊ + ` + +> Error 1/1 + + `␊ + > 1 | foo?.forEach((element) => {␊ + | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ + 2 | bar(element);␊ + 3 | });␊ + ` + +## Invalid #92 + 1 | foo.forEach((element) => bar(element)); + +> Output + + `␊ + 1 | for (const element of foo) bar(element);␊ + ` + +> Error 1/1 + + `␊ + > 1 | foo.forEach((element) => bar(element));␊ + | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ + ` + +## Invalid #93 + 1 | foo?.forEach((element) => bar(element)); + +> Output + + `␊ + 1 | if (foo) for (const element of foo) bar(element);␊ + ` + +> Error 1/1 + + `␊ + > 1 | foo?.forEach((element) => bar(element));␊ + | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ + ` + +## Invalid #94 + 1 | foo.forEach(function (element, index) { + 2 | bar(element, index); + 3 | }); + +> Output + + `␊ + 1 | for (const [index, element] of foo.entries()) {␊ + 2 | bar(element, index);␊ + 3 | }␊ + ` + +> Error 1/1 + + `␊ + > 1 | foo.forEach(function (element, index) {␊ + | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ + 2 | bar(element, index);␊ + 3 | });␊ + ` + +## Invalid #95 + 1 | foo?.forEach(function (element, index) { + 2 | bar(element, index); + 3 | }); + +> Output + + `␊ + 1 | if (foo) for (const [index, element] of foo.entries()) {␊ + 2 | bar(element, index);␊ + 3 | }␊ + ` + +> Error 1/1 + + `␊ + > 1 | foo?.forEach(function (element, index) {␊ + | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ + 2 | bar(element, index);␊ + 3 | });␊ + ` + +## Invalid #96 + 1 | foo.forEach(function withName(element, index) { + 2 | bar(element, index); + 3 | }); + +> Output + + `␊ + 1 | for (const [index, element] of foo.entries()) {␊ + 2 | bar(element, index);␊ + 3 | }␊ + ` + +> Error 1/1 + + `␊ + > 1 | foo.forEach(function withName(element, index) {␊ + | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ + 2 | bar(element, index);␊ + 3 | });␊ + ` + +## Invalid #97 + 1 | foo?.forEach(function withName(element, index) { + 2 | bar(element, index); + 3 | }); + +> Output + + `␊ + 1 | if (foo) for (const [index, element] of foo.entries()) {␊ + 2 | bar(element, index);␊ + 3 | }␊ + ` + +> Error 1/1 + + `␊ + > 1 | foo?.forEach(function withName(element, index) {␊ + | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ + 2 | bar(element, index);␊ + 3 | });␊ + ` + +## Invalid #98 + 1 | foo.forEach((element, index) => { + 2 | bar(element, index); + 3 | }); + +> Output + + `␊ + 1 | for (const [index, element] of foo.entries()) {␊ + 2 | bar(element, index);␊ + 3 | }␊ + ` + +> Error 1/1 + + `␊ + > 1 | foo.forEach((element, index) => {␊ + | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ + 2 | bar(element, index);␊ + 3 | });␊ + ` + +## Invalid #99 + 1 | foo?.forEach((element, index) => { + 2 | bar(element, index); + 3 | }); + +> Output + + `␊ + 1 | if (foo) for (const [index, element] of foo.entries()) {␊ + 2 | bar(element, index);␊ + 3 | }␊ + ` + +> Error 1/1 + + `␊ + > 1 | foo?.forEach((element, index) => {␊ + | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ + 2 | bar(element, index);␊ + 3 | });␊ + ` + +## Invalid #100 + 1 | foo.forEach((element, index) => bar(element, index)); + +> Output + + `␊ + 1 | for (const [index, element] of foo.entries()) bar(element, index);␊ + ` + +> Error 1/1 + + `␊ + > 1 | foo.forEach((element, index) => bar(element, index));␊ + | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ + ` + +## Invalid #101 + 1 | foo?.forEach((element, index) => bar(element, index)); + +> Output + + `␊ + 1 | if (foo) for (const [index, element] of foo.entries()) bar(element, index);␊ + ` + +> Error 1/1 + + `␊ + > 1 | foo?.forEach((element, index) => bar(element, index));␊ + | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ + ` + +## Invalid #102 + 1 | foo?.bar.forEach((element) => bar(element)); + +> Output + + `␊ + 1 | for (const element of foo?.bar) bar(element);␊ + ` + +> Error 1/1 + + `␊ + > 1 | foo?.bar.forEach((element) => bar(element));␊ + | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ + ` + +## Invalid #103 + 1 | foo?.bar?.forEach((element) => bar(element)); + +> Output + + `␊ + 1 | if (foo?.bar) for (const element of foo?.bar) bar(element);␊ + ` + +> Error 1/1 + + `␊ + > 1 | foo?.bar?.forEach((element) => bar(element));␊ + | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ + ` + +## Invalid #104 + 1 | foo.bar.forEach((element) => log(element)) + +> Output + + `␊ + 1 | for (const element of foo.bar) log(element)␊ + ` + +> Error 1/1 + + `␊ + > 1 | foo.bar.forEach((element) => log(element))␊ + | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ ` -## Invalid #41 - 1 | foo.forEach(function(element) { - 2 | const b = () => { - 3 | bar(arguments) - 4 | } - 5 | }) +## Invalid #105 + 1 | foo.bar?.forEach((element) => log(element)) > Output `␊ - 1 | for (const element of foo) {␊ - 2 | const b = () => {␊ - 3 | bar(arguments)␊ - 4 | }␊ - 5 | }␊ + 1 | if (foo.bar) for (const element of foo.bar) log(element)␊ ` > Error 1/1 `␊ - > 1 | foo.forEach(function(element) {␊ - | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ - 2 | const b = () => {␊ - 3 | bar(arguments)␊ - 4 | }␊ - 5 | })␊ + > 1 | foo.bar?.forEach((element) => log(element))␊ + | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ ` -## Invalid #42 - 1 | foo.forEach((element) => { - 2 | bar(arguments) - 3 | }) +## Invalid #106 + 1 | foo.bar().forEach((element) => log(element)) > Output `␊ - 1 | for (const element of foo) {␊ - 2 | bar(arguments)␊ - 3 | }␊ + 1 | for (const element of foo.bar()) log(element)␊ ` > Error 1/1 `␊ - > 1 | foo.forEach((element) => {␊ - | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ - 2 | bar(arguments)␊ - 3 | })␊ + > 1 | foo.bar().forEach((element) => log(element))␊ + | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ ` -## Invalid #43 - 1 | a = foo?.bar.forEach((element) => bar(element)); +## Invalid #107 + 1 | foo.bar()?.forEach((element) => log(element)) > Error 1/1 `␊ - > 1 | a = foo?.bar.forEach((element) => bar(element));␊ - | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ + > 1 | foo.bar()?.forEach((element) => log(element))␊ + | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ + ␊ + --------------------------------------------------------------------------------␊ + Suggestion 1/1: Switch to \`for…of\`.␊ + 1 | if (foo.bar()) for (const element of foo.bar()) log(element)␊ ` -## Invalid #44 - 1 | foo.forEach(function (element) { - 2 | bar(element); - 3 | }); +## Invalid #108 + 1 | (a ? b : c).forEach((element) => log(element)) > Output `␊ - 1 | for (const element of foo) {␊ - 2 | bar(element);␊ - 3 | }␊ + 1 | for (const element of (a ? b : c)) log(element)␊ ` > Error 1/1 `␊ - > 1 | foo.forEach(function (element) {␊ - | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ - 2 | bar(element);␊ - 3 | });␊ + > 1 | (a ? b : c).forEach((element) => log(element))␊ + | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ ` -## Invalid #45 - 1 | foo.forEach(function withName(element) { - 2 | bar(element); - 3 | }); +## Invalid #109 + 1 | (a ? b : c)?.forEach((element) => log(element)) > Output `␊ - 1 | for (const element of foo) {␊ - 2 | bar(element);␊ - 3 | }␊ + 1 | if (a ? b : c) for (const element of (a ? b : c)) log(element)␊ ` > Error 1/1 `␊ - > 1 | foo.forEach(function withName(element) {␊ - | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ - 2 | bar(element);␊ - 3 | });␊ + > 1 | (a ? b : c)?.forEach((element) => log(element))␊ + | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ ` -## Invalid #46 - 1 | foo.forEach((element) => { - 2 | bar(element); - 3 | }); +## Invalid #110 + 1 | (a ? b : c()).forEach((element) => log(element)) > Output `␊ - 1 | for (const element of foo) {␊ - 2 | bar(element);␊ - 3 | }␊ + 1 | for (const element of (a ? b : c())) log(element)␊ ` > Error 1/1 `␊ - > 1 | foo.forEach((element) => {␊ - | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ - 2 | bar(element);␊ - 3 | });␊ + > 1 | (a ? b : c()).forEach((element) => log(element))␊ + | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ ` -## Invalid #47 - 1 | foo.forEach((element) => bar(element)); +## Invalid #111 + 1 | (a ? b : c())?.forEach((element) => log(element)) + +> Error 1/1 + + `␊ + > 1 | (a ? b : c())?.forEach((element) => log(element))␊ + | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ + ␊ + --------------------------------------------------------------------------------␊ + Suggestion 1/1: Switch to \`for…of\`.␊ + 1 | if (a ? b : c()) for (const element of (a ? b : c())) log(element)␊ + ` + +## Invalid #112 + 1 | (foo || bar).forEach((element) => log(element)) > Output `␊ - 1 | for (const element of foo) bar(element);␊ + 1 | for (const element of (foo || bar)) log(element)␊ ` > Error 1/1 `␊ - > 1 | foo.forEach((element) => bar(element));␊ - | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ + > 1 | (foo || bar).forEach((element) => log(element))␊ + | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ ` -## Invalid #48 - 1 | foo.forEach(function (element, index) { - 2 | bar(element, index); - 3 | }); +## Invalid #113 + 1 | (foo || bar)?.forEach((element) => log(element)) > Output `␊ - 1 | for (const [index, element] of foo.entries()) {␊ - 2 | bar(element, index);␊ - 3 | }␊ + 1 | if (foo || bar) for (const element of (foo || bar)) log(element)␊ ` > Error 1/1 `␊ - > 1 | foo.forEach(function (element, index) {␊ - | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ - 2 | bar(element, index);␊ - 3 | });␊ + > 1 | (foo || bar)?.forEach((element) => log(element))␊ + | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ ` -## Invalid #49 - 1 | foo.forEach(function withName(element, index) { - 2 | bar(element, index); - 3 | }); +## Invalid #114 + 1 | (foo || bar()).forEach((element) => log(element)) > Output `␊ - 1 | for (const [index, element] of foo.entries()) {␊ - 2 | bar(element, index);␊ - 3 | }␊ + 1 | for (const element of (foo || bar())) log(element)␊ ` > Error 1/1 `␊ - > 1 | foo.forEach(function withName(element, index) {␊ - | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ - 2 | bar(element, index);␊ - 3 | });␊ + > 1 | (foo || bar()).forEach((element) => log(element))␊ + | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ ` -## Invalid #50 - 1 | foo.forEach((element, index) => { - 2 | bar(element, index); - 3 | }); +## Invalid #115 + 1 | (foo || bar())?.forEach((element) => log(element)) + +> Error 1/1 + + `␊ + > 1 | (foo || bar())?.forEach((element) => log(element))␊ + | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ + ␊ + --------------------------------------------------------------------------------␊ + Suggestion 1/1: Switch to \`for…of\`.␊ + 1 | if (foo || bar()) for (const element of (foo || bar())) log(element)␊ + ` + +## Invalid #116 + 1 | (foo).forEach((element, index) => bar(element, index)) > Output `␊ - 1 | for (const [index, element] of foo.entries()) {␊ - 2 | bar(element, index);␊ - 3 | }␊ + 1 | for (const [index, element] of (foo).entries()) bar(element, index)␊ ` > Error 1/1 `␊ - > 1 | foo.forEach((element, index) => {␊ - | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ - 2 | bar(element, index);␊ - 3 | });␊ + > 1 | (foo).forEach((element, index) => bar(element, index))␊ + | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ ` -## Invalid #51 - 1 | foo.forEach((element, index) => bar(element, index)); +## Invalid #117 + 1 | (foo)?.forEach((element, index) => bar(element, index)) > Output `␊ - 1 | for (const [index, element] of foo.entries()) bar(element, index);␊ + 1 | if (foo) for (const [index, element] of (foo).entries()) bar(element, index)␊ ` > Error 1/1 `␊ - > 1 | foo.forEach((element, index) => bar(element, index));␊ - | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ + > 1 | (foo)?.forEach((element, index) => bar(element, index))␊ + | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ ` -## Invalid #52 - 1 | foo?.bar.forEach((element) => bar(element)); +## Invalid #118 + 1 | (0, foo).forEach((element, index) => bar(element, index)) > Output `␊ - 1 | for (const element of foo?.bar) bar(element);␊ + 1 | for (const [index, element] of (0, foo).entries()) bar(element, index)␊ ` > Error 1/1 `␊ - > 1 | foo?.bar.forEach((element) => bar(element));␊ + > 1 | (0, foo).forEach((element, index) => bar(element, index))␊ | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ ` -## Invalid #53 - 1 | (foo).forEach((element, index) => bar(element, index)) +## Invalid #119 + 1 | (0, foo)?.forEach((element, index) => bar(element, index)) > Output `␊ - 1 | for (const [index, element] of (foo).entries()) bar(element, index)␊ + 1 | if (0, foo) for (const [index, element] of (0, foo).entries()) bar(element, index)␊ ` > Error 1/1 `␊ - > 1 | (foo).forEach((element, index) => bar(element, index))␊ - | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ + > 1 | (0, foo)?.forEach((element, index) => bar(element, index))␊ + | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ ` -## Invalid #54 - 1 | (0, foo).forEach((element, index) => bar(element, index)) +## Invalid #120 + 1 | foo.forEach(function (element) { + 2 | bar(element); + 3 | },); > Output `␊ - 1 | for (const [index, element] of (0, foo).entries()) bar(element, index)␊ + 1 | for (const element of foo) {␊ + 2 | bar(element);␊ + 3 | }␊ ` > Error 1/1 `␊ - > 1 | (0, foo).forEach((element, index) => bar(element, index))␊ - | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ + > 1 | foo.forEach(function (element) {␊ + | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ + 2 | bar(element);␊ + 3 | },);␊ ` -## Invalid #55 - 1 | foo.forEach(function (element) { +## Invalid #121 + 1 | foo?.forEach(function (element) { 2 | bar(element); 3 | },); > Output `␊ - 1 | for (const element of foo) {␊ + 1 | if (foo) for (const element of foo) {␊ 2 | bar(element);␊ 3 | }␊ ` @@ -911,13 +1996,13 @@ Generated by [AVA](https://avajs.dev). > Error 1/1 `␊ - > 1 | foo.forEach(function (element) {␊ - | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ + > 1 | foo?.forEach(function (element) {␊ + | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ 2 | bar(element);␊ 3 | },);␊ ` -## Invalid #56 +## Invalid #122 1 | foo.forEach(function withName(element) { 2 | bar(element); 3 | },); @@ -939,7 +2024,29 @@ Generated by [AVA](https://avajs.dev). 3 | },);␊ ` -## Invalid #57 +## Invalid #123 + 1 | foo?.forEach(function withName(element) { + 2 | bar(element); + 3 | },); + +> Output + + `␊ + 1 | if (foo) for (const element of foo) {␊ + 2 | bar(element);␊ + 3 | }␊ + ` + +> Error 1/1 + + `␊ + > 1 | foo?.forEach(function withName(element) {␊ + | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ + 2 | bar(element);␊ + 3 | },);␊ + ` + +## Invalid #124 1 | foo.forEach((element) => { 2 | bar(element); 3 | },); @@ -961,7 +2068,29 @@ Generated by [AVA](https://avajs.dev). 3 | },);␊ ` -## Invalid #58 +## Invalid #125 + 1 | foo?.forEach((element) => { + 2 | bar(element); + 3 | },); + +> Output + + `␊ + 1 | if (foo) for (const element of foo) {␊ + 2 | bar(element);␊ + 3 | }␊ + ` + +> Error 1/1 + + `␊ + > 1 | foo?.forEach((element) => {␊ + | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ + 2 | bar(element);␊ + 3 | },);␊ + ` + +## Invalid #126 1 | foo.forEach((element) => bar(element),); > Output @@ -977,27 +2106,99 @@ Generated by [AVA](https://avajs.dev). | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ ` -## Invalid #59 +## Invalid #127 + 1 | foo?.forEach((element) => bar(element),); + +> Output + + `␊ + 1 | if (foo) for (const element of foo) bar(element);␊ + ` + +> Error 1/1 + + `␊ + > 1 | foo?.forEach((element) => bar(element),);␊ + | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ + ` + +## Invalid #128 1 | foo.forEach((element) => bar(element)) 2 | ;[foo].pop(); > Output `␊ - 1 | for (const element of foo) bar(element)␊ - 2 | ;[foo].pop();␊ + 1 | for (const element of foo) bar(element)␊ + 2 | ;[foo].pop();␊ + ` + +> Error 1/1 + + `␊ + > 1 | foo.forEach((element) => bar(element))␊ + | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ + 2 | ;[foo].pop();␊ + ` + +## Invalid #129 + 1 | foo?.forEach((element) => bar(element)) + 2 | ;[foo].pop(); + +> Output + + `␊ + 1 | if (foo) for (const element of foo) bar(element)␊ + 2 | ;[foo].pop();␊ + ` + +> Error 1/1 + + `␊ + > 1 | foo?.forEach((element) => bar(element))␊ + | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ + 2 | ;[foo].pop();␊ + ` + +## Invalid #130 + 1 | foo.forEach((element) => { + 2 | bar(element); + 3 | }); + 4 | function noneRelatedFunction() { + 5 | while (element) { + 6 | return; + 7 | } + 8 | } + +> Output + + `␊ + 1 | for (const element of foo) {␊ + 2 | bar(element);␊ + 3 | }␊ + 4 | function noneRelatedFunction() {␊ + 5 | while (element) {␊ + 6 | return;␊ + 7 | }␊ + 8 | }␊ ` > Error 1/1 `␊ - > 1 | foo.forEach((element) => bar(element))␊ + > 1 | foo.forEach((element) => {␊ | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ - 2 | ;[foo].pop();␊ + 2 | bar(element);␊ + 3 | });␊ + 4 | function noneRelatedFunction() {␊ + 5 | while (element) {␊ + 6 | return;␊ + 7 | }␊ + 8 | }␊ ` -## Invalid #60 - 1 | foo.forEach((element) => { +## Invalid #131 + 1 | foo?.forEach((element) => { 2 | bar(element); 3 | }); 4 | function noneRelatedFunction() { @@ -1009,7 +2210,7 @@ Generated by [AVA](https://avajs.dev). > Output `␊ - 1 | for (const element of foo) {␊ + 1 | if (foo) for (const element of foo) {␊ 2 | bar(element);␊ 3 | }␊ 4 | function noneRelatedFunction() {␊ @@ -1022,8 +2223,8 @@ Generated by [AVA](https://avajs.dev). > Error 1/1 `␊ - > 1 | foo.forEach((element) => {␊ - | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ + > 1 | foo?.forEach((element) => {␊ + | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ 2 | bar(element);␊ 3 | });␊ 4 | function noneRelatedFunction() {␊ @@ -1033,7 +2234,7 @@ Generated by [AVA](https://avajs.dev). 8 | }␊ ` -## Invalid #61 +## Invalid #132 1 | foo.forEach(element => ({})) > Output @@ -1049,7 +2250,23 @@ Generated by [AVA](https://avajs.dev). | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ ` -## Invalid #62 +## Invalid #133 + 1 | foo?.forEach(element => ({})) + +> Output + + `␊ + 1 | if (foo) for (const element of foo) ({})␊ + ` + +> Error 1/1 + + `␊ + > 1 | foo?.forEach(element => ({}))␊ + | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ + ` + +## Invalid #134 1 | foo.forEach((((((element => bar(element))))))); > Output @@ -1065,7 +2282,23 @@ Generated by [AVA](https://avajs.dev). | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ ` -## Invalid #63 +## Invalid #135 + 1 | foo?.forEach((((((element => bar(element))))))); + +> Output + + `␊ + 1 | if (foo) for (const element of foo) bar(element);␊ + ` + +> Error 1/1 + + `␊ + > 1 | foo?.forEach((((((element => bar(element)))))));␊ + | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ + ` + +## Invalid #136 1 | foo.forEach((element) => { 2 | if (1) { 3 | return; @@ -1201,7 +2434,143 @@ Generated by [AVA](https://avajs.dev). 41 | });␊ ` -## Invalid #64 +## Invalid #137 + 1 | foo?.forEach((element) => { + 2 | if (1) { + 3 | return; + 4 | } + 5 | if (1) { + 6 | return + 7 | } + 8 | if (1) { + 9 | return!true; + 10 | } + 11 | if (1) { + 12 | return!true + 13 | } + 14 | if (1) { + 15 | return bar(); + 16 | } + 17 | if (1) { + 18 | return bar() + 19 | unreachable(); + 20 | } + 21 | if (1) { + 22 | return {}; + 23 | } + 24 | if (1) { + 25 | return ({}); + 26 | } + 27 | if (1) { + 28 | return {a} = a; + 29 | } + 30 | if (1) { + 31 | return [a] = a; + 32 | } + 33 | if (1) { + 34 | foo + 35 | return [] + 36 | } + 37 | if (1) { + 38 | foo + 39 | return [foo] = bar; + 40 | } + 41 | }); + +> Output + + `␊ + 1 | if (foo) for (const element of foo) {␊ + 2 | if (1) {␊ + 3 | continue;␊ + 4 | }␊ + 5 | if (1) {␊ + 6 | continue␊ + 7 | }␊ + 8 | if (1) {␊ + 9 | !true; continue;␊ + 10 | }␊ + 11 | if (1) {␊ + 12 | !true; continue;␊ + 13 | }␊ + 14 | if (1) {␊ + 15 | bar(); continue;␊ + 16 | }␊ + 17 | if (1) {␊ + 18 | bar(); continue;␊ + 19 | unreachable();␊ + 20 | }␊ + 21 | if (1) {␊ + 22 | ({}); continue;␊ + 23 | }␊ + 24 | if (1) {␊ + 25 | ({}); continue;␊ + 26 | }␊ + 27 | if (1) {␊ + 28 | ({a} = a); continue;␊ + 29 | }␊ + 30 | if (1) {␊ + 31 | ([a] = a); continue;␊ + 32 | }␊ + 33 | if (1) {␊ + 34 | foo␊ + 35 | ;[]; continue;␊ + 36 | }␊ + 37 | if (1) {␊ + 38 | foo␊ + 39 | ;([foo] = bar); continue;␊ + 40 | }␊ + 41 | }␊ + ` + +> Error 1/1 + + `␊ + > 1 | foo?.forEach((element) => {␊ + | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ + 2 | if (1) {␊ + 3 | return;␊ + 4 | }␊ + 5 | if (1) {␊ + 6 | return␊ + 7 | }␊ + 8 | if (1) {␊ + 9 | return!true;␊ + 10 | }␊ + 11 | if (1) {␊ + 12 | return!true␊ + 13 | }␊ + 14 | if (1) {␊ + 15 | return bar();␊ + 16 | }␊ + 17 | if (1) {␊ + 18 | return bar()␊ + 19 | unreachable();␊ + 20 | }␊ + 21 | if (1) {␊ + 22 | return {};␊ + 23 | }␊ + 24 | if (1) {␊ + 25 | return ({});␊ + 26 | }␊ + 27 | if (1) {␊ + 28 | return {a} = a;␊ + 29 | }␊ + 30 | if (1) {␊ + 31 | return [a] = a;␊ + 32 | }␊ + 33 | if (1) {␊ + 34 | foo␊ + 35 | return []␊ + 36 | }␊ + 37 | if (1) {␊ + 38 | foo␊ + 39 | return [foo] = bar;␊ + 40 | }␊ + 41 | });␊ + ` + +## Invalid #138 1 | node.children.index.forEach((children, index) => process(children, index)) > Output @@ -1217,7 +2586,23 @@ Generated by [AVA](https://avajs.dev). | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ ` -## Invalid #65 +## Invalid #139 + 1 | node.children.index?.forEach((children, index) => process(children, index)) + +> Output + + `␊ + 1 | if (node.children.index) for (const [index, children] of node.children.index.entries()) process(children, index)␊ + ` + +> Error 1/1 + + `␊ + > 1 | node.children.index?.forEach((children, index) => process(children, index))␊ + | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ + ` + +## Invalid #140 1 | (node?.children?.index).forEach((children, index) => process(children, index)) > Output @@ -1233,7 +2618,23 @@ Generated by [AVA](https://avajs.dev). | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ ` -## Invalid #66 +## Invalid #141 + 1 | (node?.children?.index)?.forEach((children, index) => process(children, index)) + +> Output + + `␊ + 1 | if (node?.children?.index) for (const [index, children] of (node?.children?.index).entries()) process(children, index)␊ + ` + +> Error 1/1 + + `␊ + > 1 | (node?.children?.index)?.forEach((children, index) => process(children, index))␊ + | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ + ` + +## Invalid #142 1 | node[children].index.forEach((children, index) => process(children, index)) > Error 1/1 @@ -1243,7 +2644,17 @@ Generated by [AVA](https://avajs.dev). | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ ` -## Invalid #67 +## Invalid #143 + 1 | node[children].index?.forEach((children, index) => process(children, index)) + +> Error 1/1 + + `␊ + > 1 | node[children].index?.forEach((children, index) => process(children, index))␊ + | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ + ` + +## Invalid #144 1 | (node.children?.[index]).forEach((children, index) => process(children, index)) > Error 1/1 @@ -1253,7 +2664,17 @@ Generated by [AVA](https://avajs.dev). | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ ` -## Invalid #68 +## Invalid #145 + 1 | (node.children?.[index])?.forEach((children, index) => process(children, index)) + +> Error 1/1 + + `␊ + > 1 | (node.children?.[index])?.forEach((children, index) => process(children, index))␊ + | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ + ` + +## Invalid #146 1 | [{children: 1, index: 1}].forEach((children, index) => process(children, index)) > Output @@ -1265,21 +2686,47 @@ Generated by [AVA](https://avajs.dev). > Error 1/1 `␊ - > 1 | [{children: 1, index: 1}].forEach((children, index) => process(children, index))␊ - | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ + > 1 | [{children: 1, index: 1}].forEach((children, index) => process(children, index))␊ + | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ + ` + +## Invalid #147 + 1 | [{children: 1, index: 1}]?.forEach((children, index) => process(children, index)) + +> Output + + `␊ + 1 | if ([{children: 1, index: 1}]) for (const [index, children] of [{children: 1, index: 1}].entries()) process(children, index)␊ + ` + +> Error 1/1 + + `␊ + > 1 | [{children: 1, index: 1}]?.forEach((children, index) => process(children, index))␊ + | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ + ` + +## Invalid #148 + 1 | [{[children]: 1, index: 1}].forEach((children, index) => process(children, index)) + +> Error 1/1 + + `␊ + > 1 | [{[children]: 1, index: 1}].forEach((children, index) => process(children, index))␊ + | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ ` -## Invalid #69 - 1 | [{[children]: 1, index: 1}].forEach((children, index) => process(children, index)) +## Invalid #149 + 1 | [{[children]: 1, index: 1}]?.forEach((children, index) => process(children, index)) > Error 1/1 `␊ - > 1 | [{[children]: 1, index: 1}].forEach((children, index) => process(children, index))␊ - | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ + > 1 | [{[children]: 1, index: 1}]?.forEach((children, index) => process(children, index))␊ + | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ ` -## Invalid #70 +## Invalid #150 1 | [{[children]: 1, [index]: 1}].forEach((children, index) => process(children, index)) > Error 1/1 @@ -1289,7 +2736,17 @@ Generated by [AVA](https://avajs.dev). | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ ` -## Invalid #71 +## Invalid #151 + 1 | [{[children]: 1, [index]: 1}]?.forEach((children, index) => process(children, index)) + +> Error 1/1 + + `␊ + > 1 | [{[children]: 1, [index]: 1}]?.forEach((children, index) => process(children, index))␊ + | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ + ` + +## Invalid #152 1 | [{children, index: 1}].forEach((children, index) => process(children, index)) > Error 1/1 @@ -1299,7 +2756,17 @@ Generated by [AVA](https://avajs.dev). | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ ` -## Invalid #72 +## Invalid #153 + 1 | [{children, index: 1}]?.forEach((children, index) => process(children, index)) + +> Error 1/1 + + `␊ + > 1 | [{children, index: 1}]?.forEach((children, index) => process(children, index))␊ + | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ + ` + +## Invalid #154 1 | [{children: 1, index}].forEach((children, index) => process(children, index)) > Error 1/1 @@ -1309,7 +2776,17 @@ Generated by [AVA](https://avajs.dev). | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ ` -## Invalid #73 +## Invalid #155 + 1 | [{children: 1, index}]?.forEach((children, index) => process(children, index)) + +> Error 1/1 + + `␊ + > 1 | [{children: 1, index}]?.forEach((children, index) => process(children, index))␊ + | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ + ` + +## Invalid #156 1 | [function name() {}].forEach((name, index) => process(name, index)) > Output @@ -1325,7 +2802,23 @@ Generated by [AVA](https://avajs.dev). | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ ` -## Invalid #74 +## Invalid #157 + 1 | [function name() {}]?.forEach((name, index) => process(name, index)) + +> Output + + `␊ + 1 | if ([function name() {}]) for (const [index, name] of [function name() {}].entries()) process(name, index)␊ + ` + +> Error 1/1 + + `␊ + > 1 | [function name() {}]?.forEach((name, index) => process(name, index))␊ + | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ + ` + +## Invalid #158 1 | [ 2 | function () { 3 | function index() {} @@ -1353,7 +2846,39 @@ Generated by [AVA](https://avajs.dev). | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ ` -## Invalid #75 +## Invalid #159 + 1 | [ + 2 | function () { + 3 | function index() {} + 4 | } + 5 | ]?.forEach((name, index) => process(name, index)) + +> Output + + `␊ + 1 | if ([␊ + 2 | function () {␊ + 3 | function index() {}␊ + 4 | }␊ + 5 | ]) for (const [index, name] of [␊ + 6 | function () {␊ + 7 | function index() {}␊ + 8 | }␊ + 9 | ].entries()) process(name, index)␊ + ` + +> Error 1/1 + + `␊ + 1 | [␊ + 2 | function () {␊ + 3 | function index() {}␊ + 4 | }␊ + > 5 | ]?.forEach((name, index) => process(name, index))␊ + | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ + ` + +## Invalid #160 1 | [ 2 | function () { 3 | class index {} @@ -1381,7 +2906,39 @@ Generated by [AVA](https://avajs.dev). | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ ` -## Invalid #76 +## Invalid #161 + 1 | [ + 2 | function () { + 3 | class index {} + 4 | } + 5 | ]?.forEach((name, index) => process(name, index)) + +> Output + + `␊ + 1 | if ([␊ + 2 | function () {␊ + 3 | class index {}␊ + 4 | }␊ + 5 | ]) for (const [index, name] of [␊ + 6 | function () {␊ + 7 | class index {}␊ + 8 | }␊ + 9 | ].entries()) process(name, index)␊ + ` + +> Error 1/1 + + `␊ + 1 | [␊ + 2 | function () {␊ + 3 | class index {}␊ + 4 | }␊ + > 5 | ]?.forEach((name, index) => process(name, index))␊ + | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ + ` + +## Invalid #162 1 | [class Foo{}].forEach((Foo, index) => process(Foo, index)) > Output @@ -1397,7 +2954,23 @@ Generated by [AVA](https://avajs.dev). | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ ` -## Invalid #77 +## Invalid #163 + 1 | [class Foo{}]?.forEach((Foo, index) => process(Foo, index)) + +> Output + + `␊ + 1 | if ([class Foo{}]) for (const [index, Foo] of [class Foo{}].entries()) process(Foo, index)␊ + ` + +> Error 1/1 + + `␊ + > 1 | [class Foo{}]?.forEach((Foo, index) => process(Foo, index))␊ + | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ + ` + +## Invalid #164 1 | [class Foo{}].forEach((X, Foo) => process(X, Foo)) > Output @@ -1413,7 +2986,23 @@ Generated by [AVA](https://avajs.dev). | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ ` -## Invalid #78 +## Invalid #165 + 1 | [class Foo{}]?.forEach((X, Foo) => process(X, Foo)) + +> Output + + `␊ + 1 | if ([class Foo{}]) for (const [Foo, X] of [class Foo{}].entries()) process(X, Foo)␊ + ` + +> Error 1/1 + + `␊ + > 1 | [class Foo{}]?.forEach((X, Foo) => process(X, Foo))␊ + | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ + ` + +## Invalid #166 1 | [ 2 | class Foo { 3 | bar() {} @@ -1441,7 +3030,39 @@ Generated by [AVA](https://avajs.dev). | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ ` -## Invalid #79 +## Invalid #167 + 1 | [ + 2 | class Foo { + 3 | bar() {} + 4 | } + 5 | ]?.forEach((Foo, bar) => process(Foo, bar)) + +> Output + + `␊ + 1 | if ([␊ + 2 | class Foo {␊ + 3 | bar() {}␊ + 4 | }␊ + 5 | ]) for (const [bar, Foo] of [␊ + 6 | class Foo {␊ + 7 | bar() {}␊ + 8 | }␊ + 9 | ].entries()) process(Foo, bar)␊ + ` + +> Error 1/1 + + `␊ + 1 | [␊ + 2 | class Foo {␊ + 3 | bar() {}␊ + 4 | }␊ + > 5 | ]?.forEach((Foo, bar) => process(Foo, bar))␊ + | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ + ` + +## Invalid #168 1 | foo.React.Children.forEach(bar) > Error 1/1 @@ -1451,7 +3072,17 @@ Generated by [AVA](https://avajs.dev). | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ ` -## Invalid #80 +## Invalid #169 + 1 | foo.React.Children?.forEach(bar) + +> Error 1/1 + + `␊ + > 1 | foo.React.Children?.forEach(bar)␊ + | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ + ` + +## Invalid #170 1 | NotReact.Children.forEach(bar) > Error 1/1 @@ -1461,7 +3092,17 @@ Generated by [AVA](https://avajs.dev). | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ ` -## Invalid #81 +## Invalid #171 + 1 | NotReact.Children?.forEach(bar) + +> Error 1/1 + + `␊ + > 1 | NotReact.Children?.forEach(bar)␊ + | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ + ` + +## Invalid #172 1 | React.NotChildren.forEach(bar) > Error 1/1 @@ -1471,7 +3112,17 @@ Generated by [AVA](https://avajs.dev). | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ ` -## Invalid #82 +## Invalid #173 + 1 | React.NotChildren?.forEach(bar) + +> Error 1/1 + + `␊ + > 1 | React.NotChildren?.forEach(bar)␊ + | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ + ` + +## Invalid #174 1 | React?.Children.forEach(bar) > Error 1/1 @@ -1481,7 +3132,17 @@ Generated by [AVA](https://avajs.dev). | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ ` -## Invalid #83 +## Invalid #175 + 1 | React?.Children?.forEach(bar) + +> Error 1/1 + + `␊ + > 1 | React?.Children?.forEach(bar)␊ + | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ + ` + +## Invalid #176 1 | NotChildren.forEach(bar) > Error 1/1 @@ -1491,7 +3152,17 @@ Generated by [AVA](https://avajs.dev). | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ ` -## Invalid #84 +## Invalid #177 + 1 | NotChildren?.forEach(bar) + +> Error 1/1 + + `␊ + > 1 | NotChildren?.forEach(bar)␊ + | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ + ` + +## Invalid #178 1 | foo.forEach(element => { 2 | element ++; 3 | }) @@ -1513,7 +3184,29 @@ Generated by [AVA](https://avajs.dev). 3 | })␊ ` -## Invalid #85 +## Invalid #179 + 1 | foo?.forEach(element => { + 2 | element ++; + 3 | }) + +> Output + + `␊ + 1 | if (foo) for (let element of foo) {␊ + 2 | element ++;␊ + 3 | }␊ + ` + +> Error 1/1 + + `␊ + > 1 | foo?.forEach(element => {␊ + | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ + 2 | element ++;␊ + 3 | })␊ + ` + +## Invalid #180 1 | foo.forEach(element => { 2 | const a = -- element; 3 | }) @@ -1535,7 +3228,29 @@ Generated by [AVA](https://avajs.dev). 3 | })␊ ` -## Invalid #86 +## Invalid #181 + 1 | foo?.forEach(element => { + 2 | const a = -- element; + 3 | }) + +> Output + + `␊ + 1 | if (foo) for (let element of foo) {␊ + 2 | const a = -- element;␊ + 3 | }␊ + ` + +> Error 1/1 + + `␊ + > 1 | foo?.forEach(element => {␊ + | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ + 2 | const a = -- element;␊ + 3 | })␊ + ` + +## Invalid #182 1 | foo.forEach((element, index) => { 2 | index ++; 3 | element = 2 @@ -1545,9 +3260,57 @@ Generated by [AVA](https://avajs.dev). `␊ 1 | for (let [index, element] of foo.entries()) {␊ - 2 | index ++;␊ - 3 | element = 2␊ - 4 | }␊ + 2 | index ++;␊ + 3 | element = 2␊ + 4 | }␊ + ` + +> Error 1/1 + + `␊ + > 1 | foo.forEach((element, index) => {␊ + | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ + 2 | index ++;␊ + 3 | element = 2␊ + 4 | });␊ + ` + +## Invalid #183 + 1 | foo?.forEach((element, index) => { + 2 | index ++; + 3 | element = 2 + 4 | }); + +> Output + + `␊ + 1 | if (foo) for (let [index, element] of foo.entries()) {␊ + 2 | index ++;␊ + 3 | element = 2␊ + 4 | }␊ + ` + +> Error 1/1 + + `␊ + > 1 | foo?.forEach((element, index) => {␊ + | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ + 2 | index ++;␊ + 3 | element = 2␊ + 4 | });␊ + ` + +## Invalid #184 + 1 | foo.forEach((element, index) => { + 2 | element >>>= 2; + 3 | }); + +> Output + + `␊ + 1 | for (let [index, element] of foo.entries()) {␊ + 2 | element >>>= 2;␊ + 3 | }␊ ` > Error 1/1 @@ -1555,20 +3318,19 @@ Generated by [AVA](https://avajs.dev). `␊ > 1 | foo.forEach((element, index) => {␊ | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ - 2 | index ++;␊ - 3 | element = 2␊ - 4 | });␊ + 2 | element >>>= 2;␊ + 3 | });␊ ` -## Invalid #87 - 1 | foo.forEach((element, index) => { +## Invalid #185 + 1 | foo?.forEach((element, index) => { 2 | element >>>= 2; 3 | }); > Output `␊ - 1 | for (let [index, element] of foo.entries()) {␊ + 1 | if (foo) for (let [index, element] of foo.entries()) {␊ 2 | element >>>= 2;␊ 3 | }␊ ` @@ -1576,13 +3338,13 @@ Generated by [AVA](https://avajs.dev). > Error 1/1 `␊ - > 1 | foo.forEach((element, index) => {␊ - | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ + > 1 | foo?.forEach((element, index) => {␊ + | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ 2 | element >>>= 2;␊ 3 | });␊ ` -## Invalid #88 +## Invalid #186 1 | foo.forEach((element, index) => { 2 | const a = element = 1; 3 | }); @@ -1604,7 +3366,29 @@ Generated by [AVA](https://avajs.dev). 3 | });␊ ` -## Invalid #89 +## Invalid #187 + 1 | foo?.forEach((element, index) => { + 2 | const a = element = 1; + 3 | }); + +> Output + + `␊ + 1 | if (foo) for (let [index, element] of foo.entries()) {␊ + 2 | const a = element = 1;␊ + 3 | }␊ + ` + +> Error 1/1 + + `␊ + > 1 | foo?.forEach((element, index) => {␊ + | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ + 2 | const a = element = 1;␊ + 3 | });␊ + ` + +## Invalid #188 1 | foo.forEach((element, index) => { 2 | let a; 3 | a >>>= element; @@ -1629,7 +3413,32 @@ Generated by [AVA](https://avajs.dev). 4 | });␊ ` -## Invalid #90 +## Invalid #189 + 1 | foo?.forEach((element, index) => { + 2 | let a; + 3 | a >>>= element; + 4 | }); + +> Output + + `␊ + 1 | if (foo) for (const [index, element] of foo.entries()) {␊ + 2 | let a;␊ + 3 | a >>>= element;␊ + 4 | }␊ + ` + +> Error 1/1 + + `␊ + > 1 | foo?.forEach((element, index) => {␊ + | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ + 2 | let a;␊ + 3 | a >>>= element;␊ + 4 | });␊ + ` + +## Invalid #190 1 | foo.forEach(({property}) => {bar(property)}) > Output @@ -1645,7 +3454,23 @@ Generated by [AVA](https://avajs.dev). | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ ` -## Invalid #91 +## Invalid #191 + 1 | foo?.forEach(({property}) => {bar(property)}) + +> Output + + `␊ + 1 | if (foo) for (const {property} of foo) {bar(property)}␊ + ` + +> Error 1/1 + + `␊ + > 1 | foo?.forEach(({property}) => {bar(property)})␊ + | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ + ` + +## Invalid #192 1 | foo.forEach(({foo: {foo: [property]}}) => {bar(property, index)}) > Output @@ -1661,7 +3486,23 @@ Generated by [AVA](https://avajs.dev). | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ ` -## Invalid #92 +## Invalid #193 + 1 | foo?.forEach(({foo: {foo: [property]}}) => {bar(property, index)}) + +> Output + + `␊ + 1 | if (foo) for (const {foo: {foo: [property]}} of foo) {bar(property, index)}␊ + ` + +> Error 1/1 + + `␊ + > 1 | foo?.forEach(({foo: {foo: [property]}}) => {bar(property, index)})␊ + | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ + ` + +## Invalid #194 1 | foo.forEach((element, {bar: {bar: [index]}}) => {bar(element, index)}) > Output @@ -1677,7 +3518,23 @@ Generated by [AVA](https://avajs.dev). | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ ` -## Invalid #93 +## Invalid #195 + 1 | foo?.forEach((element, {bar: {bar: [index]}}) => {bar(element, index)}) + +> Output + + `␊ + 1 | if (foo) for (const [{bar: {bar: [index]}}, element] of foo.entries()) {bar(element, index)}␊ + ` + +> Error 1/1 + + `␊ + > 1 | foo?.forEach((element, {bar: {bar: [index]}}) => {bar(element, index)})␊ + | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ + ` + +## Invalid #196 1 | foo.forEach((element = elementDefaultValue, index = indexDefaultValue) => {}) > Output @@ -1693,7 +3550,23 @@ Generated by [AVA](https://avajs.dev). | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ ` -## Invalid #94 +## Invalid #197 + 1 | foo?.forEach((element = elementDefaultValue, index = indexDefaultValue) => {}) + +> Output + + `␊ + 1 | if (foo) for (const [index = indexDefaultValue, element = elementDefaultValue] of foo.entries()) {}␊ + ` + +> Error 1/1 + + `␊ + > 1 | foo?.forEach((element = elementDefaultValue, index = indexDefaultValue) => {})␊ + | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ + ` + +## Invalid #198 1 | foo.forEach(({}) => {}) > Output @@ -1709,7 +3582,23 @@ Generated by [AVA](https://avajs.dev). | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ ` -## Invalid #95 +## Invalid #199 + 1 | foo?.forEach(({}) => {}) + +> Output + + `␊ + 1 | if (foo) for (const {} of foo) {}␊ + ` + +> Error 1/1 + + `␊ + > 1 | foo?.forEach(({}) => {})␊ + | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ + ` + +## Invalid #200 1 | foo.forEach(function foo({a, b, c, d}) {}) > Output @@ -1725,7 +3614,23 @@ Generated by [AVA](https://avajs.dev). | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ ` -## Invalid #96 +## Invalid #201 + 1 | foo?.forEach(function foo({a, b, c, d}) {}) + +> Output + + `␊ + 1 | if (foo) for (const {a, b, c, d} of foo) {}␊ + ` + +> Error 1/1 + + `␊ + > 1 | foo?.forEach(function foo({a, b, c, d}) {})␊ + | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ + ` + +## Invalid #202 1 | foo.forEach(function foo({a, b, c, d, foo}) {}) > Error 1/1 @@ -1735,7 +3640,17 @@ Generated by [AVA](https://avajs.dev). | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ ` -## Invalid #97 +## Invalid #203 + 1 | foo?.forEach(function foo({a, b, c, d, foo}) {}) + +> Error 1/1 + + `␊ + > 1 | foo?.forEach(function foo({a, b, c, d, foo}) {})␊ + | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ + ` + +## Invalid #204 1 | foo.forEach(({foo: property}) => {bar(property)}) > Output @@ -1751,7 +3666,23 @@ Generated by [AVA](https://avajs.dev). | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ ` -## Invalid #98 +## Invalid #205 + 1 | foo?.forEach(({foo: property}) => {bar(property)}) + +> Output + + `␊ + 1 | if (foo) for (const {foo: property} of foo) {bar(property)}␊ + ` + +> Error 1/1 + + `␊ + > 1 | foo?.forEach(({foo: property}) => {bar(property)})␊ + | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ + ` + +## Invalid #206 1 | foo.forEach(({[foo]: property}) => {bar(property)}) > Output @@ -1767,7 +3698,23 @@ Generated by [AVA](https://avajs.dev). | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ ` -## Invalid #99 +## Invalid #207 + 1 | foo?.forEach(({[foo]: property}) => {bar(property)}) + +> Output + + `␊ + 1 | if (foo) for (const {[foo]: property} of foo) {bar(property)}␊ + ` + +> Error 1/1 + + `␊ + > 1 | foo?.forEach(({[foo]: property}) => {bar(property)})␊ + | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ + ` + +## Invalid #208 1 | foo.forEach(({element}, index) => { 2 | element &&= 2; 3 | }); @@ -1789,7 +3736,29 @@ Generated by [AVA](https://avajs.dev). 3 | });␊ ` -## Invalid #100 +## Invalid #209 + 1 | foo?.forEach(({element}, index) => { + 2 | element &&= 2; + 3 | }); + +> Output + + `␊ + 1 | if (foo) for (let [index, {element}] of foo.entries()) {␊ + 2 | element &&= 2;␊ + 3 | }␊ + ` + +> Error 1/1 + + `␊ + > 1 | foo?.forEach(({element}, index) => {␊ + | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ + 2 | element &&= 2;␊ + 3 | });␊ + ` + +## Invalid #210 1 | foo.forEach(_ => { 2 | if (true) return {}; 3 | }) @@ -1811,7 +3780,29 @@ Generated by [AVA](https://avajs.dev). 3 | })␊ ` -## Invalid #101 +## Invalid #211 + 1 | foo?.forEach(_ => { + 2 | if (true) return {}; + 3 | }) + +> Output + + `␊ + 1 | if (foo) for (const _ of foo) {␊ + 2 | if (true) { ({}); continue; }␊ + 3 | }␊ + ` + +> Error 1/1 + + `␊ + > 1 | foo?.forEach(_ => {␊ + | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ + 2 | if (true) return {};␊ + 3 | })␊ + ` + +## Invalid #212 1 | foo.forEach(_ => { 2 | if (true); 3 | else return {}; @@ -1836,7 +3827,32 @@ Generated by [AVA](https://avajs.dev). 4 | })␊ ` -## Invalid #102 +## Invalid #213 + 1 | foo?.forEach(_ => { + 2 | if (true); + 3 | else return {}; + 4 | }) + +> Output + + `␊ + 1 | if (foo) for (const _ of foo) {␊ + 2 | if (true);␊ + 3 | else { ({}); continue; }␊ + 4 | }␊ + ` + +> Error 1/1 + + `␊ + > 1 | foo?.forEach(_ => {␊ + | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ + 2 | if (true);␊ + 3 | else return {};␊ + 4 | })␊ + ` + +## Invalid #214 1 | if (true) {} else[foo].forEach((element) => {}) > Output @@ -1851,3 +3867,35 @@ Generated by [AVA](https://avajs.dev). > 1 | if (true) {} else[foo].forEach((element) => {})␊ | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ ` + +## Invalid #215 + 1 | if (true) {} else[foo]?.forEach((element) => {}) + +> Output + + `␊ + 1 | if (true) {} else if ([foo]) for (const element of [foo]) {}␊ + ` + +> Error 1/1 + + `␊ + > 1 | if (true) {} else[foo]?.forEach((element) => {})␊ + | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ + ` + +## Invalid #216 + 1 | 1?.forEach((a, b) => call(a, b)) + +> Output + + `␊ + 1 | if (1) for (const [b, a] of (1).entries()) call(a, b)␊ + ` + +> Error 1/1 + + `␊ + > 1 | 1?.forEach((a, b) => call(a, b))␊ + | ^^^^^^^ Use \`for…of\` instead of \`Array#forEach(…)\`.␊ + ` diff --git a/test/snapshots/no-array-for-each.mjs.snap b/test/snapshots/no-array-for-each.mjs.snap index c83076f71b5013bce0160ddd02db637e20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