Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,19 @@ The following rules require type information:
- [`react-x/no-unused-props`](/docs/rules/no-unused-props)
- [`react-x/prefer-read-only-props`](/docs/rules/prefer-read-only-props)

<Callout type="warning">
Some rules, such as `react-x/no-leaked-conditional-rendering`, work better when certain TypeScript compiler options are enabled. We recommend enabling `strictNullChecks` in your `tsconfig.json` or `jsconfig.json`:

```json
{
"compilerOptions": {
"strictNullChecks": true,
// ...
}
}
```
</Callout>

**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.
Expand Down
3 changes: 2 additions & 1 deletion apps/website/content/docs/getting-started/javascript.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,8 @@ import { Step, Steps } from "fumadocs-ui/components/steps";
{
"compilerOptions": {
// ...other options
"jsx": "react-jsx"
"jsx": "react-jsx",
"strictNullChecks": true // Recommended for better type inference
},
"include": ["**/*.js", "**/*.jsx"]
}
Expand Down
3 changes: 2 additions & 1 deletion apps/website/content/docs/getting-started/typescript.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,8 @@ import { Step, Steps } from "fumadocs-ui/components/steps";
{
"compilerOptions": {
// ...other options
"jsx": "react-jsx"
"jsx": "react-jsx",
"strictNullChecks": true // Recommended for better type inference
},
"include": ["**/*.ts", "**/*.tsx"]
}
Expand Down