False positive in consistent-function-scoping
when using React.useEffect
#1685
Labels
consistent-function-scoping
when using React.useEffect
#1685
Since #588,
consistent-function-scoping
is not triggered for the following code:This makes sense – see #392. However, when React is imported as a namespace, the same code is no longer valid:
Reporting React as a namespace is OK. I prefer this method because it produces smaller git diffs and prevents
no-unused-var
when refactoring.Happy to submit a PR with the fix around next weekend. If anyone wants to create one earlier, please feel free to! 🙌
Relevant condition and its test:
eslint-plugin-unicorn/rules/consistent-function-scoping.js
Lines 92 to 97 in d9fd664
eslint-plugin-unicorn/test/consistent-function-scoping.mjs
Lines 266 to 271 in d9fd664
The text was updated successfully, but these errors were encountered: