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

[lint] Add a lint rule to disallow Haste imports #25058

Closed
wants to merge 2 commits into from

Commits on May 27, 2019

  1. Configuration menu
    Copy the full SHA
    bf43158 View commit details
    Browse the repository at this point in the history

Commits on May 28, 2019

  1. [lint] Add a lint rule to disallow Haste imports

    This is an ESLint plugin that infers whether an import looks like a Haste module name. To keep the linter fast and simple, it does not look in the Haste map. Instead, it looks for uppercase characters in single-name import paths, since npm has disallowed uppercase letters in package names for a long time. There are some false negatives (e.g. "merge" is a Haste module and this linter rule would not pick it up) but those are about 1.1% of the module names in the RN repo, and unit tests and integration tests will fail anyway once Haste is turned off.
    
    Test Plan: Run `yarn lint` as a sanity check. Modify an import statement to use a Haste module name and verify the linter reports an error. Do the same with a require call.
    ide authored and cpojer committed May 28, 2019
    Configuration menu
    Copy the full SHA
    0f6f8a6 View commit details
    Browse the repository at this point in the history