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

feat(scope-manager): add support for JSX scope analysis #2498

Merged
merged 1 commit into from Sep 6, 2020

Commits on Sep 6, 2020

  1. feat(scope-manager): add support for analysing JSX

    Fixes #2455
    And part of #2477
    
    JSX is a first-class citizen of TS, so we should really support it as well.
    I was going to just rely upon `eslint-plugin-react`'s patch lint rules (`react/jsx-uses-react` and `react/jsx-uses-vars`), but that leaves gaps in our tooling.
    For example #2455, `consistent-type-imports` makes assumptions and can create invalid fixes for react without this change.
    We could add options to that lint rule for the factory, but that is kind-of a sub-par experience and future rule authors will likely run into similar problems.
    
    - Adds full scope analysis support for JSX.
    - Adds two new `parserOption`:
        - `jsxPragma` - the name to use for constructing JSX elements. Defaults to `"React"`. Will be auto detected from the tsconfig.
        - `jsxFragmentName` - the name that unnamed JSX fragments use. Defaults to `null` (i.e. assumes `React.Fragment`). Will be auto detected from the tsconfig.
    bradzacher committed Sep 6, 2020
    Copy the full SHA
    d7b0b9b View commit details
    Browse the repository at this point in the history