-
-
Notifications
You must be signed in to change notification settings - Fork 198
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
Ignore direct instantiation of EmberArray
in no-array-prototype-extensions
rule
#1749
Ignore direct instantiation of EmberArray
in no-array-prototype-extensions
rule
#1749
Conversation
node.type === 'CallExpression' && | ||
nodeInitializedTo && | ||
nodeInitializedTo.callee && | ||
(nodeInitializedTo.callee.name === 'A' || nodeInitializedTo.callee.name === 'EmberArray') |
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.
We're going to have to check against the actual names these are imported under, if they're imported at all. See the ImportDeclaration
visitor for example.
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.
Updated the logic to fetch the actual import name and also updated the test cases to include an import statement.
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.
Can you also add a correct code sample in the rule doc showing that this case is allowed?
no-array-prototype-extensions
rule
no-array-prototype-extensions
ruleEmberArray
in no-array-prototype-extensions
rule
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.
Thanks!
EmberArray
in no-array-prototype-extensions
ruleEmberArray
in no-array-prototype-extensions
rule
Overview
Partially fixes #1561. Helps reduce false positives.
Direct instantiation of Ember arrays ie:
are not deprecated so they should be allowed by the linter.