Configure Language Config
ESLint React references your language config to determine how to perform static code analysis. This page details which parts of ESLint React utilize your language config.
JSX Runtime
ESLint React reads your tsconfig.json
or jsconfig.json
configuration file to determine the JSX runtime type.
The following compiler options are respected:
Prop | Type | Default |
---|---|---|
jsx? | JSXTransform | "react-jsx" |
jsxFactory? | string | "React.createElement" |
jsxFragmentFactory? | string | "React.Fragment" |
jsxImportSource? | string | "react" |
If nothing is specified, it defaults to automatic
.
Since this part does not perform type checking, there is almost no performance impact.
Rules that Need Type Information
ESLint React uses the Typed Linting API from typescript-eslint
to retrieve type information for the rules that require it.
The following rules require type information:
The project
or projectService
options in parserOptions
must be set correctly for the rules to work.
Enabling these rules will have performance impact, but they are more powerful than traditional lint rules.
Resources
For more information, see: