Skip to content

Commit b8770df

Browse files
authored
build: update to eslint v9 (#651)
1 parent 8a49264 commit b8770df

File tree

11 files changed

+447
-1219
lines changed

11 files changed

+447
-1219
lines changed

.eslintignore

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

.eslintrc.json

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

eslint.config.js

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

nx.json

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,33 @@
11
{
2-
"targetDependencies": {
3-
"build": [{ "target": "build", "projects": "dependencies" }]
4-
},
2+
"$schema": "./node_modules/nx/schemas/nx-schema.json",
53
"namedInputs": {
64
"default": ["{projectRoot}/**/*", "sharedGlobals"],
7-
"sharedGlobals": [],
85
"production": [
96
"default",
7+
"!{projectRoot}/.eslintrc.json",
8+
"!{projectRoot}/eslint.config.js",
109
"!{projectRoot}/**/?(*.)+(spec|test).[jt]s?(x)?(.snap)",
1110
"!{projectRoot}/tsconfig.spec.json",
1211
"!{projectRoot}/jest.config.[jt]s",
13-
"!{projectRoot}/.eslintrc.json",
14-
"!{projectRoot}/src/test-setup.[jt]s"
15-
]
12+
"!{projectRoot}/src/test-setup.[jt]s",
13+
"!{projectRoot}/test-setup.[jt]s"
14+
],
15+
"sharedGlobals": []
1616
},
1717
"targetDefaults": {
18-
"build": {
19-
"inputs": ["production", "^production"],
20-
"cache": true
18+
"@nx/js:tsc": {
19+
"cache": true,
20+
"dependsOn": ["^build"],
21+
"inputs": ["production", "^production"]
22+
},
23+
"@nx/eslint:lint": {
24+
"cache": true,
25+
"inputs": [
26+
"default",
27+
"{workspaceRoot}/.eslintrc.json",
28+
"{workspaceRoot}/.eslintignore",
29+
"{workspaceRoot}/eslint.config.js"
30+
]
2131
},
2232
"@nx/jest:jest": {
2333
"cache": true,
@@ -31,13 +41,8 @@
3141
"codeCoverage": true
3242
}
3343
}
34-
},
35-
"@nx/eslint:lint": {
36-
"inputs": ["default", "{workspaceRoot}/.eslintrc.json"],
37-
"cache": true
3844
}
3945
},
40-
"useInferencePlugins": false,
4146
"defaultBase": "main",
4247
"useLegacyCache": true
4348
}

0 commit comments

Comments
 (0)