Skip to content

Commit 29ac3a7

Browse files
committed
Convert to flat config
1 parent 872aa19 commit 29ac3a7

15 files changed

Lines changed: 359 additions & 303 deletions

File tree

.eslintignore

Lines changed: 0 additions & 1 deletion
This file was deleted.

.eslintrc.json

Lines changed: 0 additions & 40 deletions
This file was deleted.

eslint.config.cjs

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
const nx = require('@nx/eslint-plugin');
2+
3+
module.exports = [
4+
...nx.configs['flat/base'],
5+
...nx.configs['flat/typescript'],
6+
...nx.configs['flat/javascript'],
7+
{
8+
ignores: ['**/dist'],
9+
},
10+
{
11+
files: ['**/*.ts', '**/*.tsx', '**/*.js', '**/*.jsx'],
12+
rules: {
13+
'@nx/enforce-module-boundaries': [
14+
'error',
15+
{
16+
enforceBuildableLibDependency: true,
17+
allow: [],
18+
depConstraints: [
19+
{
20+
sourceTag: '*',
21+
onlyDependOnLibsWithTags: ['*'],
22+
},
23+
],
24+
},
25+
],
26+
},
27+
},
28+
{
29+
files: ['**/*.json'],
30+
languageOptions: {
31+
parser: require('jsonc-eslint-parser'),
32+
},
33+
rules: {},
34+
},
35+
];

nx.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010
"!{projectRoot}/tsconfig.spec.json",
1111
"!{projectRoot}/jest.config.[jt]s",
1212
"!{projectRoot}/.eslintrc.json",
13-
"!{projectRoot}/src/test-setup.[jt]s"
13+
"!{projectRoot}/src/test-setup.[jt]s",
14+
"!{projectRoot}/eslint.config.cjs"
1415
]
1516
},
1617
"targetDefaults": {
@@ -32,7 +33,7 @@
3233
}
3334
},
3435
"@nx/eslint:lint": {
35-
"inputs": ["default", "{workspaceRoot}/.eslintrc.json"],
36+
"inputs": ["default", "{workspaceRoot}/.eslintrc.json", "{workspaceRoot}/eslint.config.cjs"],
3637
"cache": true
3738
}
3839
},

package.json

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,7 @@
2727
"@types/jest": "29.5.14",
2828
"@types/node": "22.10.5",
2929
"@types/semver": "7.5.6",
30-
"@typescript-eslint/eslint-plugin": "7.18.0",
31-
"@typescript-eslint/parser": "7.18.0",
32-
"eslint": "8.57.1",
30+
"eslint": "9.37.0",
3331
"eslint-config-prettier": "9.1.0",
3432
"graphql": "16.10.0",
3533
"jest": "29.7.0",
@@ -39,7 +37,8 @@
3937
"semver": "7.6.3",
4038
"ts-jest": "29.1.1",
4139
"ts-node": "10.9.1",
42-
"typescript": "5.6.3"
40+
"typescript": "5.6.3",
41+
"typescript-eslint": "8.46.1"
4342
},
4443
"workspaces": [
4544
"packages/**"

packages/eslint-plugin/.eslintrc.json

Lines changed: 0 additions & 25 deletions
This file was deleted.
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
const baseConfig = require('../../eslint.config.cjs');
2+
3+
module.exports = [
4+
...baseConfig,
5+
{
6+
files: ['./package.json', './generators.json'],
7+
rules: {
8+
'@nx/nx-plugin-checks': 'error',
9+
},
10+
languageOptions: {
11+
parser: require('jsonc-eslint-parser'),
12+
},
13+
},
14+
{
15+
ignores: ['**/out-tsc'],
16+
},
17+
];

packages/eslint-plugin/project.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"$schema": "../../node_modules/nx/schemas/project-schema.json",
44
"sourceRoot": "packages/eslint-plugin/src",
55
"projectType": "library",
6+
"tags": [],
67
"targets": {
78
"build": {
89
"executor": "@nx/js:tsc",
@@ -18,6 +19,5 @@
1819
"executor": "@nx/eslint:lint",
1920
"outputs": ["{options.outputFile}"]
2021
}
21-
},
22-
"tags": []
22+
}
2323
}

packages/nx-dev-tools/.eslintrc.json

Lines changed: 0 additions & 25 deletions
This file was deleted.
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
const baseConfig = require('../../eslint.config.cjs');
2+
3+
module.exports = [
4+
...baseConfig,
5+
{
6+
files: ['./package.json', './generators.json'],
7+
rules: {
8+
'@nx/nx-plugin-checks': 'error',
9+
},
10+
languageOptions: {
11+
parser: require('jsonc-eslint-parser'),
12+
},
13+
},
14+
{
15+
ignores: ['**/out-tsc'],
16+
},
17+
];

0 commit comments

Comments
 (0)