Skip to content

Commit 3ed0860

Browse files
committed
chore: reformat mdx
1 parent 5ccd5d4 commit 3ed0860

File tree

105 files changed

+754
-301
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

105 files changed

+754
-301
lines changed

.mdxlintrc.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"settings": {
3+
"rule": "-",
4+
"bullet": "-",
5+
"emphasis": "_",
6+
"printWidth": 1024
7+
},
8+
"plugins": ["remark-gfm", ["remark-frontmatter", ["toml", "yaml"]]]
9+
}

apps/website/content/docs/community.mdx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,7 @@ import { projects, presets } from "./community.tsx";
1212
<GitHubRepoGrid repos={projects} />
1313

1414
<small>
15-
16-
_Data collected from GitHub dependents network, if there are any mismatch or outdated information, feel free to [open issue](https://github.com/Rel1cx/eslint-react/issues/new?assignees=&labels=type%3A+documentation&projects=&template=docs_report.md&title=%5Bdocs%5D+) or pull request._
17-
15+
_Data collected from GitHub dependents network, if there are any mismatch or outdated information, feel free to [open issue](https://github.com/Rel1cx/eslint-react/issues/new?assignees=\&labels=type%3A+documentation\&projects=\&template=docs_report.md\&title=%5Bdocs%5D+) or pull request._
1816
</small>
1917

2018
## Adoption Feedback on Social Media

apps/website/content/docs/configuration/using-custom-parsers/ts-blank-eslint-parser.mdx

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,13 @@ description: "Using ts-blank-eslint-parser as an alternative parser for TypeScri
44
---
55

66
<Callout type="warn">
7-
The `ts-blank-eslint-parser` is a work in progress and comes with limitations:
7+
The `ts-blank-eslint-parser` is a work in progress and comes with limitations:
88

9-
- No support for [TypeScript syntax](https://github.com/bloomberg/ts-blank-space/blob/main/docs/unsupported_syntax.md) that need transformation like enums, namespaces, decorators
10-
- No support for rules that require type information
11-
- No fixable support for types (the types will also be stripped out in the fix output)
12-
13-
Use it only if you are okay with the limitations.
9+
- No support for [TypeScript syntax](https://github.com/bloomberg/ts-blank-space/blob/main/docs/unsupported_syntax.md) that need transformation like enums, namespaces, decorators
10+
- No support for rules that require type information
11+
- No fixable support for types (the types will also be stripped out in the fix output)
1412

13+
Use it only if you are okay with the limitations.
1514
</Callout>
1615

1716
## Install

apps/website/content/docs/faq.mdx

Lines changed: 40 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -5,69 +5,59 @@ title: FAQ
55
import { Accordion, Accordions } from "fumadocs-ui/components/accordion";
66

77
<Accordions>
8+
<Accordion title="Why?">
9+
**ESLint React addresses critical gaps of the existing `eslint-plugin-react` in modern React ecosystems**. While named "react", the current plugin implementation specifically targets React DOM and maintains DOM-centric assumptions, creating friction when used with alternative renderers like React Native, React Three Fiber, or custom renderers.
810

9-
<Accordion title="Why?">
11+
Our solution treating DOM as one of many supported targets rather than the default assumption. This paradigm shift enables:
1012

11-
**ESLint React addresses critical gaps of the existing `eslint-plugin-react` in modern React ecosystems**. While named "react", the current plugin implementation specifically targets React DOM and maintains DOM-centric assumptions, creating friction when used with alternative renderers like React Native, React Three Fiber, or custom renderers.
13+
- **Context-aware linting**: Adapting to different runtime environments
14+
- **Future-proof architecture**: Compatibility with emerging React platforms
15+
- **Unified code quality standards**: Consistent linting across diverse projects
16+
</Accordion>
1217

13-
Our solution treating DOM as one of many supported targets rather than the default assumption. This paradigm shift enables:
18+
<Accordion title="What's included?">
19+
Currently, it includes the following:
1420

15-
- **Context-aware linting**: Adapting to different runtime environments
16-
- **Future-proof architecture**: Compatibility with emerging React platforms
17-
- **Unified code quality standards**: Consistent linting across diverse projects
21+
**Internal Packages**
1822

19-
</Accordion>
23+
- **Utility Modules**
24+
- `@eslint-react/eff`: JavaScript and TypeScript utilities (previously some re-exports of the `effect` library).
25+
- `@eslint-react/ast`: TSESTree AST utility module.
26+
- `@eslint-react/var`: TSESTree AST utility module for static analysis of variables.
27+
- `@eslint-react/kit`: ESLint React's plugin kit for building plugins and rules.
28+
- **Core & Shared Modules**
29+
- `@eslint-react/core`: Utility module for static analysis of React core APIs and patterns.
30+
- `@eslint-react/shared`: Shared constants, types and functions.
2031

21-
<Accordion title="What's included?">
32+
**Public Packages**
2233

23-
Currently, it includes the following:
34+
- **ESLint Plugins**
35+
- [`eslint-plugin-react-x`](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-x) - Core React rules.
36+
- [`eslint-plugin-react-dom`](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-dom) - React DOM rules.
37+
- [`eslint-plugin-react-web-api`](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-web-api) - Web API interaction rules.
38+
- [`eslint-plugin-react-naming-convention`](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-naming-convention) - Naming convention rules.
39+
- [`eslint-plugin-react-debug`](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-debug) - Debugging rules for inspecting React patterns in code.
40+
- [`@eslint-react/eslint-plugin`](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin) - A unified plugin that combines all individual plugins into one.
2441

25-
**Internal Packages**
42+
**Website & Playground**
2643

27-
- **Utility Modules**
28-
- `@eslint-react/eff`: JavaScript and TypeScript utilities (previously some re-exports of the `effect` library).
29-
- `@eslint-react/ast`: TSESTree AST utility module.
30-
- `@eslint-react/var`: TSESTree AST utility module for static analysis of variables.
31-
- `@eslint-react/kit`: ESLint React's plugin kit for building plugins and rules.
32-
- **Core & Shared Modules**
33-
- `@eslint-react/core`: Utility module for static analysis of React core APIs and patterns.
34-
- `@eslint-react/shared`: Shared constants, types and functions.
44+
- `website`: This documentation website.
45+
- `playground`: The playground for ESLint React (WIP).
3546

36-
**Public Packages**
47+
You can view our long-term plans on the [roadmap](/roadmap#plugins-with-ecological-niche-explanation).
48+
</Accordion>
3749

38-
- **ESLint Plugins**
39-
- [`eslint-plugin-react-x`](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-x) - Core React rules.
40-
- [`eslint-plugin-react-dom`](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-dom) - React DOM rules.
41-
- [`eslint-plugin-react-web-api`](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-web-api) - Web API interaction rules.
42-
- [`eslint-plugin-react-naming-convention`](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-naming-convention) - Naming convention rules.
43-
- [`eslint-plugin-react-debug`](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-debug) - Debugging rules for inspecting React patterns in code.
44-
- [`@eslint-react/eslint-plugin`](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin) - A unified plugin that combines all individual plugins into one.
50+
<Accordion title="Why isn't there a 'jsx-runtime' preset?">
51+
ESLint React automatically detects your JSX runtime type from the compiler options in your `tsconfig.json` or `jsconfig.json` file, as well as from JSX pragma comments (e.g., `/** @jsxRuntime automatic */`) in each file. This means you don't need to set a preset for the JSX runtime.
4552

46-
**Website & Playground**
53+
For more information, see the [JSX Transform](/docs/configuration/configure-project-config#jsx-transform) section on the [Configure Project Config](/docs/configuration/configure-project-config) page.
54+
</Accordion>
4755

48-
- `website`: This documentation website.
49-
- `playground`: The playground for ESLint React (WIP).
56+
<Accordion title="Is there anything to note about migrating from 'eslint-plugin-react'?">
57+
Please be aware that some rules may behave differently when transitioning to ESLint React. The rules in ESLint React are more closely aligned with the guidelines provided by [react.dev](https://react.dev). This alignment is due to ESLint React adopting [react.dev](https://react.dev) as its primary reference, rather than `eslint-plugin-react`.
5058

51-
You can view our long-term plans on the [roadmap](/roadmap#plugins-with-ecological-niche-explanation).
52-
53-
</Accordion>
54-
55-
<Accordion title="Why isn't there a 'jsx-runtime' preset?">
56-
57-
ESLint React automatically detects your JSX runtime type from the compiler options in your `tsconfig.json` or `jsconfig.json` file, as well as from JSX pragma comments (e.g., `/** @jsxRuntime automatic */`) in each file. This means you don't need to set a preset for the JSX runtime.
58-
59-
For more information, see the [JSX Transform](/docs/configuration/configure-project-config#jsx-transform) section on the [Configure Project Config](/docs/configuration/configure-project-config) page.
60-
61-
</Accordion>
62-
63-
<Accordion title="Is there anything to note about migrating from 'eslint-plugin-react'?">
64-
65-
Please be aware that some rules may behave differently when transitioning to ESLint React. The rules in ESLint React are more closely aligned with the guidelines provided by [react.dev](https://react.dev). This alignment is due to ESLint React adopting [react.dev](https://react.dev) as its primary reference, rather than `eslint-plugin-react`.
66-
67-
For a comprehensive migration guide with a complete rule comparison table, see our [Migration Guide](/docs/migration). This guide covers all rules from `eslint-plugin-react`, their ESLint React equivalents, missing functionality, and migration tips.
68-
69-
To smoothly transition, we suggest reviewing the rules in ESLint React and running a comprehensive linting check on your codebase to identify and address any discrepancies introduced by the migration.
70-
71-
</Accordion>
59+
For a comprehensive migration guide with a complete rule comparison table, see our [Migration Guide](/docs/migration). This guide covers all rules from `eslint-plugin-react`, their ESLint React equivalents, missing functionality, and migration tips.
7260

61+
To smoothly transition, we suggest reviewing the rules in ESLint React and running a comprehensive linting check on your codebase to identify and address any discrepancies introduced by the migration.
62+
</Accordion>
7363
</Accordions>

apps/website/content/docs/getting-started/javascript.mdx

Lines changed: 80 additions & 92 deletions
Original file line numberDiff line numberDiff line change
@@ -6,106 +6,94 @@ description: Getting started using ESLint React in your JavaScript React project
66
import { Step, Steps } from "fumadocs-ui/components/steps";
77

88
<Callout type="info" title="This instruction requires the following minimum versions:">
9-
10-
- Node.js: 20.19.0
11-
- ESLint: 9.24.0
12-
- TypeScript: 4.9.5
13-
9+
- Node.js: 20.19.0
10+
- ESLint: 9.24.0
11+
- TypeScript: 4.9.5
1412
</Callout>
1513

1614
<Steps>
15+
<Step>
16+
## Installation
17+
18+
```package-install copy
19+
npm install --save-dev globals eslint @eslint/js @eslint-react/eslint-plugin
20+
```
21+
</Step>
22+
23+
<Step>
24+
## Configure ESLint
25+
26+
```js title="eslint.config.js"
27+
import globals from "globals";
28+
import eslintJs from "@eslint/js";
29+
import eslintReact from "@eslint-react/eslint-plugin";
30+
import { defineConfig } from "eslint/config";
31+
32+
export default defineConfig([
33+
{
34+
files: ["**/*.js", "**/*.jsx"],
35+
36+
// Extend recommended rule sets from:
37+
// 1. ESLint JS's recommended rules
38+
// 2. ESLint React's recommended rules
39+
extends: [eslintJs.configs.recommended, eslintReact.configs.recommended],
40+
41+
// Configure language/parsing options
42+
languageOptions: {
43+
// Include browser global variables (window, document, etc.)
44+
globals: {
45+
...globals.browser,
46+
},
47+
parserOptions: {
48+
ecmaFeatures: {
49+
jsx: true, // Enable JSX syntax support
50+
},
51+
},
52+
},
1753

18-
<Step>
19-
20-
## Installation
21-
22-
```package-install copy
23-
npm install --save-dev globals eslint @eslint/js @eslint-react/eslint-plugin
24-
```
25-
26-
</Step>
27-
28-
<Step>
29-
30-
## Configure ESLint
31-
32-
```js title="eslint.config.js"
33-
import globals from "globals";
34-
import eslintJs from "@eslint/js";
35-
import eslintReact from "@eslint-react/eslint-plugin";
36-
import { defineConfig } from "eslint/config";
37-
38-
export default defineConfig([
39-
{
40-
files: ["**/*.js", "**/*.jsx"],
41-
42-
// Extend recommended rule sets from:
43-
// 1. ESLint JS's recommended rules
44-
// 2. ESLint React's recommended rules
45-
extends: [eslintJs.configs.recommended, eslintReact.configs.recommended],
46-
47-
// Configure language/parsing options
48-
languageOptions: {
49-
// Include browser global variables (window, document, etc.)
50-
globals: {
51-
...globals.browser,
54+
// Custom rule overrides (modify rule levels or disable rules)
55+
rules: {
56+
"@eslint-react/no-missing-key": "warn",
57+
},
5258
},
53-
parserOptions: {
54-
ecmaFeatures: {
55-
jsx: true, // Enable JSX syntax support
59+
]);
60+
```
61+
</Step>
62+
63+
<Step>
64+
## Configure [Project Config](/docs/glossary#project-config) (Optional)
65+
66+
```ts title="eslint.config.js"
67+
// @ts-check
68+
import tseslint from "typescript-eslint";
69+
70+
export default [
71+
{
72+
languageOptions: {
73+
parser: tseslint.parser,
74+
parserOptions: {
75+
projectService: true,
76+
tsconfigRootDir: import.meta.dirname,
77+
},
5678
},
5779
},
58-
},
59-
60-
// Custom rule overrides (modify rule levels or disable rules)
61-
rules: {
62-
"@eslint-react/no-missing-key": "warn",
63-
},
64-
},
65-
]);
66-
```
67-
68-
</Step>
69-
70-
<Step>
71-
72-
## Configure [Project Config](/docs/glossary#project-config) (Optional)
73-
74-
```ts title="eslint.config.js"
75-
// @ts-check
76-
import tseslint from "typescript-eslint";
77-
78-
export default [
79-
{
80-
languageOptions: {
81-
parser: tseslint.parser,
82-
parserOptions: {
83-
projectService: true,
84-
tsconfigRootDir: import.meta.dirname,
80+
];
81+
```
82+
83+
```jsonc title="jsconfig.json"
84+
{
85+
"compilerOptions": {
86+
// ...other options
87+
"jsx": "react-jsx"
8588
},
86-
},
87-
},
88-
];
89-
```
90-
91-
```jsonc title="jsconfig.json"
92-
{
93-
"compilerOptions": {
94-
// ...other options
95-
"jsx": "react-jsx"
96-
},
97-
"include": ["**/*.js", "**/*.jsx"]
98-
}
99-
```
100-
101-
<Callout title="TIP">
102-
103-
Once you've correctly configured the project for the files to be linted, ESLint React utilizes the information from the TypeScript compiler to provide better linting results.
104-
105-
For more information, see the [Configure Project Config](/docs/configuration/configure-project-config) section.
106-
107-
</Callout>
89+
"include": ["**/*.js", "**/*.jsx"]
90+
}
91+
```
10892

109-
</Step>
93+
<Callout title="TIP">
94+
Once you've correctly configured the project for the files to be linted, ESLint React utilizes the information from the TypeScript compiler to provide better linting results.
11095

96+
For more information, see the [Configure Project Config](/docs/configuration/configure-project-config) section.
97+
</Callout>
98+
</Step>
11199
</Steps>

0 commit comments

Comments
 (0)