Skip to content

Commit 1d46be7

Browse files
committed
docs: update installation and configuration sections for JavaScript and TypeScript
1 parent 996e959 commit 1d46be7

File tree

2 files changed

+40
-8
lines changed

2 files changed

+40
-8
lines changed

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

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@ description: Getting started with JavaScript setup
1111

1212
</Callout>
1313

14-
## Install
14+
## Installation
1515

1616
```package-install copy
1717
npm install --save-dev globals eslint @eslint/js @eslint-react/eslint-plugin
1818
```
1919

20-
## Setup
20+
## Configure ESLint
2121

2222
```js title="eslint.config.js"
2323
import globals from "globals";
@@ -28,24 +28,39 @@ import { defineConfig } from "eslint/config";
2828
export default defineConfig([
2929
{
3030
files: ["**/*.js", "**/*.jsx"],
31+
32+
// Extend recommended rule sets from:
33+
// 1. ESLint JS's recommended rules
34+
// 2. ESLint React's recommended rules
3135
extends: [
3236
eslintJs.configs.recommended,
3337
eslintReact.configs.recommended,
3438
],
39+
40+
// Configure language/parsing options
3541
languageOptions: {
42+
// Include browser global variables (window, document, etc.)
3643
globals: {
3744
...globals.browser
38-
}
45+
},
3946
parserOptions: {
4047
ecmaFeatures: {
41-
jsx: true,
48+
jsx: true, // Enable JSX syntax support
4249
},
4350
},
4451
},
52+
53+
// Custom rule overrides (modify rule levels or disable rules)
4554
rules: {
46-
// Put rules you want to override here
55+
// Example: Show warning for non-shorthand boolean attributes
4756
"@eslint-react/prefer-shorthand-boolean": "warn",
4857
},
4958
},
5059
]);
5160
```
61+
62+
## Resources
63+
64+
- [Configure ESLint](https://eslint.org/docs/latest/use/configure/)
65+
- [VS Code ESLint extension](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint)
66+
- [WebStorm ESLint integration](https://www.jetbrains.com/help/webstorm/eslint.html)

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

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@ description: Getting started with TypeScript setup
1111

1212
</Callout>
1313

14-
## Install
14+
## Installation
1515

1616
```package-install copy
1717
npm install --save-dev typescript-eslint @eslint-react/eslint-plugin
1818
```
1919

20-
## Setup
20+
## Configure ESLint
2121

2222
```js title="eslint.config.js"
2323
// @ts-check
@@ -27,20 +27,37 @@ import tseslint from "typescript-eslint";
2727

2828
export default tseslint.config({
2929
files: ["**/*.ts", "**/*.tsx"],
30+
31+
// Extend recommended rule sets from:
32+
// 1. ESLint JS's recommended rules
33+
// 2. TypeScript ESLint recommended rules
34+
// 3. ESLint React's recommended-typescript rules
3035
extends: [
3136
eslintJs.configs.recommended,
3237
tseslint.configs.recommended,
3338
eslintReact.configs["recommended-typescript"],
3439
],
40+
41+
// Configure language/parsing options
3542
languageOptions: {
43+
// Use TypeScript ESLint parser for TypeScript files
3644
parser: tseslint.parser,
3745
parserOptions: {
46+
// Enable project service for better TypeScript integration
3847
projectService: true,
3948
},
4049
},
50+
51+
// Custom rule overrides (modify rule levels or disable rules)
4152
rules: {
42-
// Put rules you want to override here
53+
// Example: Show warning for non-shorthand boolean attributes
4354
"@eslint-react/prefer-shorthand-boolean": "warn",
4455
},
4556
});
4657
```
58+
59+
## Resources
60+
61+
- [Configure ESLint](https://eslint.org/docs/latest/use/configure/)
62+
- [VS Code ESLint extension](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint)
63+
- [WebStorm ESLint integration](https://www.jetbrains.com/help/webstorm/eslint.html)

0 commit comments

Comments
 (0)