eslint-plugin-react-ts
ESLint plugin to lint TypeScript React and Preact function components using the @typescript-eslint ecosystem.
Warning
This plugin is still in early development, and will likely change significantly before reaching a stable version.
Supported Engines
Node.js
- 18.x LTS Hydrogen
- 20.x Current
Bun
Installation
pnpm add --save-dev eslint-plugin-react-ts
bun add --dev eslint-plugin-react-ts
Usage
{
"extends": [
"plugin:react-ts/recommended"
],
"rules": {
"react-ts/<rule-name>": "error"
}
}
import reactTsRecommended from "eslint-plugin-react-ts/configs/recommended";
export default [
reactTsRecommended,
{
rules: {
"react-ts/<rule-name>": "error",
},
},
];
Rules
Planned (will be added in the future)
Philosophy
- Focus on code rather than style.
- Linting errors are better than runtime crashes.
- Types are the fundamental unit of correctness.
Rule introduction or modification principles
- TypeScript first. If a behavior can already be enforced by TypeScript built-in checker, it should not be reimplemented in this plugin.
- Formatting independent. Rules should not be concerned with style or formatting.
- Auto-fixable. Rules should be auto-fixable if it is safe and possible, but this is not the goal.
- Sensible defaults. Rules should be easy to setup and use with minimal configuration and sensible defaults.
License
This project is licensed under the MIT License - see the LICENSE file for details.
THIRD-PARTY-LICENSE
This project uses code from following third-party projects:
- eslint-plugin-perfectionist (MIT)
- eslint-plugin-react (MIT)
- eslint-plugin-solid (MIT)
- @tanstack/eslint-plugin-query (MIT)
- eslint-plugin-filenames-simple (MIT)
Licenses are list in THIRD-PARTY-LICENSE