-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
deprecated named imports #27
Conversation
b131f6b
to
1265610
Compare
lib/rules/import.js
Outdated
.map((module) => module.value.name); | ||
|
||
imports | ||
.filter((imp) => imp.check(requireArg.value, new Set(namedImports))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
creating Set from array is O(n) operation, better to use it outside of the filter func
lib/rules/import.js
Outdated
imports | ||
.filter((imp) => imp.check(importPath)) | ||
.filter((imp) => imp.check(importPath, new Set(importedModules))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
creating Set from array is O(n) operation, better to use it outside of the filter func
tests/rules/test_import.js
Outdated
code: 'const redirect = require("gatsby").redirect', | ||
parser: 'babel-eslint', | ||
options: [{ module: 'gatsby', name: 'navigate', use: 'utils/navigate' }], | ||
errors: [{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this error make sense here? Error cases must be inside the invalid
section
1265610
to
bc65942
Compare
Thanks a lot, this PR fixes this issue - #16 |
the new minor version is available |
No description provided.