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 new ESLint rule: prefer-primordials #35448

Closed
wants to merge 1 commit into from
Closed

Add new ESLint rule: prefer-primordials #35448

wants to merge 1 commit into from

Commits on Nov 7, 2020

  1. tools: add new ESLint rule: prefer-primordials

    I added a new custom ESLint rule to fix these problems.
    
    We have a lot of replaceable codes with primordials.
    Accessing built-in objects is restricted by existing rule
    (no-restricted-globals), but accessing property in the built-in objects
    is not restricted right now. We manually review codes that can be
    replaced by primordials, but there's a lot of code that actually needs
    to be fixed. We have often made pull requests to replace the primordials
    with.
    
    Restrict accessing global built-in objects such as `Promise`.
    Restrict calling static methods such as `Array.from` or `Symbol.for`.
    Don't restrict prototype methods to prevent false-positive.
    Leko committed Nov 7, 2020
    Copy the full SHA
    dc6874a View commit details
    Browse the repository at this point in the history