- Installation
- Enabling rules
- Specifying project-aware React configuration
- Roadmap
- License
- Acknowledgements
(WIP) Bring the same linting functionality that eslint-react.xyz has to the TypeScript LSP.
This package provides the rulesets from beta.eslint-react.xyz/docs/rules/overview as custom rules for the ArnaudBarre/tsl linting tool.
pnpm add -D tsl tsl-reactThen follow the installation guide for tsl.
// tsl.config.ts
import { core, defineConfig } from "tsl";
+ import * as react from "tsl-react";
export default defineConfig({
rules: [
...core.all(),
+ react.noLeakedConditionalRendering(),
],
});In your tsconfig.json or jsconfig.json add the following:
{
"compilerOptions": {
+ "jsx": "react-jsx",
"plugins": [{ "name": "tsl/plugin" }],
},
+ "react": {
+ "version": "19.1.0" // or "detect" to automatically detect the version
+ // other options can be added here
+ }
}-
.pkgs/configsto.pkgs/configs -
.pkgs/eslint-plugin-localto.pkgs/tsl-local
-
@eslint-react/effto@react-analyzer/eff -
@eslint-react/astto@react-analyzer/ast -
@eslint-react/varto@react-analyzer/var
-
@eslint-react/coreto@react-analyzer/core -
@eslint-react/sharedto@react-analyzer/shared
-
@eslint-react/eslint-plugintotsl-react -
eslint-plugin-react-xtotsl-react-x -
eslint-plugin-react-domtotsl-react-dom -
eslint-plugin-react-web-apitotsl-react-web-api -
eslint-plugin-react-hooks-extratotsl-react-hooks-extra -
eslint-plugin-react-naming-conventiontotsl-react-naming-convention
-
noLeakedConditionalRendering: Prevents problematic leaked values from being rendered. - ...
This project is licensed under the MIT License.
We extend our gratitude to:
- ArnaudBarre/tsl for the core and AST type rewrite, which significantly streamlined custom rules development within TypeScript Language Service Plugin.
- johnsoncodehk/tsslint for their early explorations of exposing the TypeScript Language Server diagnostic interface.
- typescript-eslint/typescript-eslint for providing the foundation where these custom rules were initially developed and tested.
- Effect-TS/language-service for inspiring the creation of
typescriptreact-language-service(nowtsl-react).