Skip to content

Commit 74a1677

Browse files
committed
docs: update language service integration docs
1 parent 473d339 commit 74a1677

File tree

2 files changed

+38
-4
lines changed

2 files changed

+38
-4
lines changed

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

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,24 @@ export default defineConfig([
7272

7373
<Step>
7474

75-
## Configure JavaScript (Optional)
75+
## Configure Language Service Integration (Optional)
76+
77+
```ts title="eslint.config.js"
78+
// @ts-check
79+
import tseslint from "typescript-eslint";
80+
81+
export default [
82+
{
83+
languageOptions: {
84+
parser: tseslint.parser,
85+
parserOptions: {
86+
projectService: true,
87+
tsconfigRootDir: import.meta.dirname,
88+
},
89+
},
90+
},
91+
];
92+
```
7693

7794
```jsonc title="jsconfig.json"
7895
{
@@ -86,7 +103,7 @@ export default defineConfig([
86103

87104
<Callout title="TIP">
88105

89-
Once you've correctly configured the [`project`](https://typescript-eslint.io/packages/parser/#project) or [`projectService`](https://typescript-eslint.io/packages/parser/#projectservice) options in [`parserOptions`](https://eslint.org/docs/latest/use/configure/language-options#specifying-parser-options) for the files to be analyzed, ESLint React utilizes the information within to make more accurate determinations.
106+
Once you've correctly configured the language service integration for the files to be linted, ESLint React utilizes the information from the TypeScript compiler to provide better linting results.
90107

91108
For more information, see the [Configure Language Config](/docs/configuration/configure-language-config) section.
92109

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

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,24 @@ export default tseslint.config({
6969

7070
<Step>
7171

72-
## Configure TypeScript (Optional)
72+
## Configure Language Service Integration (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,
85+
},
86+
},
87+
},
88+
];
89+
```
7390

7491
```jsonc title="tsconfig.json"
7592
{
@@ -83,7 +100,7 @@ export default tseslint.config({
83100

84101
<Callout title="TIP">
85102

86-
Once you've correctly configured the [`project`](https://typescript-eslint.io/packages/parser/#project) or [`projectService`](https://typescript-eslint.io/packages/parser/#projectservice) options in [`parserOptions`](https://eslint.org/docs/latest/use/configure/language-options#specifying-parser-options) for the files to be analyzed, ESLint React utilizes the information within to make more accurate determinations.
103+
Once you've correctly configured the language service integration for the files to be linted, ESLint React utilizes the information from the TypeScript compiler to provide better linting results.
87104

88105
For more information, see the [Configure Language Config](/docs/configuration/configure-language-config) section.
89106

0 commit comments

Comments
 (0)