-
-
Notifications
You must be signed in to change notification settings - Fork 381
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
Add isShadowed
check to new-for-builtins
#540
Conversation
test/new-for-builtins.js
Outdated
'Uint16Array', | ||
'Uint32Array', | ||
'Uint8ClampedArray' | ||
]; |
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.
These are just redefinitions of what's in the rule. I think it would be better to move these to util.js and import them both in the rule and here.
test/new-for-builtins.js
Outdated
@@ -5,6 +5,14 @@ import rule from '../rules/new-for-builtins'; | |||
const ruleTester = avaRuleTester(test, { | |||
env: { | |||
es6: true |
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.
Let's start using es2020
for these instead of es6
.
# Conflicts: # rules/new-for-builtins.js
Fixes #122
I just steal this function from https://github.com/eslint/eslint/blob/1ee6b6388305a8671c8d4c3cf30c2dbf18a1ff7e/lib/rules/no-alert.js#L48
I've tried to solve this issue before, but failed, this function use range check instead of name check is great idea.
We may need add this check in more rules, I'll check later.
IssueHunt Summary
Referenced issues
This pull request has been submitted to:
new-for-builtins
ruleIssueHunt has been backed by the following sponsors. Become a sponsor