diff --git a/apps/website/content/docs/configuration/configure-project-config.mdx b/apps/website/content/docs/configuration/configure-project-config.mdx index a6cd4699d..1e3ecc12c 100644 --- a/apps/website/content/docs/configuration/configure-project-config.mdx +++ b/apps/website/content/docs/configuration/configure-project-config.mdx @@ -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) + + 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, + // ... + } + } + ``` + + **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. diff --git a/apps/website/content/docs/getting-started/javascript.mdx b/apps/website/content/docs/getting-started/javascript.mdx index 71ca03eb8..ab25694a1 100644 --- a/apps/website/content/docs/getting-started/javascript.mdx +++ b/apps/website/content/docs/getting-started/javascript.mdx @@ -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"] } diff --git a/apps/website/content/docs/getting-started/typescript.mdx b/apps/website/content/docs/getting-started/typescript.mdx index 5c1099427..766e2d0f2 100644 --- a/apps/website/content/docs/getting-started/typescript.mdx +++ b/apps/website/content/docs/getting-started/typescript.mdx @@ -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"] }