Skip to content
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

Merged
merged 6 commits into from
Feb 13, 2020

Conversation

fisker
Copy link
Collaborator

@fisker fisker commented Feb 13, 2020

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:


IssueHunt has been backed by the following sponsors. Become a sponsor

'Uint16Array',
'Uint32Array',
'Uint8ClampedArray'
];
Copy link
Owner

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.

@@ -5,6 +5,14 @@ import rule from '../rules/new-for-builtins';
const ruleTester = avaRuleTester(test, {
env: {
es6: true
Copy link
Owner

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.

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.

False positive for the new-for-builtins rule
2 participants