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

[New] component detection: track React imports #3149

Merged
merged 2 commits into from Nov 29, 2021

Commits on Nov 26, 2021

  1. [Tests] component detection: Add testing scaffolding

    Test detection of Class Components and Stateless Function Components
    Lay scaffolding for other flavors of tests including further component types, pragma detection, and utils functions
    duncanbeevers authored and ljharb committed Nov 26, 2021
    Copy the full SHA
    8b98e60 View commit details
    Browse the repository at this point in the history
  2. [New] components detection: track React imports

    The default React import and named React import specifiers are tracked during a Components.detect rules definition.
    Rules using Components.detect can access the default import specifier using `components.getDefaultReactImport()` and an array any named import specifiers using `components.getNamedReactImports()`
    Within a rule, these specifier nodes can be checked to ensure identifiers in scope correspond with the imported identifiers.
    
    Not treating this as semver-minor since it's not part of the documented API.
    duncanbeevers authored and ljharb committed Nov 26, 2021
    Copy the full SHA
    a09debf View commit details
    Browse the repository at this point in the history