You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -52,6 +51,8 @@ Config for **Angular** projects.
52
51
);
53
52
```
54
53
54
+
4. Refer to [step 3 in TypeScript config's setup docs](./typescript.md#🏗️-setup) for how to set up tsconfig properly.
55
+
55
56
## 📏 Rules (425)
56
57
57
58
**345** rules are included from [`typescript` config](./typescript.md#📏-rules-345). For brevity, only the **80** additional rules are listed in this document.
3. The GraphQL ESLint plugin needs to know where your GraphQL schema is located. For more information, refer to [_Extended Linting Rules with GraphQL Schema_ in GraphQL ESLint docs](https://the-guild.dev/graphql/eslint/docs/getting-started#extended-linting-rules-with-graphql-schema).
4. The GraphQL ESLint plugin needs to know where your GraphQL schema is located. For more information, refer to [_Extended Linting Rules with GraphQL Schema_ in GraphQL ESLint docs](https://the-guild.dev/graphql/eslint/docs/getting-started#extended-linting-rules-with-graphql-schema).
15
24
- If you're using [graphql-config](https://the-guild.dev/graphql/config/docs), then your GraphQL schema will be loaded automatically from your `.graphqlrc.yml` (or equivalent) file. So no extra setup is required in this case.
16
25
- Otherwise, you can use [`parserOptions.schema`](https://the-guild.dev/graphql/eslint/docs/getting-started/parser-options#schema), e.g.:
17
26
@@ -30,14 +39,6 @@ Config for **GraphQL servers** implemented in Node.js.
30
39
}
31
40
);
32
41
```
33
-
4. Add to your `eslint.config.js` file:
34
-
35
-
```js
36
-
import graphql from '@code-pushup/eslint-config/graphql.js';
@@ -52,6 +51,8 @@ Config for **Angular** projects using **NgRx** library.
52
51
);
53
52
```
54
53
54
+
4. Refer to [step 3 in TypeScript config's setup docs](./typescript.md#🏗️-setup) for how to set up tsconfig properly.
55
+
55
56
## 📏 Rules (455)
56
57
57
58
**425** rules are included from [`angular` config](./angular.md#📏-rules-425). For brevity, only the **30** additional rules are listed in this document.
Copy file name to clipboardExpand all lines: docs/node.md
+30Lines changed: 30 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -20,6 +20,36 @@ Config for **Node.js** projects.
20
20
exportdefaulttseslint.config(...node);
21
21
```
22
22
23
+
4. Some rules (e.g. `n/no-unsupported-features/node-builtins`) need to know which Node version is being used. Configuration options include:
24
+
-`engines` field in `package.json`:
25
+
26
+
```jsonc
27
+
{
28
+
// ...
29
+
"engines": {
30
+
"node":">=22.12.0"
31
+
}
32
+
33
+
```
34
+
35
+
- `settings.node.version` in `eslint.config.js`:
36
+
37
+
```js
38
+
exportdefaulttseslint.config({
39
+
// ...
40
+
{
41
+
settings: {
42
+
node: {
43
+
version:'>=22.12.0'
44
+
}
45
+
}
46
+
}
47
+
});
48
+
49
+
```
50
+
51
+
For more information, refer to [`eslint-plugin-n` docs](https://github.com/eslint-community/eslint-plugin-n?tab=readme-ov-file#configured-nodejs-version-range).
52
+
23
53
## 📏 Rules (294)
24
54
25
55
**290** rules are included from [`javascript` config](./javascript.md#📏-rules-290). For brevity, only the **4** additional rules are listed in this document.
Copy file name to clipboardExpand all lines: docs/typescript.md
+10-9Lines changed: 10 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,16 @@ Config for strict **TypeScript** projects.
5
5
## 🏗️ Setup
6
6
7
7
1. If you haven't already, make sure to [install `@code-pushup/eslint-config` and its required peer dependencies](../README.md#🏗️-setup).
8
-
2. Because this config includes rules which require type information, make sure to configure `parserOptions.project` in your .eslintrc points to your project's tsconfig.
3. Because this config includes rules which require type information, make sure to configure `parserOptions.project` in your `eslint.config.js` points to your project's tsconfig.
9
18
For more information, refer to [_Linting with Type Information_ (typescript-eslint)](https://typescript-eslint.io/linting/typed-linting).
10
19
11
20
- Example for library in Nx monorepo:
@@ -54,14 +63,6 @@ Config for strict **TypeScript** projects.
54
63
}
55
64
);
56
65
```
57
-
3. Add to your `eslint.config.js` file:
58
-
59
-
```js
60
-
import typescript from '@code-pushup/eslint-config/typescript.js';
md`Because this config includes rules which require type information, make sure to configure ${md.code('parserOptions.project')} in your .eslintrc points to your project's tsconfig.
74
+
md`Because this config includes rules which require type information, make sure to configure ${md.code('parserOptions.project')} in your ${md.code('eslint.config.js')} points to your project's tsconfig.
75
75
For more information, refer to ${md.link('https://typescript-eslint.io/linting/typed-linting',md`${md.italic('Linting with Type Information')} (typescript-eslint)`)}.${md.list(
76
76
[
77
77
md`Example for library in Nx monorepo:${md.codeBlock(
node: md`Some rules (e.g. ${md.code('n/no-unsupported-features/node-builtins')}) need to know which Node version is being used. Configuration options include:${md.list(
126
+
[
127
+
md`${md.code('engines')} field in ${md.code('package.json')}: ${md.codeBlock(
128
+
'jsonc',
129
+
`{
130
+
// ...
131
+
"engines": {
132
+
"node": ">=22.12.0"
133
+
}
134
+
`,
135
+
)}`,
136
+
md`${md.code('settings.node.version')} in ${md.code('eslint.config.js')}: ${md.codeBlock(
137
+
'js',
138
+
`export default tseslint.config({
139
+
// ...
140
+
{
141
+
settings: {
142
+
node: {
143
+
version: '>=22.12.0'
144
+
}
145
+
}
146
+
}
147
+
});
148
+
`,
149
+
)}`,
150
+
],
151
+
)}${md.paragraph(md`For more information, refer to ${md.link('https://github.com/eslint-community/eslint-plugin-n?tab=readme-ov-file#configured-nodejs-version-range',md`${md.code('eslint-plugin-n')} docs`)}.`)}`,
152
+
125
153
graphql: md`The GraphQL ESLint plugin needs to know where your GraphQL schema is located. For more information, refer to ${md.link('https://the-guild.dev/graphql/eslint/docs/getting-started#extended-linting-rules-with-graphql-schema',md`${md.italic('Extended Linting Rules with GraphQL Schema')} in GraphQL ESLint docs`)}.${md.list(
126
154
[
127
155
md`If you're using ${md.link('https://the-guild.dev/graphql/config/docs','graphql-config')}, then your GraphQL schema will be loaded automatically from your ${md.code('.graphqlrc.yml')} (or equivalent) file. So no extra setup is required in this case.`,
0 commit comments