Skip to content

Commit e2ecca6

Browse files
authored
chore: fix issues introduced by updated nx configuration (#11230)
1 parent f9bd7d8 commit e2ecca6

File tree

30 files changed

+393
-302
lines changed

30 files changed

+393
-302
lines changed

.prettierignore

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,5 @@ CHANGELOG.md
3434
packages/website/.docusaurus
3535
packages/website/build
3636

37-
# see the file header in eslint-base.test.js for more info
38-
packages/rule-tester/tests/eslint-base
39-
4037
/.nx/cache
4138
/.nx/workspace-data

eslint.config.mjs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,6 @@ export default tseslint.config(
8383
'packages/types/src/generated/**/*.ts',
8484
// Playground types downloaded from the web
8585
'packages/website/src/vendor/',
86-
// see the file header in eslint-base.test.js for more info
87-
'packages/rule-tester/tests/eslint-base/',
8886
],
8987
name: 'global-ignores',
9088
},

knip.ts

Lines changed: 28 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -54,35 +54,40 @@ export default {
5454
],
5555
},
5656
},
57+
5758
'packages/eslint-plugin': {
58-
entry: ['tools/**'],
59-
ignore: [
60-
'tests/fixtures/**',
61-
'typings/eslint-rules.d.ts',
62-
'typings/typescript.d.ts',
63-
],
64-
ignoreDependencies: ['tsx'], // used in nx target definitions
59+
ignore: ['typings/eslint-rules.d.ts', 'typings/typescript.d.ts'],
60+
61+
project: ['src/**/*.ts!', 'tools/**/*.mts'],
62+
63+
vitest: {
64+
config: ['vitest.config.mts'],
65+
entry: ['tests/**/*.{bench,test,test-d}.?(c|m)ts?(x)'],
66+
project: ['tests/**', '!tests/fixtures/**'],
67+
},
6568
},
69+
6670
'packages/eslint-plugin-internal': {
6771
ignore: ['tests/fixtures/**'],
6872
},
6973
'packages/integration-tests': {
7074
ignore: ['fixtures/**'],
7175
},
72-
'packages/parser': {
73-
ignore: ['tests/fixtures/**'],
7476

77+
'packages/parser': {
7578
vitest: {
7679
config: ['vitest.config.mts'],
77-
entry: ['tests/lib/**/*.{bench,test,test-d}.?(c|m)ts?(x)'],
80+
entry: [
81+
'tests/lib/**/*.{bench,test,test-d}.?(c|m)ts?(x)',
82+
'tests/test-utils/test-utils.ts',
83+
'tests/test-utils/ts-error-serializer.ts',
84+
],
85+
project: ['tests/**', '!tests/fixtures/**'],
7886
},
7987
},
88+
8089
'packages/rule-tester': {
8190
ignore: ['typings/eslint.d.ts'],
82-
83-
mocha: {
84-
entry: ['tests/eslint-base/eslint-base.test.js'],
85-
},
8691
},
8792
'packages/scope-manager': {
8893
ignore: ['tests/fixtures/**'],
@@ -109,6 +114,15 @@ export default {
109114
],
110115
},
111116
},
117+
118+
'packages/types': {
119+
project: [
120+
'src/**/*.ts!',
121+
'!src/generated/**/*.ts',
122+
'tools/copy-ast-spec.mts',
123+
],
124+
},
125+
112126
'packages/typescript-estree': {
113127
entry: ['src/use-at-your-own-risk.ts'],
114128
ignore: ['tests/fixtures/**', 'typings/typescript.d.ts'],

nx.json

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,8 @@
1919
"plugin": "@nx/vite/plugin",
2020
"exclude": ["*"],
2121
"options": {
22-
"testTargetName": "test"
23-
}
24-
},
25-
{
26-
"plugin": "@nx/eslint/plugin",
27-
"include": ["packages/*"],
28-
"options": {
29-
"targetName": "lint"
22+
"testTargetName": "test",
23+
"typecheckTargetName": "vite:typecheck"
3024
}
3125
}
3226
],
@@ -51,7 +45,20 @@
5145
}
5246
},
5347
"targetDefaults": {
48+
"lint": {
49+
"cache": false,
50+
"dependsOn": ["eslint-plugin-internal:build", "typescript-eslint:build"],
51+
"options": {
52+
"cwd": "{workspaceRoot}",
53+
"config": "{workspaceRoot}/eslint.config.mjs",
54+
"args": ["{projectRoot}"]
55+
}
56+
},
5457
"test": {
58+
"dependsOn": ["^build"],
59+
"options": {
60+
"config": "vitest.config.mts"
61+
},
5562
"outputs": ["{projectRoot}/coverage"]
5663
}
5764
},

package.json

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@
5555
"@eslint/eslintrc": "^3.2.0",
5656
"@eslint/js": "^9.26.0",
5757
"@nx/devkit": "21.0.3",
58-
"@nx/eslint": "21.0.3",
5958
"@nx/js": "21.0.3",
6059
"@nx/vite": "21.0.3",
6160
"@nx/workspace": "21.0.3",
@@ -149,11 +148,11 @@
149148
"cache": true
150149
},
151150
"lint": {
152-
"command": "eslint . --ignore-pattern=packages --cache",
153-
"dependsOn": [
154-
"typescript-eslint:build",
155-
"eslint-plugin-internal:build"
156-
],
151+
"command": "eslint",
152+
"options": {
153+
"cache": true,
154+
"ignore-pattern": "packages"
155+
},
157156
"cache": false
158157
},
159158
"clean": {

packages/ast-spec/package.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
"main": "dist/index.js",
3232
"types": "dist/index.d.ts",
3333
"scripts": {
34-
"//": "These package scripts are mostly here for convenience. Task running is handled by Nx at the root level.",
3534
"build": "yarn run -BT nx build",
3635
"clean": "rimraf dist/ coverage/",
3736
"clean-fixtures": "rimraf -g \"./src/**/fixtures/**/snapshots\"",
@@ -82,7 +81,14 @@
8281
],
8382
"cache": true
8483
},
84+
"lint": {
85+
"command": "eslint"
86+
},
8587
"typecheck": {
88+
"outputs": [
89+
"{workspaceRoot}/dist",
90+
"{projectRoot}/dist"
91+
],
8692
"dependsOn": [
8793
"typescript-estree:build"
8894
]

packages/ast-spec/tests/util/serialize-error.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import type { ParseError as BabelParseError } from '@babel/parser';
2+
23
import { codeFrameColumns } from '@babel/code-frame';
34

45
import { TSError } from './parsers/typescript-estree-import';

packages/ast-spec/vitest.config.mts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,11 @@ const vitestConfig = mergeConfig(
1919
'./tests/util/setupVitest.mts',
2020
'./tests/util/custom-matchers/custom-matchers.ts',
2121
],
22+
23+
typecheck: {
24+
enabled: true,
25+
tsconfig: path.join(import.meta.dirname, 'tsconfig.spec.json'),
26+
},
2227
},
2328
}),
2429
);

packages/eslint-plugin-internal/package.json

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
"homepage": "https://typescript-eslint.io",
1515
"license": "MIT",
1616
"scripts": {
17-
"//": "These package scripts are mostly here for convenience. Task running is handled by Nx at the root level.",
1817
"build": "yarn run -BT nx build",
1918
"clean": "rimraf dist/ coverage/",
2019
"format": "yarn run -T format",
@@ -28,17 +27,23 @@
2827
"@typescript-eslint/scope-manager": "workspace:*",
2928
"@typescript-eslint/type-utils": "workspace:*",
3029
"@typescript-eslint/utils": "workspace:*",
31-
"prettier": "^3.2.5"
30+
"prettier": "3.5.0"
3231
},
3332
"devDependencies": {
3433
"@vitest/coverage-v8": "^3.1.3",
34+
"eslint": "*",
3535
"rimraf": "*",
3636
"vitest": "^3.1.3"
3737
},
3838
"nx": {
3939
"name": "eslint-plugin-internal",
4040
"includedScripts": [
4141
"clean"
42-
]
42+
],
43+
"targets": {
44+
"lint": {
45+
"command": "eslint"
46+
}
47+
}
4348
}
4449
}

packages/eslint-plugin/package.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,11 @@
4848
"typescript"
4949
],
5050
"scripts": {
51-
"//": "These package scripts are mostly here for convenience. Task running is handled by Nx at the root level.",
5251
"build": "yarn run -BT nx build",
5352
"clean": "rimraf dist/ coverage/",
5453
"format": "yarn run -T format",
5554
"generate-breaking-changes": "yarn run -BT nx generate-breaking-changes",
56-
"generate-configs": "yarn run -T generate-configs",
55+
"generate-configs": "yarn run -BT nx generate-configs repo",
5756
"lint": "yarn run -BT nx lint",
5857
"test": "yarn run -BT nx test",
5958
"typecheck": "yarn run -BT nx typecheck"
@@ -84,6 +83,7 @@
8483
"mdast-util-from-markdown": "^2.0.0",
8584
"mdast-util-mdx": "^3.0.0",
8685
"micromark-extension-mdxjs": "^3.0.0",
86+
"prettier": "3.5.0",
8787
"rimraf": "*",
8888
"title-case": "^4.0.0",
8989
"tsx": "*",
@@ -114,6 +114,9 @@
114114
"dependsOn": [
115115
"type-utils:build"
116116
]
117+
},
118+
"lint": {
119+
"command": "eslint"
117120
}
118121
}
119122
}

packages/integration-tests/package.json

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,33 @@
1212
"homepage": "https://typescript-eslint.io",
1313
"license": "MIT",
1414
"scripts": {
15-
"//": "These package scripts are mostly here for convenience. Task running is handled by Nx at the root level.",
1615
"format": "yarn run -T format",
1716
"lint": "yarn run -BT nx lint",
1817
"test": "yarn run -BT nx test",
1918
"typecheck": "yarn run -BT nx typecheck"
2019
},
2120
"devDependencies": {
2221
"@vitest/coverage-v8": "^3.1.3",
22+
"eslint": "*",
2323
"vitest": "^3.1.3"
2424
},
2525
"nx": {
2626
"name": "integration-tests",
27-
"includedScripts": []
27+
"includedScripts": [],
28+
"targets": {
29+
"test": {
30+
"dependsOn": [
31+
{
32+
"projects": [
33+
"tag:npm:public"
34+
],
35+
"target": "build"
36+
}
37+
]
38+
},
39+
"lint": {
40+
"command": "eslint"
41+
}
42+
}
2843
}
2944
}

packages/integration-tests/tests/__snapshots__/vue-sfc.test.ts.snap

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -68,20 +68,20 @@ export default Vue.extend({
6868
{
6969
"message": "ESLint Stylistic now maintains deprecated stylistic core rules.",
7070
"plugin": {
71-
"name": "@stylistic/eslint-plugin-js",
72-
"url": "https://eslint.style/packages/js",
71+
"name": "@stylistic/eslint-plugin",
72+
"url": "https://eslint.style",
7373
},
7474
"rule": {
7575
"name": "semi-spacing",
76-
"url": "https://eslint.style/rules/js/semi-spacing",
76+
"url": "https://eslint.style/rules/semi-spacing",
7777
},
7878
"url": "https://eslint.style/guide/migration",
7979
},
8080
],
8181
"url": "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
8282
},
8383
"replacedBy": [
84-
"@stylistic/js/semi-spacing",
84+
"@stylistic/semi-spacing",
8585
],
8686
"ruleId": "semi-spacing",
8787
},
@@ -130,20 +130,20 @@ export default class Utility {
130130
{
131131
"message": "ESLint Stylistic now maintains deprecated stylistic core rules.",
132132
"plugin": {
133-
"name": "@stylistic/eslint-plugin-js",
134-
"url": "https://eslint.style/packages/js",
133+
"name": "@stylistic/eslint-plugin",
134+
"url": "https://eslint.style",
135135
},
136136
"rule": {
137137
"name": "semi-spacing",
138-
"url": "https://eslint.style/rules/js/semi-spacing",
138+
"url": "https://eslint.style/rules/semi-spacing",
139139
},
140140
"url": "https://eslint.style/guide/migration",
141141
},
142142
],
143143
"url": "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
144144
},
145145
"replacedBy": [
146-
"@stylistic/js/semi-spacing",
146+
"@stylistic/semi-spacing",
147147
],
148148
"ruleId": "semi-spacing",
149149
},
@@ -209,20 +209,20 @@ export default Vue.extend({
209209
{
210210
"message": "ESLint Stylistic now maintains deprecated stylistic core rules.",
211211
"plugin": {
212-
"name": "@stylistic/eslint-plugin-js",
213-
"url": "https://eslint.style/packages/js",
212+
"name": "@stylistic/eslint-plugin",
213+
"url": "https://eslint.style",
214214
},
215215
"rule": {
216216
"name": "semi-spacing",
217-
"url": "https://eslint.style/rules/js/semi-spacing",
217+
"url": "https://eslint.style/rules/semi-spacing",
218218
},
219219
"url": "https://eslint.style/guide/migration",
220220
},
221221
],
222222
"url": "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
223223
},
224224
"replacedBy": [
225-
"@stylistic/js/semi-spacing",
225+
"@stylistic/semi-spacing",
226226
],
227227
"ruleId": "semi-spacing",
228228
},

packages/integration-tests/tools/integration-test-base.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,14 +74,15 @@ export function eslintIntegrationTest(
7474
`"filePath": "<root>/${path.relative(testFolder, testFile)}"`,
7575
)
7676
.replaceAll(/C:\\\\(usr)\\\\(linked)\\\\(tsconfig.json)/g, '/$1/$2/$3');
77+
let lintOutput: unknown;
7778
try {
78-
const lintOutput = JSON.parse(lintOutputRAW);
79-
expect(lintOutput).toMatchSnapshot();
79+
lintOutput = JSON.parse(lintOutputRAW);
8080
} catch {
8181
throw new Error(
8282
`Lint output could not be parsed as JSON: \`${lintOutputRAW}\`.`,
8383
);
8484
}
85+
expect(lintOutput).toMatchSnapshot();
8586
});
8687
}
8788

0 commit comments

Comments
 (0)