Skip to content

Conversation

@bmish
Copy link
Member

@bmish bmish commented Jul 27, 2021

If the suggestions array is initialized as an empty array variable, we need to assume that someone may have pushed suggestion objects to it, so we should consider that a usage of suggestions.

Previously, this rule incorrectly assumed that using const suggest = []; ... context.report({suggest,...}); meant the rule was not using suggestions.

Real world example here: https://github.com/eslint/eslint/blob/master/lib/rules/no-nonoctal-decimal-escape.js#L91

@aladdin-add aladdin-add merged commit fffa881 into eslint-community:master Jul 27, 2021
@aladdin-add
Copy link
Contributor

released in eslint-plugin-eslint-plugin@3.5.1

@bmish
Copy link
Member Author

bmish commented Jul 27, 2021

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants