Skip to content

Commit f3ef20e

Browse files
authored
chore: update to latest nx and use project references first approach (#10361)
1 parent faec1ca commit f3ef20e

115 files changed

Lines changed: 2472 additions & 1330 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.github/workflows/ci.yml‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,6 @@ jobs:
171171
'eslint-plugin-internal',
172172
'parser',
173173
'rule-tester',
174-
'rule-schema-to-typescript-types',
175174
'scope-manager',
176175
'type-utils',
177176
'typescript-eslint',

‎.nxignore‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
# see comment in the file
22
packages/ast-spec/tests/util/parsers/typescript-estree-import.ts
3+
packages/integration-tests/fixtures/**/*

‎eslint.config.js‎

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

‎eslint.config.mjs‎

Lines changed: 9 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
import { fixupConfigRules, fixupPluginRules } from '@eslint/compat';
44
import { FlatCompat } from '@eslint/eslintrc';
55
import eslint from '@eslint/js';
6+
import eslintCommentsPlugin from '@eslint-community/eslint-plugin-eslint-comments/configs';
67
import tseslintInternalPlugin from '@typescript-eslint/eslint-plugin-internal';
7-
import eslintCommentsPlugin from 'eslint-plugin-eslint-comments';
88
import eslintPluginPlugin from 'eslint-plugin-eslint-plugin';
99
import importPlugin from 'eslint-plugin-import';
1010
import jestPlugin from 'eslint-plugin-jest';
@@ -36,7 +36,6 @@ export default tseslint.config(
3636
plugins: {
3737
['@typescript-eslint']: tseslint.plugin,
3838
['@typescript-eslint/internal']: tseslintInternalPlugin,
39-
['eslint-comments']: eslintCommentsPlugin,
4039
['eslint-plugin']: eslintPluginPlugin,
4140
['import']: importPlugin,
4241
['jest']: jestPlugin,
@@ -46,6 +45,8 @@ export default tseslint.config(
4645
['perfectionist']: perfectionistPlugin,
4746
// https://github.com/facebook/react/issues/28313
4847
['react']: reactPlugin,
48+
// @ts-expect-error -- Temporary types incompatibility pending flat config support
49+
// https://github.com/facebook/react/pull/30774
4950
['react-hooks']: fixupPluginRules(reactHooksPlugin),
5051
['regexp']: regexpPlugin,
5152
['unicorn']: unicornPlugin,
@@ -88,6 +89,7 @@ export default tseslint.config(
8889
},
8990

9091
// extends ...
92+
eslintCommentsPlugin.recommended,
9193
eslint.configs.recommended,
9294
tseslint.configs.strictTypeChecked,
9395
tseslint.configs.stylisticTypeChecked,
@@ -252,35 +254,9 @@ export default tseslint.config(
252254
// eslint-plugin-eslint-comment
253255
//
254256

255-
// require a eslint-enable comment for every eslint-disable comment
256-
'eslint-comments/disable-enable-pair': [
257+
'@eslint-community/eslint-comments/disable-enable-pair': [
257258
'error',
258-
{
259-
allowWholeFile: true,
260-
},
261-
],
262-
// disallow a eslint-enable comment for multiple eslint-disable comments
263-
'eslint-comments/no-aggregating-enable': 'error',
264-
// disallow duplicate eslint-disable comments
265-
'eslint-comments/no-duplicate-disable': 'error',
266-
// disallow eslint-disable comments without rule names
267-
'eslint-comments/no-unlimited-disable': 'error',
268-
// disallow unused eslint-disable comments
269-
'eslint-comments/no-unused-disable': 'error',
270-
// disallow unused eslint-enable comments
271-
'eslint-comments/no-unused-enable': 'error',
272-
// disallow ESLint directive-comments
273-
'eslint-comments/no-use': [
274-
'error',
275-
{
276-
allow: [
277-
'eslint-disable',
278-
'eslint-disable-line',
279-
'eslint-disable-next-line',
280-
'eslint-enable',
281-
'global',
282-
],
283-
},
259+
{ allowWholeFile: true },
284260
],
285261

286262
//
@@ -574,8 +550,11 @@ export default tseslint.config(
574550
{
575551
extends: [
576552
jsxA11yPlugin.flatConfigs.recommended,
553+
// https://github.com/facebook/react/pull/30774
554+
// @ts-expect-error -- Temporary types incompatibility pending flat config support
577555
reactPlugin.configs.flat.recommended,
578556
// https://github.com/facebook/react/pull/30774
557+
// @ts-expect-error -- Temporary types incompatibility pending flat config support
579558
fixupConfigRules(compat.config(reactHooksPlugin.configs.recommended)),
580559
],
581560
files: ['packages/website/**/*.{ts,tsx,mts,cts,js,jsx}'],

‎knip.ts‎

Lines changed: 29 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,14 @@ export default {
1414
workspaces: {
1515
'.': {
1616
entry: ['tools/release/changelog-renderer.js', 'tools/scripts/**/*.mts'],
17+
ignore: ['tools/scripts/typings/typescript.d.ts', 'typings/*.d.ts'],
1718
ignoreDependencies: [
1819
'@babel/code-frame',
1920
'@babel/core',
2021
'@babel/eslint-parser',
2122
'@babel/parser',
2223
'@babel/types',
24+
'@nx/js',
2325
'@nx/workspace',
2426
'glob',
2527
'husky',
@@ -38,32 +40,44 @@ export default {
3840
// @typescript-eslint/typescript-estree is not listed in dependencies to avoid circular dependency errors
3941
// You can check a more detailed explanation in this file
4042
'tests/util/parsers/typescript-estree-import.ts',
43+
'typings/global.d.ts',
4144
],
4245
},
4346
'packages/eslint-plugin': {
44-
ignore: ['tests/fixtures/**'],
47+
ignore: [
48+
'tests/fixtures/**',
49+
'typings/eslint-rules.d.ts',
50+
'typings/typescript.d.ts',
51+
],
4552
},
4653
'packages/eslint-plugin-internal': {
4754
ignore: ['tests/fixtures/**'],
4855
},
4956
'packages/integration-tests': {
50-
ignore: ['fixtures/**'],
57+
ignore: ['fixtures/**', 'typings/global.d.ts'],
5158
},
5259
'packages/parser': {
5360
ignore: ['tests/fixtures/**'],
5461
},
62+
'packages/rule-tester': {
63+
ignore: ['typings/eslint.d.ts'],
64+
},
5565
'packages/scope-manager': {
5666
ignore: ['tests/fixtures/**'],
5767
},
5868
'packages/type-utils': {
59-
ignore: ['tests/fixtures/**'],
69+
ignore: ['tests/fixtures/**', 'typings/typescript.d.ts'],
6070
},
6171
'packages/typescript-estree': {
6272
entry: ['src/use-at-your-own-risk.ts'],
63-
ignore: ['tests/fixtures/**'],
73+
ignore: ['tests/fixtures/**', 'typings/typescript.d.ts'],
6474
},
6575
'packages/utils': {
66-
ignore: ['tests/**/*.type-test.ts'],
76+
ignore: [
77+
'tests/**/*.type-test.ts',
78+
'typings/eslint.d.ts',
79+
'typings/eslint-community-eslint-utils.d.ts',
80+
],
6781
},
6882
'packages/website': {
6983
entry: [
@@ -77,13 +91,22 @@ export default {
7791
'src/theme/**/*.tsx',
7892
'src/theme/prism-include-languages.js',
7993
],
94+
ignore: [
95+
'src/globals.d.ts',
96+
'src/hooks/*',
97+
'src/types.d.ts',
98+
'typings/*',
99+
],
80100
ignoreDependencies: [
81101
// used in MDX docs
82102
'raw-loader',
83103

84104
// it's imported only as type (esquery types are forked and defined in packages/website/typings/esquery.d.ts)
85105
'esquery',
86106

107+
// Referenced in webpack via the CopyPlugin
108+
'@typescript-eslint/website-eslint',
109+
87110
'@docusaurus/mdx-loader',
88111
'@docusaurus/types',
89112
'@docusaurus/plugin-content-docs',
@@ -97,6 +120,7 @@ export default {
97120
'@docusaurus/BrowserOnly',
98121
'@docusaurus/module-type-aliases',
99122
'@generated/docusaurus.config',
123+
'^@site/.*',
100124
'^@theme/.*',
101125
'^@theme-original/.*',
102126
'docusaurus-plugin-typedoc',

‎nx.json‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,21 @@
11
{
22
"$schema": "./node_modules/nx/schemas/nx-schema.json",
33
"nxCloudAccessToken": "YjIzMmMxMWItMjhiMS00NWY2LTk1NWYtYWU3YWQ0YjE4YjBlfHJlYWQ=",
4+
"plugins": [
5+
{
6+
"plugin": "@nx/js/typescript",
7+
"exclude": [".", "packages/integration-tests/fixtures/**"],
8+
"options": {
9+
"typecheck": {
10+
"targetName": "typecheck"
11+
},
12+
"build": {
13+
"targetName": "build",
14+
"configName": "tsconfig.build.json"
15+
}
16+
}
17+
}
18+
],
419
"release": {
520
"projects": [
621
"!repo",

‎package.json‎

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -58,19 +58,22 @@
5858
"@babel/eslint-parser": "^7.24.1",
5959
"@babel/parser": "^7.24.4",
6060
"@babel/types": "^7.24.0",
61-
"@eslint/compat": "^1.2.3",
61+
"@eslint-community/eslint-plugin-eslint-comments": "^4.4.1",
62+
"@eslint/compat": "^1.2.4",
6263
"@eslint/eslintrc": "^3.2.0",
6364
"@eslint/js": "^9.15.0",
6465
"@jest/types": "29.6.3",
65-
"@nx/devkit": "20.2.2",
66-
"@nx/eslint": "20.2.2",
67-
"@nx/jest": "20.2.2",
68-
"@nx/workspace": "20.2.2",
66+
"@nx/devkit": "20.4.5",
67+
"@nx/eslint": "20.4.5",
68+
"@nx/jest": "20.4.5",
69+
"@nx/workspace": "20.4.5",
6970
"@swc/core": "^1.4.12",
7071
"@swc/jest": "^0.2.36",
7172
"@types/babel__code-frame": "^7.0.6",
7273
"@types/babel__core": "^7.20.5",
7374
"@types/debug": "^4.1.12",
75+
"@types/eslint-plugin-jsx-a11y": "^6.10.0",
76+
"@types/eslint__eslintrc": "^2.1.2",
7477
"@types/is-glob": "^4.0.4",
7578
"@types/jest": "29.5.13",
7679
"@types/jest-specific-snapshot": "^0.5.9",
@@ -91,14 +94,13 @@
9194
"cspell": "^8.15.2",
9295
"downlevel-dts": ">=0.11.0",
9396
"eslint": "^9.15.0",
94-
"eslint-plugin-eslint-comments": "^3.2.0",
9597
"eslint-plugin-eslint-plugin": "^6.3.1",
9698
"eslint-plugin-import": "^2.31.0",
9799
"eslint-plugin-jest": "^28.9.0",
98100
"eslint-plugin-jsdoc": "^50.5.0",
99101
"eslint-plugin-jsx-a11y": "^6.10.2",
100102
"eslint-plugin-perfectionist": "^3.9.1",
101-
"eslint-plugin-react": "^7.37.2",
103+
"eslint-plugin-react": "^7.37.3",
102104
"eslint-plugin-react-hooks": "^5.0.0",
103105
"eslint-plugin-regexp": "^2.7.0",
104106
"eslint-plugin-unicorn": "^56.0.0",
@@ -108,12 +110,12 @@
108110
"husky": "^9.1.4",
109111
"jest": "29.7.0",
110112
"jest-specific-snapshot": "^8.0.0",
111-
"knip": "^5.9.4",
113+
"knip": "^5.41.1",
112114
"lint-staged": "^15.2.2",
113115
"make-dir": "^4.0.0",
114116
"markdownlint-cli": "^0.44.0",
115117
"ncp": "^2.0.0",
116-
"nx": "20.4.0",
118+
"nx": "20.4.5",
117119
"prettier": "3.5.0",
118120
"pretty-format": "^29.7.0",
119121
"rimraf": "^5.0.5",

‎packages/ast-spec/package.json‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
},
1414
"files": [
1515
"dist",
16+
"!*.tsbuildinfo",
1617
"package.json",
1718
"README.md",
1819
"LICENSE"
@@ -37,7 +38,7 @@
3738
"format": "prettier --write \"./**/*.{ts,mts,cts,tsx,js,mjs,cjs,jsx,json,md,css}\" --ignore-path ../../.prettierignore",
3839
"lint": "npx nx lint",
3940
"test": "jest",
40-
"typecheck": "tsc --noEmit"
41+
"check-types": "npx nx typecheck"
4142
},
4243
"funding": {
4344
"type": "opencollective",
@@ -49,6 +50,7 @@
4950
"@babel/eslint-parser": "*",
5051
"@jest/types": "29.6.3",
5152
"@microsoft/api-extractor": "^7.47.11",
53+
"@typescript-eslint/typescript-estree": "workspace:*",
5254
"glob": "*",
5355
"jest": "29.7.0",
5456
"jest-diff": "^29.7.0",

‎packages/ast-spec/project.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "ast-spec",
33
"$schema": "../../node_modules/nx/schemas/project-schema.json",
44
"type": "library",
5-
"implicitDependencies": [],
5+
"implicitDependencies": ["!typescript-estree"],
66
"targets": {
77
"build": {
88
"executor": "nx:run-commands",
Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,19 @@
11
{
22
"extends": "../../tsconfig.base.json",
33
"compilerOptions": {
4-
"composite": true,
5-
"jsx": "preserve",
6-
"outDir": "./dist",
7-
"rootDir": "./src",
8-
"resolveJsonModule": true
4+
"baseUrl": ".",
5+
"rootDir": "src",
6+
"outDir": "dist",
7+
"tsBuildInfoFile": "dist/tsconfig.build.tsbuildinfo",
8+
"emitDeclarationOnly": false,
9+
"types": ["node"]
910
},
10-
"include": ["src", "typings"],
11-
"exclude": ["**/fixtures/**"]
11+
"include": ["src/**/*.ts"],
12+
"exclude": [
13+
"jest.config.js",
14+
"src/**/*.spec.ts",
15+
"src/**/*.test.ts",
16+
"**/fixtures/**"
17+
],
18+
"references": []
1219
}

0 commit comments

Comments
 (0)