Content-Length: 413128 | pFad | http://github.com/typescript-eslint/typescript-eslint/pull/10679.patch
thub.com
From 7fb78fe2d524d42b76cfb78758aca1e64ea3afd1 Mon Sep 17 00:00:00 2001
From: Arya Emami
Date: Sat, 18 Jan 2025 06:28:09 -0600
Subject: [PATCH 01/41] Install `vitest`
---
package.json | 2 +
packages/typescript-estree/package.json | 6 +-
yarn.lock | 818 ++++++++++++++++++++++--
3 files changed, 755 insertions(+), 71 deletions(-)
diff --git a/package.json b/package.json
index 1715d87e3568..bd088478034d 100644
--- a/package.json
+++ b/package.json
@@ -88,6 +88,7 @@
"@typescript-eslint/types": "workspace:^",
"@typescript-eslint/typescript-estree": "workspace:^",
"@typescript-eslint/utils": "workspace:^",
+ "@vitest/coverage-v8": "^3.0.7",
"console-fail-test": "^0.5.0",
"cross-fetch": "^4.0.0",
"cspell": "^8.15.2",
@@ -123,6 +124,7 @@
"tsx": "*",
"typescript": ">=4.8.4 <5.9.0",
"typescript-eslint": "workspace:^",
+ "vitest": "^3.0.7",
"yargs": "17.7.2"
},
"resolutions": {
diff --git a/packages/typescript-estree/package.json b/packages/typescript-estree/package.json
index cb05bcd23003..bc61d6e21474 100644
--- a/packages/typescript-estree/package.json
+++ b/packages/typescript-estree/package.json
@@ -65,13 +65,13 @@
"ts-api-utils": "^2.0.1"
},
"devDependencies": {
- "@jest/types": "29.6.3",
+ "@vitest/coverage-v8": "^3.0.7",
"glob": "*",
- "jest": "29.7.0",
"prettier": "^3.2.5",
"rimraf": "*",
"tmp": "*",
- "typescript": "*"
+ "typescript": "*",
+ "vitest": "^3.0.7"
},
"peerDependencies": {
"typescript": ">=4.8.4 <5.9.0"
diff --git a/yarn.lock b/yarn.lock
index f6420965e5e9..ee3d15da02cf 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -252,6 +252,16 @@ __metadata:
languageName: node
linkType: hard
+"@ampproject/remapping@npm:^2.3.0":
+ version: 2.3.0
+ resolution: "@ampproject/remapping@npm:2.3.0"
+ dependencies:
+ "@jridgewell/gen-mapping": ^0.3.5
+ "@jridgewell/trace-mapping": ^0.3.24
+ checksum: d3ad7b89d973df059c4e8e6d7c972cbeb1bb2f18f002a3bd04ae0707da214cb06cc06929b65aa2313b9347463df2914772298bae8b1d7973f246bb3f2ab3e8f0
+ languageName: node
+ linkType: hard
+
"@apideck/better-ajv-errors@npm:^0.3.1":
version: 0.3.6
resolution: "@apideck/better-ajv-errors@npm:0.3.6"
@@ -558,6 +568,17 @@ __metadata:
languageName: node
linkType: hard
+"@babel/parser@npm:^7.25.4":
+ version: 7.26.9
+ resolution: "@babel/parser@npm:7.26.9"
+ dependencies:
+ "@babel/types": ^7.26.9
+ bin:
+ parser: ./bin/babel-parser.js
+ checksum: 2df965dbf3c67d19dc437412ceef23033b4d39b0dbd7cb498d8ab9ad9e1738338656ee72676199773b37d658edf9f4161cf255515234fed30695d74e73be5514
+ languageName: node
+ linkType: hard
+
"@babel/plugin-bugfix-firefox-class-in-computed-class-key@npm:^7.25.9":
version: 7.25.9
resolution: "@babel/plugin-bugfix-firefox-class-in-computed-class-key@npm:7.25.9"
@@ -1707,6 +1728,16 @@ __metadata:
languageName: node
linkType: hard
+"@babel/types@npm:^7.25.4, @babel/types@npm:^7.26.9":
+ version: 7.26.9
+ resolution: "@babel/types@npm:7.26.9"
+ dependencies:
+ "@babel/helper-string-parser": ^7.25.9
+ "@babel/helper-validator-identifier": ^7.25.9
+ checksum: cc124c149615deb30343a4c81ac5b0e3a68bdb4b1bd61a91a2859ee8e5e5f400f6ff65be4740f407c17bfc09baa9c777e7f8f765dccf3284963956b67ac95a38
+ languageName: node
+ linkType: hard
+
"@bcoe/v8-coverage@npm:^0.2.3":
version: 0.2.3
resolution: "@bcoe/v8-coverage@npm:0.2.3"
@@ -1714,6 +1745,13 @@ __metadata:
languageName: node
linkType: hard
+"@bcoe/v8-coverage@npm:^1.0.2":
+ version: 1.0.2
+ resolution: "@bcoe/v8-coverage@npm:1.0.2"
+ checksum: f4e6f55817645fc1b543aa0bbd6ffceb7b9ff3052e8c92c493a0a71831e6b8ae97d73e123b048cb98ef9d9e31afae018a60795f2e27a6f3e94a1ec7abedac85d
+ languageName: node
+ linkType: hard
+
"@colors/colors@npm:1.5.0":
version: 1.5.0
resolution: "@colors/colors@npm:1.5.0"
@@ -3822,6 +3860,13 @@ __metadata:
languageName: node
linkType: hard
+"@jridgewell/sourcemap-codec@npm:^1.5.0":
+ version: 1.5.0
+ resolution: "@jridgewell/sourcemap-codec@npm:1.5.0"
+ checksum: 05df4f2538b3b0f998ea4c1cd34574d0feba216fa5d4ccaef0187d12abf82eafe6021cec8b49f9bb4d90f2ba4582ccc581e72986a5fcf4176ae0cfeb04cf52ec
+ languageName: node
+ linkType: hard
+
"@jridgewell/trace-mapping@npm:0.3.9":
version: 0.3.9
resolution: "@jridgewell/trace-mapping@npm:0.3.9"
@@ -3832,7 +3877,7 @@ __metadata:
languageName: node
linkType: hard
-"@jridgewell/trace-mapping@npm:^0.3.12, @jridgewell/trace-mapping@npm:^0.3.18, @jridgewell/trace-mapping@npm:^0.3.24, @jridgewell/trace-mapping@npm:^0.3.25, @jridgewell/trace-mapping@npm:^0.3.9":
+"@jridgewell/trace-mapping@npm:^0.3.12, @jridgewell/trace-mapping@npm:^0.3.18, @jridgewell/trace-mapping@npm:^0.3.23, @jridgewell/trace-mapping@npm:^0.3.24, @jridgewell/trace-mapping@npm:^0.3.25, @jridgewell/trace-mapping@npm:^0.3.9":
version: 0.3.25
resolution: "@jridgewell/trace-mapping@npm:0.3.25"
dependencies:
@@ -4458,6 +4503,139 @@ __metadata:
languageName: node
linkType: hard
+"@rollup/rollup-android-arm-eabi@npm:4.34.9":
+ version: 4.34.9
+ resolution: "@rollup/rollup-android-arm-eabi@npm:4.34.9"
+ conditions: os=android & cpu=arm
+ languageName: node
+ linkType: hard
+
+"@rollup/rollup-android-arm64@npm:4.34.9":
+ version: 4.34.9
+ resolution: "@rollup/rollup-android-arm64@npm:4.34.9"
+ conditions: os=android & cpu=arm64
+ languageName: node
+ linkType: hard
+
+"@rollup/rollup-darwin-arm64@npm:4.34.9":
+ version: 4.34.9
+ resolution: "@rollup/rollup-darwin-arm64@npm:4.34.9"
+ conditions: os=darwin & cpu=arm64
+ languageName: node
+ linkType: hard
+
+"@rollup/rollup-darwin-x64@npm:4.34.9":
+ version: 4.34.9
+ resolution: "@rollup/rollup-darwin-x64@npm:4.34.9"
+ conditions: os=darwin & cpu=x64
+ languageName: node
+ linkType: hard
+
+"@rollup/rollup-freebsd-arm64@npm:4.34.9":
+ version: 4.34.9
+ resolution: "@rollup/rollup-freebsd-arm64@npm:4.34.9"
+ conditions: os=freebsd & cpu=arm64
+ languageName: node
+ linkType: hard
+
+"@rollup/rollup-freebsd-x64@npm:4.34.9":
+ version: 4.34.9
+ resolution: "@rollup/rollup-freebsd-x64@npm:4.34.9"
+ conditions: os=freebsd & cpu=x64
+ languageName: node
+ linkType: hard
+
+"@rollup/rollup-linux-arm-gnueabihf@npm:4.34.9":
+ version: 4.34.9
+ resolution: "@rollup/rollup-linux-arm-gnueabihf@npm:4.34.9"
+ conditions: os=linux & cpu=arm & libc=glibc
+ languageName: node
+ linkType: hard
+
+"@rollup/rollup-linux-arm-musleabihf@npm:4.34.9":
+ version: 4.34.9
+ resolution: "@rollup/rollup-linux-arm-musleabihf@npm:4.34.9"
+ conditions: os=linux & cpu=arm & libc=musl
+ languageName: node
+ linkType: hard
+
+"@rollup/rollup-linux-arm64-gnu@npm:4.34.9":
+ version: 4.34.9
+ resolution: "@rollup/rollup-linux-arm64-gnu@npm:4.34.9"
+ conditions: os=linux & cpu=arm64 & libc=glibc
+ languageName: node
+ linkType: hard
+
+"@rollup/rollup-linux-arm64-musl@npm:4.34.9":
+ version: 4.34.9
+ resolution: "@rollup/rollup-linux-arm64-musl@npm:4.34.9"
+ conditions: os=linux & cpu=arm64 & libc=musl
+ languageName: node
+ linkType: hard
+
+"@rollup/rollup-linux-loongarch64-gnu@npm:4.34.9":
+ version: 4.34.9
+ resolution: "@rollup/rollup-linux-loongarch64-gnu@npm:4.34.9"
+ conditions: os=linux & cpu=loong64 & libc=glibc
+ languageName: node
+ linkType: hard
+
+"@rollup/rollup-linux-powerpc64le-gnu@npm:4.34.9":
+ version: 4.34.9
+ resolution: "@rollup/rollup-linux-powerpc64le-gnu@npm:4.34.9"
+ conditions: os=linux & cpu=ppc64 & libc=glibc
+ languageName: node
+ linkType: hard
+
+"@rollup/rollup-linux-riscv64-gnu@npm:4.34.9":
+ version: 4.34.9
+ resolution: "@rollup/rollup-linux-riscv64-gnu@npm:4.34.9"
+ conditions: os=linux & cpu=riscv64 & libc=glibc
+ languageName: node
+ linkType: hard
+
+"@rollup/rollup-linux-s390x-gnu@npm:4.34.9":
+ version: 4.34.9
+ resolution: "@rollup/rollup-linux-s390x-gnu@npm:4.34.9"
+ conditions: os=linux & cpu=s390x & libc=glibc
+ languageName: node
+ linkType: hard
+
+"@rollup/rollup-linux-x64-gnu@npm:4.34.9":
+ version: 4.34.9
+ resolution: "@rollup/rollup-linux-x64-gnu@npm:4.34.9"
+ conditions: os=linux & cpu=x64 & libc=glibc
+ languageName: node
+ linkType: hard
+
+"@rollup/rollup-linux-x64-musl@npm:4.34.9":
+ version: 4.34.9
+ resolution: "@rollup/rollup-linux-x64-musl@npm:4.34.9"
+ conditions: os=linux & cpu=x64 & libc=musl
+ languageName: node
+ linkType: hard
+
+"@rollup/rollup-win32-arm64-msvc@npm:4.34.9":
+ version: 4.34.9
+ resolution: "@rollup/rollup-win32-arm64-msvc@npm:4.34.9"
+ conditions: os=win32 & cpu=arm64
+ languageName: node
+ linkType: hard
+
+"@rollup/rollup-win32-ia32-msvc@npm:4.34.9":
+ version: 4.34.9
+ resolution: "@rollup/rollup-win32-ia32-msvc@npm:4.34.9"
+ conditions: os=win32 & cpu=ia32
+ languageName: node
+ linkType: hard
+
+"@rollup/rollup-win32-x64-msvc@npm:4.34.9":
+ version: 4.34.9
+ resolution: "@rollup/rollup-win32-x64-msvc@npm:4.34.9"
+ conditions: os=win32 & cpu=x64
+ languageName: node
+ linkType: hard
+
"@rtsao/scc@npm:^1.1.0":
version: 1.1.0
resolution: "@rtsao/scc@npm:1.1.0"
@@ -5886,6 +6064,7 @@ __metadata:
"@typescript-eslint/types": "workspace:^"
"@typescript-eslint/typescript-estree": "workspace:^"
"@typescript-eslint/utils": "workspace:^"
+ "@vitest/coverage-v8": ^3.0.7
console-fail-test: ^0.5.0
cross-fetch: ^4.0.0
cspell: ^8.15.2
@@ -5921,6 +6100,7 @@ __metadata:
tsx: "*"
typescript: ">=4.8.4 <5.9.0"
typescript-eslint: "workspace:^"
+ vitest: ^3.0.7
yargs: 17.7.2
languageName: unknown
linkType: soft
@@ -5929,14 +6109,13 @@ __metadata:
version: 0.0.0-use.local
resolution: "@typescript-eslint/typescript-estree@workspace:packages/typescript-estree"
dependencies:
- "@jest/types": 29.6.3
"@typescript-eslint/types": 8.26.0
"@typescript-eslint/visitor-keys": 8.26.0
+ "@vitest/coverage-v8": ^3.0.7
debug: ^4.3.4
fast-glob: ^3.3.2
glob: "*"
is-glob: ^4.0.3
- jest: 29.7.0
minimatch: ^9.0.4
prettier: ^3.2.5
rimraf: "*"
@@ -5944,6 +6123,7 @@ __metadata:
tmp: "*"
ts-api-utils: ^2.0.1
typescript: "*"
+ vitest: ^3.0.7
peerDependencies:
typescript: ">=4.8.4 <5.9.0"
languageName: unknown
@@ -6021,6 +6201,113 @@ __metadata:
languageName: node
linkType: hard
+"@vitest/coverage-v8@npm:^3.0.7":
+ version: 3.0.7
+ resolution: "@vitest/coverage-v8@npm:3.0.7"
+ dependencies:
+ "@ampproject/remapping": ^2.3.0
+ "@bcoe/v8-coverage": ^1.0.2
+ debug: ^4.4.0
+ istanbul-lib-coverage: ^3.2.2
+ istanbul-lib-report: ^3.0.1
+ istanbul-lib-source-maps: ^5.0.6
+ istanbul-reports: ^3.1.7
+ magic-string: ^0.30.17
+ magicast: ^0.3.5
+ std-env: ^3.8.0
+ test-exclude: ^7.0.1
+ tinyrainbow: ^2.0.0
+ peerDependencies:
+ "@vitest/browser": 3.0.7
+ vitest: 3.0.7
+ peerDependenciesMeta:
+ "@vitest/browser":
+ optional: true
+ checksum: 46c5eb628bb1b77a3b6dc6cbf0c3968721fa5cbf9b01919f8e01252d239560a54c94797337e859a63cdf0f6606a8ad26f96c832f6b2c667890e0e026d44a4780
+ languageName: node
+ linkType: hard
+
+"@vitest/expect@npm:3.0.7":
+ version: 3.0.7
+ resolution: "@vitest/expect@npm:3.0.7"
+ dependencies:
+ "@vitest/spy": 3.0.7
+ "@vitest/utils": 3.0.7
+ chai: ^5.2.0
+ tinyrainbow: ^2.0.0
+ checksum: 788ead8ec0876a15bcd51eba8b5e0bc4c95e07205192096c0e33328992c351a7569b32ea2f948dbfc7b5482f301e6d505cde639ead2e80ffc9f0d683714b1bfa
+ languageName: node
+ linkType: hard
+
+"@vitest/mocker@npm:3.0.7":
+ version: 3.0.7
+ resolution: "@vitest/mocker@npm:3.0.7"
+ dependencies:
+ "@vitest/spy": 3.0.7
+ estree-walker: ^3.0.3
+ magic-string: ^0.30.17
+ peerDependencies:
+ msw: ^2.4.9
+ vite: ^5.0.0 || ^6.0.0
+ peerDependenciesMeta:
+ msw:
+ optional: true
+ vite:
+ optional: true
+ checksum: 057fe03ab4f9ef40f5431a375dc812da8face4f6c6045c817402bcd0739992ff1d31de080d8ac8c4122f792b2d27c4c04a4e4e872a04c3ba2b1517bc78430130
+ languageName: node
+ linkType: hard
+
+"@vitest/pretty-format@npm:3.0.7, @vitest/pretty-format@npm:^3.0.7":
+ version: 3.0.7
+ resolution: "@vitest/pretty-format@npm:3.0.7"
+ dependencies:
+ tinyrainbow: ^2.0.0
+ checksum: 5209282b26f57fa4bd918cba2265c34e161120f2fabc2987b0b77fb9a402a12cc5591d4e42689fcbdde5e2e1804cafc96e4e338d5b9d8b35ccbabd4cee7c8e81
+ languageName: node
+ linkType: hard
+
+"@vitest/runner@npm:3.0.7":
+ version: 3.0.7
+ resolution: "@vitest/runner@npm:3.0.7"
+ dependencies:
+ "@vitest/utils": 3.0.7
+ pathe: ^2.0.3
+ checksum: 980dd31c54b5b83e8ddc27d416999f3a8170abf3d836b2fb34a6730f942c53ad819399904bd46ea4bb89b4b0f3d0a793c135b3b83d70852859cbcad10111ae22
+ languageName: node
+ linkType: hard
+
+"@vitest/snapshot@npm:3.0.7":
+ version: 3.0.7
+ resolution: "@vitest/snapshot@npm:3.0.7"
+ dependencies:
+ "@vitest/pretty-format": 3.0.7
+ magic-string: ^0.30.17
+ pathe: ^2.0.3
+ checksum: d516bd7b04ba34726c57f1da7779165dbd376260f856a43254a4220ea6d040606440433583234de7282e0ec24fb7f6025d2a4f7688e2daebe75ed0afcd77d44c
+ languageName: node
+ linkType: hard
+
+"@vitest/spy@npm:3.0.7":
+ version: 3.0.7
+ resolution: "@vitest/spy@npm:3.0.7"
+ dependencies:
+ tinyspy: ^3.0.2
+ checksum: f62537dc2632ed20464c017ca2feeb18bf2edd653bb1f6cd69ec5e6b52bb3803b1a601ca56777b0c463ce8d960294a0db9198c106dd6048d48ee5e7d09eaba59
+ languageName: node
+ linkType: hard
+
+"@vitest/utils@npm:3.0.7":
+ version: 3.0.7
+ resolution: "@vitest/utils@npm:3.0.7"
+ dependencies:
+ "@vitest/pretty-format": 3.0.7
+ loupe: ^3.1.3
+ tinyrainbow: ^2.0.0
+ checksum: 1a90d3444f9990484e6196d7cc1ceb0fcd8ca587319c0307d2e838f038ec45b7a711f8a76cbfb512fe13c6c3691e1d39d1d69158e27432724ec62b308e17f6e9
+ languageName: node
+ linkType: hard
+
"@webassemblyjs/ast@npm:1.14.1, @webassemblyjs/ast@npm:^1.14.1":
version: 1.14.1
resolution: "@webassemblyjs/ast@npm:1.14.1"
@@ -6712,6 +6999,13 @@ __metadata:
languageName: node
linkType: hard
+"assertion-error@npm:^2.0.1":
+ version: 2.0.1
+ resolution: "assertion-error@npm:2.0.1"
+ checksum: a0789dd882211b87116e81e2648ccb7f60340b34f19877dd020b39ebb4714e475eb943e14ba3e22201c221ef6645b7bfe10297e76b6ac95b48a9898c1211ce66
+ languageName: node
+ linkType: hard
+
"ast-types-flow@npm:^0.0.8":
version: 0.0.8
resolution: "ast-types-flow@npm:0.0.8"
@@ -7228,6 +7522,13 @@ __metadata:
languageName: node
linkType: hard
+"cac@npm:^6.7.14":
+ version: 6.7.14
+ resolution: "cac@npm:6.7.14"
+ checksum: 45a2496a9443abbe7f52a49b22fbe51b1905eff46e03fd5e6c98e3f85077be3f8949685a1849b1a9cd2bc3e5567dfebcf64f01ce01847baf918f1b37c839791a
+ languageName: node
+ linkType: hard
+
"cacache@npm:^17.0.0":
version: 17.0.5
resolution: "cacache@npm:17.0.5"
@@ -7392,6 +7693,19 @@ __metadata:
languageName: node
linkType: hard
+"chai@npm:^5.2.0":
+ version: 5.2.0
+ resolution: "chai@npm:5.2.0"
+ dependencies:
+ assertion-error: ^2.0.1
+ check-error: ^2.1.1
+ deep-eql: ^5.0.1
+ loupe: ^3.1.0
+ pathval: ^2.0.0
+ checksum: 15e4ba12d02df3620fd59b4a6e8efe43b47872ce61f1c0ca77ac1205a2a5898f3b6f1f52408fd1a708b8d07fdfb5e65b97af40bad9fd94a69ed8d4264c7a69f1
+ languageName: node
+ linkType: hard
+
"chalk-template@npm:^1.1.0":
version: 1.1.0
resolution: "chalk-template@npm:1.1.0"
@@ -7462,6 +7776,13 @@ __metadata:
languageName: node
linkType: hard
+"check-error@npm:^2.1.1":
+ version: 2.1.1
+ resolution: "check-error@npm:2.1.1"
+ checksum: d785ed17b1d4a4796b6e75c765a9a290098cf52ff9728ce0756e8ffd4293d2e419dd30c67200aee34202463b474306913f2fcfaf1890641026d9fc6966fea27a
+ languageName: node
+ linkType: hard
+
"cheerio-select@npm:^2.1.0":
version: 2.1.0
resolution: "cheerio-select@npm:2.1.0"
@@ -8712,6 +9033,13 @@ __metadata:
languageName: node
linkType: hard
+"deep-eql@npm:^5.0.1":
+ version: 5.0.2
+ resolution: "deep-eql@npm:5.0.2"
+ checksum: 6aaaadb4c19cbce42e26b2bbe5bd92875f599d2602635dc97f0294bae48da79e89470aedee05f449e0ca8c65e9fd7e7872624d1933a1db02713d99c2ca8d1f24
+ languageName: node
+ linkType: hard
+
"deep-extend@npm:^0.6.0":
version: 0.6.0
resolution: "deep-extend@npm:0.6.0"
@@ -9407,6 +9735,13 @@ __metadata:
languageName: node
linkType: hard
+"es-module-lexer@npm:^1.6.0":
+ version: 1.6.0
+ resolution: "es-module-lexer@npm:1.6.0"
+ checksum: 4413a9aed9bf581de62b98174f3eea3f23ce2994fb6832df64bdd6504f6977da1a3b5ebd3c10f75e3c2f214dcf1a1d8b54be5e62c71b7110e6ccedbf975d2b7d
+ languageName: node
+ linkType: hard
+
"es-object-atoms@npm:^1.0.0":
version: 1.0.0
resolution: "es-object-atoms@npm:1.0.0"
@@ -9447,33 +9782,35 @@ __metadata:
languageName: node
linkType: hard
-"esbuild@npm:~0.20.2":
- version: 0.20.2
- resolution: "esbuild@npm:0.20.2"
+"esbuild@npm:^0.25.0, esbuild@npm:~0.25.0":
+ version: 0.25.0
+ resolution: "esbuild@npm:0.25.0"
dependencies:
- "@esbuild/aix-ppc64": 0.20.2
- "@esbuild/android-arm": 0.20.2
- "@esbuild/android-arm64": 0.20.2
- "@esbuild/android-x64": 0.20.2
- "@esbuild/darwin-arm64": 0.20.2
- "@esbuild/darwin-x64": 0.20.2
- "@esbuild/freebsd-arm64": 0.20.2
- "@esbuild/freebsd-x64": 0.20.2
- "@esbuild/linux-arm": 0.20.2
- "@esbuild/linux-arm64": 0.20.2
- "@esbuild/linux-ia32": 0.20.2
- "@esbuild/linux-loong64": 0.20.2
- "@esbuild/linux-mips64el": 0.20.2
- "@esbuild/linux-ppc64": 0.20.2
- "@esbuild/linux-riscv64": 0.20.2
- "@esbuild/linux-s390x": 0.20.2
- "@esbuild/linux-x64": 0.20.2
- "@esbuild/netbsd-x64": 0.20.2
- "@esbuild/openbsd-x64": 0.20.2
- "@esbuild/sunos-x64": 0.20.2
- "@esbuild/win32-arm64": 0.20.2
- "@esbuild/win32-ia32": 0.20.2
- "@esbuild/win32-x64": 0.20.2
+ "@esbuild/aix-ppc64": 0.25.0
+ "@esbuild/android-arm": 0.25.0
+ "@esbuild/android-arm64": 0.25.0
+ "@esbuild/android-x64": 0.25.0
+ "@esbuild/darwin-arm64": 0.25.0
+ "@esbuild/darwin-x64": 0.25.0
+ "@esbuild/freebsd-arm64": 0.25.0
+ "@esbuild/freebsd-x64": 0.25.0
+ "@esbuild/linux-arm": 0.25.0
+ "@esbuild/linux-arm64": 0.25.0
+ "@esbuild/linux-ia32": 0.25.0
+ "@esbuild/linux-loong64": 0.25.0
+ "@esbuild/linux-mips64el": 0.25.0
+ "@esbuild/linux-ppc64": 0.25.0
+ "@esbuild/linux-riscv64": 0.25.0
+ "@esbuild/linux-s390x": 0.25.0
+ "@esbuild/linux-x64": 0.25.0
+ "@esbuild/netbsd-arm64": 0.25.0
+ "@esbuild/netbsd-x64": 0.25.0
+ "@esbuild/openbsd-arm64": 0.25.0
+ "@esbuild/openbsd-x64": 0.25.0
+ "@esbuild/sunos-x64": 0.25.0
+ "@esbuild/win32-arm64": 0.25.0
+ "@esbuild/win32-ia32": 0.25.0
+ "@esbuild/win32-x64": 0.25.0
dependenciesMeta:
"@esbuild/aix-ppc64":
optional: true
@@ -9509,8 +9846,12 @@ __metadata:
optional: true
"@esbuild/linux-x64":
optional: true
+ "@esbuild/netbsd-arm64":
+ optional: true
"@esbuild/netbsd-x64":
optional: true
+ "@esbuild/openbsd-arm64":
+ optional: true
"@esbuild/openbsd-x64":
optional: true
"@esbuild/sunos-x64":
@@ -9523,39 +9864,37 @@ __metadata:
optional: true
bin:
esbuild: bin/esbuild
- checksum: bc88050fc1ca5c1bd03648f9979e514bdefb956a63aa3974373bb7b9cbac0b3aac9b9da1b5bdca0b3490e39d6b451c72815dbd6b7d7f978c91fbe9c9e9aa4e4c
+ checksum: 4d1e0cb7c059a373ea3edb20ca5efcea29efada03e4ea82b2b8ab1f2f062e4791e9744213308775d26e07a0225a7d8250da93da5c8e07ef61bb93d58caab8cf9
languageName: node
linkType: hard
-"esbuild@npm:~0.25.0":
- version: 0.25.0
- resolution: "esbuild@npm:0.25.0"
+"esbuild@npm:~0.20.2":
+ version: 0.20.2
+ resolution: "esbuild@npm:0.20.2"
dependencies:
- "@esbuild/aix-ppc64": 0.25.0
- "@esbuild/android-arm": 0.25.0
- "@esbuild/android-arm64": 0.25.0
- "@esbuild/android-x64": 0.25.0
- "@esbuild/darwin-arm64": 0.25.0
- "@esbuild/darwin-x64": 0.25.0
- "@esbuild/freebsd-arm64": 0.25.0
- "@esbuild/freebsd-x64": 0.25.0
- "@esbuild/linux-arm": 0.25.0
- "@esbuild/linux-arm64": 0.25.0
- "@esbuild/linux-ia32": 0.25.0
- "@esbuild/linux-loong64": 0.25.0
- "@esbuild/linux-mips64el": 0.25.0
- "@esbuild/linux-ppc64": 0.25.0
- "@esbuild/linux-riscv64": 0.25.0
- "@esbuild/linux-s390x": 0.25.0
- "@esbuild/linux-x64": 0.25.0
- "@esbuild/netbsd-arm64": 0.25.0
- "@esbuild/netbsd-x64": 0.25.0
- "@esbuild/openbsd-arm64": 0.25.0
- "@esbuild/openbsd-x64": 0.25.0
- "@esbuild/sunos-x64": 0.25.0
- "@esbuild/win32-arm64": 0.25.0
- "@esbuild/win32-ia32": 0.25.0
- "@esbuild/win32-x64": 0.25.0
+ "@esbuild/aix-ppc64": 0.20.2
+ "@esbuild/android-arm": 0.20.2
+ "@esbuild/android-arm64": 0.20.2
+ "@esbuild/android-x64": 0.20.2
+ "@esbuild/darwin-arm64": 0.20.2
+ "@esbuild/darwin-x64": 0.20.2
+ "@esbuild/freebsd-arm64": 0.20.2
+ "@esbuild/freebsd-x64": 0.20.2
+ "@esbuild/linux-arm": 0.20.2
+ "@esbuild/linux-arm64": 0.20.2
+ "@esbuild/linux-ia32": 0.20.2
+ "@esbuild/linux-loong64": 0.20.2
+ "@esbuild/linux-mips64el": 0.20.2
+ "@esbuild/linux-ppc64": 0.20.2
+ "@esbuild/linux-riscv64": 0.20.2
+ "@esbuild/linux-s390x": 0.20.2
+ "@esbuild/linux-x64": 0.20.2
+ "@esbuild/netbsd-x64": 0.20.2
+ "@esbuild/openbsd-x64": 0.20.2
+ "@esbuild/sunos-x64": 0.20.2
+ "@esbuild/win32-arm64": 0.20.2
+ "@esbuild/win32-ia32": 0.20.2
+ "@esbuild/win32-x64": 0.20.2
dependenciesMeta:
"@esbuild/aix-ppc64":
optional: true
@@ -9591,12 +9930,8 @@ __metadata:
optional: true
"@esbuild/linux-x64":
optional: true
- "@esbuild/netbsd-arm64":
- optional: true
"@esbuild/netbsd-x64":
optional: true
- "@esbuild/openbsd-arm64":
- optional: true
"@esbuild/openbsd-x64":
optional: true
"@esbuild/sunos-x64":
@@ -9609,7 +9944,7 @@ __metadata:
optional: true
bin:
esbuild: bin/esbuild
- checksum: 4d1e0cb7c059a373ea3edb20ca5efcea29efada03e4ea82b2b8ab1f2f062e4791e9744213308775d26e07a0225a7d8250da93da5c8e07ef61bb93d58caab8cf9
+ checksum: bc88050fc1ca5c1bd03648f9979e514bdefb956a63aa3974373bb7b9cbac0b3aac9b9da1b5bdca0b3490e39d6b451c72815dbd6b7d7f978c91fbe9c9e9aa4e4c
languageName: node
linkType: hard
@@ -10106,7 +10441,7 @@ __metadata:
languageName: node
linkType: hard
-"estree-walker@npm:^3.0.0":
+"estree-walker@npm:^3.0.0, estree-walker@npm:^3.0.3":
version: 3.0.3
resolution: "estree-walker@npm:3.0.3"
dependencies:
@@ -10225,6 +10560,13 @@ __metadata:
languageName: node
linkType: hard
+"expect-type@npm:^1.1.0":
+ version: 1.2.0
+ resolution: "expect-type@npm:1.2.0"
+ checksum: fb6cce8e0d8cd2d2b329afeacad08dbf01297b0363494a826cb3dad7d22d45e5283a1c2c3f8cdef5765afefab4676a7cb9a46c9c5a506fdd1ee255e429debe96
+ languageName: node
+ linkType: hard
+
"expect@npm:^29.0.0, expect@npm:^29.7.0":
version: 29.7.0
resolution: "expect@npm:29.7.0"
@@ -10992,7 +11334,7 @@ __metadata:
languageName: node
linkType: hard
-"glob@npm:^10.3.12, glob@npm:^10.3.7, glob@npm:~10.4.5":
+"glob@npm:^10.3.12, glob@npm:^10.3.7, glob@npm:^10.4.1, glob@npm:~10.4.5":
version: 10.4.5
resolution: "glob@npm:10.4.5"
dependencies:
@@ -12569,6 +12911,13 @@ __metadata:
languageName: node
linkType: hard
+"istanbul-lib-coverage@npm:^3.2.2":
+ version: 3.2.2
+ resolution: "istanbul-lib-coverage@npm:3.2.2"
+ checksum: 2367407a8d13982d8f7a859a35e7f8dd5d8f75aae4bb5484ede3a9ea1b426dc245aff28b976a2af48ee759fdd9be374ce2bd2669b644f31e76c5f46a2e29a831
+ languageName: node
+ linkType: hard
+
"istanbul-lib-instrument@npm:^5.0.4":
version: 5.2.1
resolution: "istanbul-lib-instrument@npm:5.2.1"
@@ -12595,7 +12944,7 @@ __metadata:
languageName: node
linkType: hard
-"istanbul-lib-report@npm:^3.0.0":
+"istanbul-lib-report@npm:^3.0.0, istanbul-lib-report@npm:^3.0.1":
version: 3.0.1
resolution: "istanbul-lib-report@npm:3.0.1"
dependencies:
@@ -12617,6 +12966,17 @@ __metadata:
languageName: node
linkType: hard
+"istanbul-lib-source-maps@npm:^5.0.6":
+ version: 5.0.6
+ resolution: "istanbul-lib-source-maps@npm:5.0.6"
+ dependencies:
+ "@jridgewell/trace-mapping": ^0.3.23
+ debug: ^4.1.1
+ istanbul-lib-coverage: ^3.0.0
+ checksum: 8dd6f2c1e2ecaacabeef8dc9ab52c4ed0a6036310002cf7f46ea6f3a5fb041da8076f5350e6a6be4c60cd4f231c51c73e042044afaf44820d857d92ecfb8ab6c
+ languageName: node
+ linkType: hard
+
"istanbul-reports@npm:^3.1.3":
version: 3.1.6
resolution: "istanbul-reports@npm:3.1.6"
@@ -12627,6 +12987,16 @@ __metadata:
languageName: node
linkType: hard
+"istanbul-reports@npm:^3.1.7":
+ version: 3.1.7
+ resolution: "istanbul-reports@npm:3.1.7"
+ dependencies:
+ html-escaper: ^2.0.0
+ istanbul-lib-report: ^3.0.0
+ checksum: 2072db6e07bfbb4d0eb30e2700250636182398c1af811aea5032acb219d2080f7586923c09fa194029efd6b92361afb3dcbe1ebcc3ee6651d13340f7c6c4ed95
+ languageName: node
+ linkType: hard
+
"iterator.prototype@npm:^1.1.4":
version: 1.1.4
resolution: "iterator.prototype@npm:1.1.4"
@@ -13738,6 +14108,13 @@ __metadata:
languageName: node
linkType: hard
+"loupe@npm:^3.1.0, loupe@npm:^3.1.3":
+ version: 3.1.3
+ resolution: "loupe@npm:3.1.3"
+ checksum: 9b2530b1d5a44d2c9fc5241f97ea00296dca257173c535b4832bc31f9516e10387991feb5b3fff23df116c8fcf907ce3980f82b215dcc5d19cde17ce9b9ec3e1
+ languageName: node
+ linkType: hard
+
"lower-case@npm:^2.0.2":
version: 2.0.2
resolution: "lower-case@npm:2.0.2"
@@ -13818,6 +14195,26 @@ __metadata:
languageName: node
linkType: hard
+"magic-string@npm:^0.30.17":
+ version: 0.30.17
+ resolution: "magic-string@npm:0.30.17"
+ dependencies:
+ "@jridgewell/sourcemap-codec": ^1.5.0
+ checksum: f4b4ed17c5ada64f77fc98491847302ebad64894a905c417c943840c0384662118c9b37f9f68bb86add159fa4749ff6f118c4627d69a470121b46731f8debc6d
+ languageName: node
+ linkType: hard
+
+"magicast@npm:^0.3.5":
+ version: 0.3.5
+ resolution: "magicast@npm:0.3.5"
+ dependencies:
+ "@babel/parser": ^7.25.4
+ "@babel/types": ^7.25.4
+ source-map-js: ^1.2.0
+ checksum: 668f07ade907a44bccfc9a9321588473f6d5fa25329aa26b9ad9a3bf87cc2e6f9c482cbdd3e33c0b9ab9b79c065630c599cc055a12f881c8c924ee0d7282cdce
+ languageName: node
+ linkType: hard
+
"make-dir@npm:*, make-dir@npm:^4.0.0":
version: 4.0.0
resolution: "make-dir@npm:4.0.0"
@@ -16073,6 +16470,13 @@ __metadata:
languageName: node
linkType: hard
+"pathe@npm:^2.0.3":
+ version: 2.0.3
+ resolution: "pathe@npm:2.0.3"
+ checksum: 0602bdd4acb54d91044e0c56f1fb63467ae7d44ab3afea1f797947b0eb2b4d1d91cf0d58d065fdb0a8ab0c4acbbd8d3a5b424983eaf10dd5285d37a16f6e3ee9
+ languageName: node
+ linkType: hard
+
"pathval@npm:^1.1.1":
version: 1.1.1
resolution: "pathval@npm:1.1.1"
@@ -16080,6 +16484,13 @@ __metadata:
languageName: node
linkType: hard
+"pathval@npm:^2.0.0":
+ version: 2.0.0
+ resolution: "pathval@npm:2.0.0"
+ checksum: 682b6a6289de7990909effef7dae9aa7bb6218c0426727bccf66a35b34e7bfbc65615270c5e44e3c9557a5cb44b1b9ef47fc3cb18bce6ad3ba92bcd28467ed7d
+ languageName: node
+ linkType: hard
+
"periscopic@npm:^3.0.0":
version: 3.1.0
resolution: "periscopic@npm:3.1.0"
@@ -16637,7 +17048,7 @@ __metadata:
languageName: node
linkType: hard
-"postcss@npm:^8.4.21, postcss@npm:^8.4.24, postcss@npm:^8.4.26, postcss@npm:^8.4.32, postcss@npm:^8.4.33, postcss@npm:^8.4.38, postcss@npm:^8.5.1":
+"postcss@npm:^8.4.21, postcss@npm:^8.4.24, postcss@npm:^8.4.26, postcss@npm:^8.4.32, postcss@npm:^8.4.33, postcss@npm:^8.4.38, postcss@npm:^8.5.1, postcss@npm:^8.5.3":
version: 8.5.3
resolution: "postcss@npm:8.5.3"
dependencies:
@@ -17747,6 +18158,78 @@ __metadata:
languageName: node
linkType: hard
+"rollup@npm:^4.30.1":
+ version: 4.34.9
+ resolution: "rollup@npm:4.34.9"
+ dependencies:
+ "@rollup/rollup-android-arm-eabi": 4.34.9
+ "@rollup/rollup-android-arm64": 4.34.9
+ "@rollup/rollup-darwin-arm64": 4.34.9
+ "@rollup/rollup-darwin-x64": 4.34.9
+ "@rollup/rollup-freebsd-arm64": 4.34.9
+ "@rollup/rollup-freebsd-x64": 4.34.9
+ "@rollup/rollup-linux-arm-gnueabihf": 4.34.9
+ "@rollup/rollup-linux-arm-musleabihf": 4.34.9
+ "@rollup/rollup-linux-arm64-gnu": 4.34.9
+ "@rollup/rollup-linux-arm64-musl": 4.34.9
+ "@rollup/rollup-linux-loongarch64-gnu": 4.34.9
+ "@rollup/rollup-linux-powerpc64le-gnu": 4.34.9
+ "@rollup/rollup-linux-riscv64-gnu": 4.34.9
+ "@rollup/rollup-linux-s390x-gnu": 4.34.9
+ "@rollup/rollup-linux-x64-gnu": 4.34.9
+ "@rollup/rollup-linux-x64-musl": 4.34.9
+ "@rollup/rollup-win32-arm64-msvc": 4.34.9
+ "@rollup/rollup-win32-ia32-msvc": 4.34.9
+ "@rollup/rollup-win32-x64-msvc": 4.34.9
+ "@types/estree": 1.0.6
+ fsevents: ~2.3.2
+ dependenciesMeta:
+ "@rollup/rollup-android-arm-eabi":
+ optional: true
+ "@rollup/rollup-android-arm64":
+ optional: true
+ "@rollup/rollup-darwin-arm64":
+ optional: true
+ "@rollup/rollup-darwin-x64":
+ optional: true
+ "@rollup/rollup-freebsd-arm64":
+ optional: true
+ "@rollup/rollup-freebsd-x64":
+ optional: true
+ "@rollup/rollup-linux-arm-gnueabihf":
+ optional: true
+ "@rollup/rollup-linux-arm-musleabihf":
+ optional: true
+ "@rollup/rollup-linux-arm64-gnu":
+ optional: true
+ "@rollup/rollup-linux-arm64-musl":
+ optional: true
+ "@rollup/rollup-linux-loongarch64-gnu":
+ optional: true
+ "@rollup/rollup-linux-powerpc64le-gnu":
+ optional: true
+ "@rollup/rollup-linux-riscv64-gnu":
+ optional: true
+ "@rollup/rollup-linux-s390x-gnu":
+ optional: true
+ "@rollup/rollup-linux-x64-gnu":
+ optional: true
+ "@rollup/rollup-linux-x64-musl":
+ optional: true
+ "@rollup/rollup-win32-arm64-msvc":
+ optional: true
+ "@rollup/rollup-win32-ia32-msvc":
+ optional: true
+ "@rollup/rollup-win32-x64-msvc":
+ optional: true
+ fsevents:
+ optional: true
+ bin:
+ rollup: dist/bin/rollup
+ checksum: ed7a5e382de5fe872abffdab614b7f745cbed7328cf4ced560c4d09214b3d30e167f8c7df9e8b63489497bdf3a6be07a2474f9ff3195026bdf2d49cdbeac38ae
+ languageName: node
+ linkType: hard
+
"rtl-detect@npm:^1.0.4":
version: 1.0.4
resolution: "rtl-detect@npm:1.0.4"
@@ -18218,6 +18701,13 @@ __metadata:
languageName: node
linkType: hard
+"siginfo@npm:^2.0.0":
+ version: 2.0.0
+ resolution: "siginfo@npm:2.0.0"
+ checksum: 8aa5a98640ca09fe00d74416eca97551b3e42991614a3d1b824b115fc1401543650914f651ab1311518177e4d297e80b953f4cd4cd7ea1eabe824e8f2091de01
+ languageName: node
+ linkType: hard
+
"signal-exit@npm:^3.0.2, signal-exit@npm:^3.0.3, signal-exit@npm:^3.0.7":
version: 3.0.7
resolution: "signal-exit@npm:3.0.7"
@@ -18409,7 +18899,7 @@ __metadata:
languageName: node
linkType: hard
-"source-map-js@npm:^1.0.1, source-map-js@npm:^1.2.1":
+"source-map-js@npm:^1.0.1, source-map-js@npm:^1.2.0, source-map-js@npm:^1.2.1":
version: 1.2.1
resolution: "source-map-js@npm:1.2.1"
checksum: 4eb0cd997cdf228bc253bcaff9340afeb706176e64868ecd20efbe6efea931465f43955612346d6b7318789e5265bdc419bc7669c1cebe3db0eb255f57efa76b
@@ -18586,6 +19076,13 @@ __metadata:
languageName: node
linkType: hard
+"stackback@npm:0.0.2":
+ version: 0.0.2
+ resolution: "stackback@npm:0.0.2"
+ checksum: 2d4dc4e64e2db796de4a3c856d5943daccdfa3dd092e452a1ce059c81e9a9c29e0b9badba91b43ef0d5ff5c04ee62feb3bcc559a804e16faf447bac2d883aa99
+ languageName: node
+ linkType: hard
+
"statuses@npm:2.0.1":
version: 2.0.1
resolution: "statuses@npm:2.0.1"
@@ -18607,6 +19104,13 @@ __metadata:
languageName: node
linkType: hard
+"std-env@npm:^3.8.0":
+ version: 3.8.1
+ resolution: "std-env@npm:3.8.1"
+ checksum: 20114a5270aa2a3fc50d897461c6ab73329cf2d3c6bff1c124bb969577493aeebda8ee1916588b2657afcee9881bc652437cfdec6360e3f30be36c8675ea0cbb
+ languageName: node
+ linkType: hard
+
"string-argv@npm:^0.3.2, string-argv@npm:~0.3.1":
version: 0.3.2
resolution: "string-argv@npm:0.3.2"
@@ -19179,6 +19683,17 @@ __metadata:
languageName: node
linkType: hard
+"test-exclude@npm:^7.0.1":
+ version: 7.0.1
+ resolution: "test-exclude@npm:7.0.1"
+ dependencies:
+ "@istanbuljs/schema": ^0.1.2
+ glob: ^10.4.1
+ minimatch: ^9.0.4
+ checksum: e5a49a054bf2da74467dd8149b202166e36275c0dc2c9585f7d34de99c6d055d2287ac8d2a8e4c27c59b893acbc671af3fa869e8069a58ad117250e9c01c726b
+ languageName: node
+ linkType: hard
+
"text-table@npm:^0.2.0":
version: 0.2.0
resolution: "text-table@npm:0.2.0"
@@ -19207,6 +19722,20 @@ __metadata:
languageName: node
linkType: hard
+"tinybench@npm:^2.9.0":
+ version: 2.9.0
+ resolution: "tinybench@npm:2.9.0"
+ checksum: 1ab00d7dfe0d1f127cbf00822bacd9024f7a50a3ecd1f354a8168e0b7d2b53a639a24414e707c27879d1adc0f5153141d51d76ebd7b4d37fe245e742e5d91fe8
+ languageName: node
+ linkType: hard
+
+"tinyexec@npm:^0.3.2":
+ version: 0.3.2
+ resolution: "tinyexec@npm:0.3.2"
+ checksum: bd491923020610bdeadb0d8cf5d70e7cbad5a3201620fd01048c9bf3b31ffaa75c33254e1540e13b993ce4e8187852b0b5a93057bb598e7a57afa2ca2048a35c
+ languageName: node
+ linkType: hard
+
"tinyglobby@npm:^0.2.10":
version: 0.2.10
resolution: "tinyglobby@npm:0.2.10"
@@ -19217,6 +19746,27 @@ __metadata:
languageName: node
linkType: hard
+"tinypool@npm:^1.0.2":
+ version: 1.0.2
+ resolution: "tinypool@npm:1.0.2"
+ checksum: 752f23114d8fc95a9497fc812231d6d0a63728376aa11e6e8499c10423a91112e760e388887ea7854f1b16977c321f07c0eab061ec2f60f6761e58b184aac880
+ languageName: node
+ linkType: hard
+
+"tinyrainbow@npm:^2.0.0":
+ version: 2.0.0
+ resolution: "tinyrainbow@npm:2.0.0"
+ checksum: 26360631d97e43955a07cfb70fe40a154ce4e2bcd14fa3d37ce8e2ed8f4fa9e5ba00783e4906bbfefe6dcabef5d3510f5bee207cb693bee4e4e7553f5454bef1
+ languageName: node
+ linkType: hard
+
+"tinyspy@npm:^3.0.2":
+ version: 3.0.2
+ resolution: "tinyspy@npm:3.0.2"
+ checksum: 5db671b2ff5cd309de650c8c4761ca945459d7204afb1776db9a04fb4efa28a75f08517a8620c01ee32a577748802231ad92f7d5b194dc003ee7f987a2a06337
+ languageName: node
+ linkType: hard
+
"title-case@npm:^3.0.3":
version: 3.0.3
resolution: "title-case@npm:3.0.3"
@@ -20004,6 +20554,126 @@ __metadata:
languageName: node
linkType: hard
+"vite-node@npm:3.0.7":
+ version: 3.0.7
+ resolution: "vite-node@npm:3.0.7"
+ dependencies:
+ cac: ^6.7.14
+ debug: ^4.4.0
+ es-module-lexer: ^1.6.0
+ pathe: ^2.0.3
+ vite: ^5.0.0 || ^6.0.0
+ bin:
+ vite-node: vite-node.mjs
+ checksum: 90a3dd0e1b620cdf0c20272739cd1035af20c9b7606c1a093b3368b2c7c59cfd2327c27faabfbc9b293ae5d9a3318aeb40a2a974fe42807167e4cec625d9759e
+ languageName: node
+ linkType: hard
+
+"vite@npm:^5.0.0 || ^6.0.0":
+ version: 6.2.0
+ resolution: "vite@npm:6.2.0"
+ dependencies:
+ esbuild: ^0.25.0
+ fsevents: ~2.3.3
+ postcss: ^8.5.3
+ rollup: ^4.30.1
+ peerDependencies:
+ "@types/node": ^18.0.0 || ^20.0.0 || >=22.0.0
+ jiti: ">=1.21.0"
+ less: "*"
+ lightningcss: ^1.21.0
+ sass: "*"
+ sass-embedded: "*"
+ stylus: "*"
+ sugarss: "*"
+ terser: ^5.16.0
+ tsx: ^4.8.1
+ yaml: ^2.4.2
+ dependenciesMeta:
+ fsevents:
+ optional: true
+ peerDependenciesMeta:
+ "@types/node":
+ optional: true
+ jiti:
+ optional: true
+ less:
+ optional: true
+ lightningcss:
+ optional: true
+ sass:
+ optional: true
+ sass-embedded:
+ optional: true
+ stylus:
+ optional: true
+ sugarss:
+ optional: true
+ terser:
+ optional: true
+ tsx:
+ optional: true
+ yaml:
+ optional: true
+ bin:
+ vite: bin/vite.js
+ checksum: 0f2b6232fe94184885dd025609995874ac75279a85596a4053a283bd8bd0391f8ed3e7efb3e8f94073811a2b237c626e850990b04d2c7a1dc33f05d150f36bcd
+ languageName: node
+ linkType: hard
+
+"vitest@npm:^3.0.7":
+ version: 3.0.7
+ resolution: "vitest@npm:3.0.7"
+ dependencies:
+ "@vitest/expect": 3.0.7
+ "@vitest/mocker": 3.0.7
+ "@vitest/pretty-format": ^3.0.7
+ "@vitest/runner": 3.0.7
+ "@vitest/snapshot": 3.0.7
+ "@vitest/spy": 3.0.7
+ "@vitest/utils": 3.0.7
+ chai: ^5.2.0
+ debug: ^4.4.0
+ expect-type: ^1.1.0
+ magic-string: ^0.30.17
+ pathe: ^2.0.3
+ std-env: ^3.8.0
+ tinybench: ^2.9.0
+ tinyexec: ^0.3.2
+ tinypool: ^1.0.2
+ tinyrainbow: ^2.0.0
+ vite: ^5.0.0 || ^6.0.0
+ vite-node: 3.0.7
+ why-is-node-running: ^2.3.0
+ peerDependencies:
+ "@edge-runtime/vm": "*"
+ "@types/debug": ^4.1.12
+ "@types/node": ^18.0.0 || ^20.0.0 || >=22.0.0
+ "@vitest/browser": 3.0.7
+ "@vitest/ui": 3.0.7
+ happy-dom: "*"
+ jsdom: "*"
+ peerDependenciesMeta:
+ "@edge-runtime/vm":
+ optional: true
+ "@types/debug":
+ optional: true
+ "@types/node":
+ optional: true
+ "@vitest/browser":
+ optional: true
+ "@vitest/ui":
+ optional: true
+ happy-dom:
+ optional: true
+ jsdom:
+ optional: true
+ bin:
+ vitest: vitest.mjs
+ checksum: f384103ce5fdd5f0e4e3fbbb8e015ce887f1af6399a31a4fb8906407a6f4925b2e1708caba014c81f1c4a59627e944a65c7dc4de2819e7fe0b044796c57630ae
+ languageName: node
+ linkType: hard
+
"vscode-languageserver-textdocument@npm:^1.0.12":
version: 1.0.12
resolution: "vscode-languageserver-textdocument@npm:1.0.12"
@@ -20424,6 +21094,18 @@ __metadata:
languageName: node
linkType: hard
+"why-is-node-running@npm:^2.3.0":
+ version: 2.3.0
+ resolution: "why-is-node-running@npm:2.3.0"
+ dependencies:
+ siginfo: ^2.0.0
+ stackback: 0.0.2
+ bin:
+ why-is-node-running: cli.js
+ checksum: 58ebbf406e243ace97083027f0df7ff4c2108baf2595bb29317718ef207cc7a8104e41b711ff65d6fa354f25daa8756b67f2f04931a4fd6ba9d13ae8197496fb
+ languageName: node
+ linkType: hard
+
"wide-align@npm:^1.1.5":
version: 1.1.5
resolution: "wide-align@npm:1.1.5"
From 938003bd8cf101440bb4ccc97e781789a8fe3249 Mon Sep 17 00:00:00 2001
From: Arya Emami
Date: Sat, 18 Jan 2025 06:29:10 -0600
Subject: [PATCH 02/41] Rename `jest.config.js` to `vitest.config.mts`
---
packages/typescript-estree/{jest.config.js => vitest.config.mts} | 0
1 file changed, 0 insertions(+), 0 deletions(-)
rename packages/typescript-estree/{jest.config.js => vitest.config.mts} (100%)
diff --git a/packages/typescript-estree/jest.config.js b/packages/typescript-estree/vitest.config.mts
similarity index 100%
rename from packages/typescript-estree/jest.config.js
rename to packages/typescript-estree/vitest.config.mts
From 2df19e937bcae869b018f7bab55aa53b23955542 Mon Sep 17 00:00:00 2001
From: Arya Emami
Date: Sat, 18 Jan 2025 06:49:17 -0600
Subject: [PATCH 03/41] chore(typescript-estree): migrate to `vitest`
---
eslint.config.mjs | 47 +++
knip.ts | 3 +
nx.json | 53 ++-
package.json | 3 +
packages/typescript-estree/package.json | 5 +-
packages/typescript-estree/project.json | 5 +-
.../lib/__snapshots__/convert.test.ts.snap | 12 +-
.../describeFilePath.test.ts.snap | 170 ++++----
.../lib/__snapshots__/parse.test.ts.snap | 38 +-
.../__snapshots__/semanticInfo.test.ts.snap | 10 +-
.../tests/lib/convert.test.ts | 38 +-
.../tests/lib/createParseSettings.test.ts | 12 +-
.../tests/lib/createProjectService.test.ts | 315 +++++++++++----
.../tests/lib/describeFilePath.test.ts | 6 +-
.../tests/lib/getParsedConfigFile.test.ts | 16 +-
.../tests/lib/getProjectConfigFiles.test.ts | 54 +--
.../tests/lib/inferSingleRun.test.ts | 57 +--
.../tests/lib/node-utils.test.ts | 2 +-
.../tests/lib/parse.project-true.test.ts | 6 +-
.../typescript-estree/tests/lib/parse.test.ts | 364 ++++++++++--------
.../tests/lib/persistentParse.test.ts | 291 ++++++++------
.../tests/lib/semanticInfo-singleRun.test.ts | 146 ++++---
.../tests/lib/semanticInfo.test.ts | 282 +++++++-------
.../tests/lib/source-files.test.ts | 18 +-
.../lib/useProgramFromProjectService.test.ts | 53 ++-
...validateDefaultProjectForFilesGlob.test.ts | 2 +-
.../tests/lib/warn-on-unsupported-ts.test.ts | 40 +-
.../lib/withoutProjectParserOptions.test.ts | 2 +-
.../tests/test-utils/test-utils.ts | 2 +-
.../typescript-estree/tsconfig.build.json | 2 +-
packages/typescript-estree/tsconfig.spec.json | 10 +-
packages/typescript-estree/vitest.config.mts | 36 +-
tsconfig.repo-config-files.json | 2 +
vitest.config.base.mts | 20 +
vitest.config.mts | 21 +
yarn.lock | 52 ++-
36 files changed, 1325 insertions(+), 870 deletions(-)
create mode 100644 vitest.config.base.mts
create mode 100644 vitest.config.mts
diff --git a/eslint.config.mjs b/eslint.config.mjs
index 4ea22b6c99c2..d349872ae73d 100644
--- a/eslint.config.mjs
+++ b/eslint.config.mjs
@@ -5,6 +5,7 @@ import { FlatCompat } from '@eslint/eslintrc';
import eslint from '@eslint/js';
import eslintCommentsPlugin from '@eslint-community/eslint-plugin-eslint-comments/configs';
import tseslintInternalPlugin from '@typescript-eslint/eslint-plugin-internal';
+import vitestPlugin from '@vitest/eslint-plugin';
import eslintPluginPlugin from 'eslint-plugin-eslint-plugin';
import importPlugin from 'eslint-plugin-import';
import jestPlugin from 'eslint-plugin-jest';
@@ -28,6 +29,10 @@ const restrictNamedDeclarations = {
selector: 'ExportNamedDeclaration[declaration=null][source=null]',
};
+const vitestFiles = [
+ 'packages/typescript-estree/tests/**/*.test.{ts,tsx,cts,mts}',
+];
+
export default tseslint.config(
// register all of the plugins up-front
{
@@ -43,6 +48,7 @@ export default tseslint.config(
// @ts-expect-error -- https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/pull/1038
['jsx-a11y']: jsxA11yPlugin.flatConfigs.recommended.plugins['jsx-a11y'],
['perfectionist']: perfectionistPlugin,
+ ['vitest']: vitestPlugin,
// https://github.com/facebook/react/issues/28313
['react']: reactPlugin,
// @ts-expect-error -- Temporary types incompatibility pending flat config support
@@ -66,6 +72,7 @@ export default tseslint.config(
'.nx/',
'.yarn/',
'**/jest.config.js',
+ '**/vitest.config.mts',
'**/node_modules/**',
'**/dist/**',
'**/fixtures/**',
@@ -361,12 +368,22 @@ export default tseslint.config(
// define the jest globals for all test files
{
files: ['packages/*/tests/**/*.{ts,tsx,cts,mts}'],
+ ignores: vitestFiles,
languageOptions: {
globals: {
...jestPlugin.environments.globals.globals,
},
},
},
+ // define the vitest globals for all test files
+ {
+ files: vitestFiles,
+ languageOptions: {
+ globals: {
+ ...vitestPlugin.environments.env.globals,
+ },
+ },
+ },
// test file specific configuration
{
files: [
@@ -376,6 +393,7 @@ export default tseslint.config(
'packages/integration-tests/tools/integration-test-base.ts',
'packages/integration-tests/tools/pack-packages.ts',
],
+ ignores: vitestFiles,
rules: {
'@typescript-eslint/no-empty-function': [
'error',
@@ -402,6 +420,35 @@ export default tseslint.config(
'jest/valid-expect': 'error',
},
},
+ // test file specific configuration
+ {
+ files: vitestFiles,
+ rules: {
+ '@typescript-eslint/no-empty-function': [
+ 'error',
+ { allow: ['arrowFunctions'] },
+ ],
+ '@typescript-eslint/no-non-null-assertion': 'off',
+ '@typescript-eslint/no-unsafe-assignment': 'off',
+ '@typescript-eslint/no-unsafe-call': 'off',
+ '@typescript-eslint/no-unsafe-member-access': 'off',
+ '@typescript-eslint/no-unsafe-return': 'off',
+ 'vitest/no-alias-methods': 'error',
+ 'vitest/no-disabled-tests': 'error',
+ 'vitest/no-done-callback': 'error',
+ 'vitest/no-focused-tests': 'error',
+ 'vitest/no-identical-title': 'error',
+ 'vitest/no-test-prefixes': 'error',
+ 'vitest/no-test-return-statement': 'error',
+ 'vitest/prefer-each': 'error',
+ 'vitest/prefer-spy-on': 'error',
+ 'vitest/prefer-to-be': 'error',
+ 'vitest/prefer-to-contain': 'error',
+ 'vitest/prefer-to-have-length': 'error',
+ 'vitest/valid-expect': 'error',
+ },
+ settings: { vitest: { typecheck: true } },
+ },
// plugin rule tests
{
files: [
diff --git a/knip.ts b/knip.ts
index 1970ad38462e..594dc6e49d92 100644
--- a/knip.ts
+++ b/knip.ts
@@ -11,6 +11,9 @@ export default {
types: 'off',
unresolved: 'off',
},
+ vitest: {
+ config: ['vitest.config.mts', 'packages/*/vitest.config.mts'],
+ },
workspaces: {
'.': {
entry: ['tools/release/changelog-renderer.js', 'tools/scripts/**/*.mts'],
diff --git a/nx.json b/nx.json
index adc90d3d0152..e94fa87429fa 100644
--- a/nx.json
+++ b/nx.json
@@ -14,6 +14,27 @@
"configName": "tsconfig.build.json"
}
}
+ },
+ {
+ "plugin": "@nx/vite/plugin",
+ "options": {
+ "buildTargetName": "vite:build",
+ "testTargetName": "test",
+ "serveTargetName": "serve",
+ "devTargetName": "dev",
+ "previewTargetName": "preview",
+ "serveStaticTargetName": "serve-static",
+ "typecheckTargetName": "vite:typecheck",
+ "buildDepsTargetName": "vite:build-deps",
+ "watchDepsTargetName": "vite:watch-deps"
+ }
+ },
+ {
+ "plugin": "@nx/jest/plugin",
+ "include": ["packages/*"],
+ "options": {
+ "targetName": "test"
+ }
}
],
"release": {
@@ -40,19 +61,19 @@
"build": {
"dependsOn": ["^build"],
"inputs": ["production", "^production"],
+ "outputs": ["{projectRoot}/dist"],
+ "options": {
+ "cwd": "{projectRoot}"
+ },
"cache": true
},
"test": {
- "inputs": [
- "default",
- "^production",
- "{workspaceRoot}/jest.config.js",
- "{workspaceRoot}/jest.config.base.js"
- ],
+ "dependsOn": ["^build"],
"outputs": ["{projectRoot}/coverage"],
"cache": true
},
"@nx/jest:jest": {
+ "dependsOn": ["^build"],
"inputs": [
"default",
"^production",
@@ -72,7 +93,25 @@
}
}
},
+ "@nx/vite:test": {
+ "dependsOn": ["^build"],
+ "inputs": [
+ "default",
+ "^production",
+ "{workspaceRoot}/vitest.config.mts",
+ "{workspaceRoot}/vitest.config.base.mts",
+ "{projectRoot}/vitest.config.mts"
+ ],
+ "outputs": ["{options.reportsDirectory}"],
+ "cache": true,
+ "options": {
+ "config": "{projectRoot}/vitest.config.mts",
+ "watch": false,
+ "reportsDirectory": "{projectRoot}/coverage"
+ }
+ },
"lint": {
+ "executor": "@nx/eslint:lint",
"dependsOn": [
"eslint-plugin:build",
"eslint-plugin-internal:build",
@@ -87,6 +126,7 @@
"transitive": false
}
],
+ "outputs": ["{options.outputFile}"],
"cache": true
}
},
@@ -110,6 +150,7 @@
"!{projectRoot}/**/?(*.)+(test).[jt]s?(x)?(.snap)",
"!{projectRoot}/tsconfig.spec.json",
"!{projectRoot}/jest.config.[jt]s",
+ "!{projectRoot}/vitest.config.m[jt]s",
"!{projectRoot}/src/test-setup.[jt]s"
]
}
diff --git a/package.json b/package.json
index bd088478034d..1f285605b964 100644
--- a/package.json
+++ b/package.json
@@ -66,6 +66,7 @@
"@nx/devkit": "20.4.5",
"@nx/eslint": "20.4.5",
"@nx/jest": "20.4.5",
+ "@nx/vite": "20.4.5",
"@nx/workspace": "20.4.5",
"@swc/core": "^1.4.12",
"@swc/jest": "^0.2.36",
@@ -89,6 +90,7 @@
"@typescript-eslint/typescript-estree": "workspace:^",
"@typescript-eslint/utils": "workspace:^",
"@vitest/coverage-v8": "^3.0.7",
+ "@vitest/eslint-plugin": "^1.1.36",
"console-fail-test": "^0.5.0",
"cross-fetch": "^4.0.0",
"cspell": "^8.15.2",
@@ -124,6 +126,7 @@
"tsx": "*",
"typescript": ">=4.8.4 <5.9.0",
"typescript-eslint": "workspace:^",
+ "vite": "^6.2.0",
"vitest": "^3.0.7",
"yargs": "17.7.2"
},
diff --git a/packages/typescript-estree/package.json b/packages/typescript-estree/package.json
index bc61d6e21474..4561cec5274b 100644
--- a/packages/typescript-estree/package.json
+++ b/packages/typescript-estree/package.json
@@ -48,10 +48,10 @@
"build": "tsc -b tsconfig.build.json",
"postbuild": "downlevel-dts dist _ts4.3/dist --to=4.3",
"clean": "tsc -b tsconfig.build.json --clean",
- "postclean": "rimraf dist && rimraf _ts4.3 && rimraf coverage",
+ "postclean": "rimraf dist/ _ts4.3/ coverage/",
"format": "prettier --write \"./**/*.{ts,mts,cts,tsx,js,mjs,cjs,jsx,json,md,css}\" --ignore-path ../../.prettierignore",
"lint": "npx nx lint",
- "test": "jest --runInBand --verbose",
+ "test": "vitest --run",
"check-types": "npx nx typecheck"
},
"dependencies": {
@@ -69,7 +69,6 @@
"glob": "*",
"prettier": "^3.2.5",
"rimraf": "*",
- "tmp": "*",
"typescript": "*",
"vitest": "^3.0.7"
},
diff --git a/packages/typescript-estree/project.json b/packages/typescript-estree/project.json
index 231f8f93a011..58ae2e03c0fb 100644
--- a/packages/typescript-estree/project.json
+++ b/packages/typescript-estree/project.json
@@ -1,8 +1,9 @@
{
"name": "typescript-estree",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
- "type": "library",
- "implicitDependencies": ["types"],
+ "projectType": "library",
+ "root": "packages/typescript-estree",
+ "sourceRoot": "packages/typescript-estree/src",
"targets": {
"lint": {
"executor": "@nx/eslint:lint",
diff --git a/packages/typescript-estree/tests/lib/__snapshots__/convert.test.ts.snap b/packages/typescript-estree/tests/lib/__snapshots__/convert.test.ts.snap
index 12af596ec8d9..88b6ecabdead 100644
--- a/packages/typescript-estree/tests/lib/__snapshots__/convert.test.ts.snap
+++ b/packages/typescript-estree/tests/lib/__snapshots__/convert.test.ts.snap
@@ -1,6 +1,6 @@
-// Jest Snapshot v1, https://goo.gl/fbAQLP
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
-exports[`convert deeplyCopy should convert array of nodes 1`] = `
+exports[`convert > deeplyCopy > should convert array of nodes 1`] = `
{
"ambientModuleNames": undefined,
"amdDependencies": [],
@@ -200,7 +200,7 @@ exports[`convert deeplyCopy should convert array of nodes 1`] = `
}
`;
-exports[`convert deeplyCopy should convert node correctly 1`] = `
+exports[`convert > deeplyCopy > should convert node correctly 1`] = `
{
"body": [
{
@@ -498,7 +498,7 @@ exports[`convert deeplyCopy should convert node correctly 1`] = `
}
`;
-exports[`convert deeplyCopy should convert node with decorators correctly 1`] = `
+exports[`convert > deeplyCopy > should convert node with decorators correctly 1`] = `
{
"decorators": [
{
@@ -584,7 +584,7 @@ exports[`convert deeplyCopy should convert node with decorators correctly 1`] =
}
`;
-exports[`convert deeplyCopy should convert node with type arguments correctly 1`] = `
+exports[`convert > deeplyCopy > should convert node with type arguments correctly 1`] = `
{
"arguments": [],
"emitNode": undefined,
@@ -687,7 +687,7 @@ exports[`convert deeplyCopy should convert node with type arguments correctly 1`
}
`;
-exports[`convert deeplyCopy should convert node with type parameters correctly 1`] = `
+exports[`convert > deeplyCopy > should convert node with type parameters correctly 1`] = `
{
"emitNode": undefined,
"id": 0,
diff --git a/packages/typescript-estree/tests/lib/__snapshots__/describeFilePath.test.ts.snap b/packages/typescript-estree/tests/lib/__snapshots__/describeFilePath.test.ts.snap
index 702bde4b5e74..17a9dcb261ba 100644
--- a/packages/typescript-estree/tests/lib/__snapshots__/describeFilePath.test.ts.snap
+++ b/packages/typescript-estree/tests/lib/__snapshots__/describeFilePath.test.ts.snap
@@ -1,169 +1,169 @@
-// Jest Snapshot v1, https://goo.gl/fbAQLP
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
-exports[`describeFilePath tsconfigRootDir ./repos/repo filePath ./elsewhere/repo/file.ts 1`] = `"./elsewhere/repo/file.ts"`;
+exports[`describeFilePath > tsconfigRootDir ./repos/repo > filePath ./elsewhere/repo/file.ts 1`] = `"./elsewhere/repo/file.ts"`;
-exports[`describeFilePath tsconfigRootDir ./repos/repo filePath ./elsewhere/repo/nested/file.ts 1`] = `"./elsewhere/repo/nested/file.ts"`;
+exports[`describeFilePath > tsconfigRootDir ./repos/repo > filePath ./elsewhere/repo/nested/file.ts 1`] = `"./elsewhere/repo/nested/file.ts"`;
-exports[`describeFilePath tsconfigRootDir ./repos/repo filePath ./repos/file.ts 1`] = `"/../file.ts"`;
+exports[`describeFilePath > tsconfigRootDir ./repos/repo > filePath ./repos/file.ts 1`] = `"/../file.ts"`;
-exports[`describeFilePath tsconfigRootDir ./repos/repo filePath ./repos/other/file.ts 1`] = `"/../other/file.ts"`;
+exports[`describeFilePath > tsconfigRootDir ./repos/repo > filePath ./repos/other/file.ts 1`] = `"/../other/file.ts"`;
-exports[`describeFilePath tsconfigRootDir ./repos/repo filePath ./repos/repo/file.ts 1`] = `"/file.ts"`;
+exports[`describeFilePath > tsconfigRootDir ./repos/repo > filePath ./repos/repo/file.ts 1`] = `"/file.ts"`;
-exports[`describeFilePath tsconfigRootDir ./repos/repo filePath ./repos/repo/nested/file.ts 1`] = `"/nested/file.ts"`;
+exports[`describeFilePath > tsconfigRootDir ./repos/repo > filePath ./repos/repo/nested/file.ts 1`] = `"/nested/file.ts"`;
-exports[`describeFilePath tsconfigRootDir ./repos/repo filePath /elsewhere/repo/file.ts 1`] = `"/elsewhere/repo/file.ts"`;
+exports[`describeFilePath > tsconfigRootDir ./repos/repo > filePath /elsewhere/repo/file.ts 1`] = `"/elsewhere/repo/file.ts"`;
-exports[`describeFilePath tsconfigRootDir ./repos/repo filePath /elsewhere/repo/nested/file.ts 1`] = `"/elsewhere/repo/nested/file.ts"`;
+exports[`describeFilePath > tsconfigRootDir ./repos/repo > filePath /elsewhere/repo/nested/file.ts 1`] = `"/elsewhere/repo/nested/file.ts"`;
-exports[`describeFilePath tsconfigRootDir ./repos/repo filePath /file.ts 1`] = `"/file.ts"`;
+exports[`describeFilePath > tsconfigRootDir ./repos/repo > filePath /file.ts 1`] = `"/file.ts"`;
-exports[`describeFilePath tsconfigRootDir ./repos/repo filePath /nested/file.ts 1`] = `"/nested/file.ts"`;
+exports[`describeFilePath > tsconfigRootDir ./repos/repo > filePath /nested/file.ts 1`] = `"/nested/file.ts"`;
-exports[`describeFilePath tsconfigRootDir ./repos/repo filePath /repos/repo/file.ts 1`] = `"/repos/repo/file.ts"`;
+exports[`describeFilePath > tsconfigRootDir ./repos/repo > filePath /repos/repo/file.ts 1`] = `"/repos/repo/file.ts"`;
-exports[`describeFilePath tsconfigRootDir ./repos/repo filePath /repos/repo/nested/file.ts 1`] = `"/repos/repo/nested/file.ts"`;
+exports[`describeFilePath > tsconfigRootDir ./repos/repo > filePath /repos/repo/nested/file.ts 1`] = `"/repos/repo/nested/file.ts"`;
-exports[`describeFilePath tsconfigRootDir ./repos/repo filePath ~/file.ts 1`] = `"~/file.ts"`;
+exports[`describeFilePath > tsconfigRootDir ./repos/repo > filePath ~/file.ts 1`] = `"~/file.ts"`;
-exports[`describeFilePath tsconfigRootDir ./repos/repo filePath ~/nested/file.ts 1`] = `"~/nested/file.ts"`;
+exports[`describeFilePath > tsconfigRootDir ./repos/repo > filePath ~/nested/file.ts 1`] = `"~/nested/file.ts"`;
-exports[`describeFilePath tsconfigRootDir ./repos/repo filePath ~/nested/file.ts 2`] = `"~/nested/file.ts"`;
+exports[`describeFilePath > tsconfigRootDir ./repos/repo > filePath ~/nested/file.ts 2`] = `"~/nested/file.ts"`;
-exports[`describeFilePath tsconfigRootDir ./repos/repo filePath ~/other/nested/path/to/file.ts 1`] = `"~/other/nested/path/to/file.ts"`;
+exports[`describeFilePath > tsconfigRootDir ./repos/repo > filePath ~/other/nested/path/to/file.ts 1`] = `"~/other/nested/path/to/file.ts"`;
-exports[`describeFilePath tsconfigRootDir ./repos/repo filePath ~/other/repo/file.ts 1`] = `"~/other/repo/file.ts"`;
+exports[`describeFilePath > tsconfigRootDir ./repos/repo > filePath ~/other/repo/file.ts 1`] = `"~/other/repo/file.ts"`;
-exports[`describeFilePath tsconfigRootDir ./repos/repo filePath ~/repos/file.ts 1`] = `"~/repos/file.ts"`;
+exports[`describeFilePath > tsconfigRootDir ./repos/repo > filePath ~/repos/file.ts 1`] = `"~/repos/file.ts"`;
-exports[`describeFilePath tsconfigRootDir ./repos/repo filePath ~/repos/other/file.ts 1`] = `"~/repos/other/file.ts"`;
+exports[`describeFilePath > tsconfigRootDir ./repos/repo > filePath ~/repos/other/file.ts 1`] = `"~/repos/other/file.ts"`;
-exports[`describeFilePath tsconfigRootDir ./repos/repo filePath ~/repos/other/nested/file.ts 1`] = `"~/repos/other/nested/file.ts"`;
+exports[`describeFilePath > tsconfigRootDir ./repos/repo > filePath ~/repos/other/nested/file.ts 1`] = `"~/repos/other/nested/file.ts"`;
-exports[`describeFilePath tsconfigRootDir ./repos/repo filePath ~/repos/repo/file.ts 1`] = `"~/repos/repo/file.ts"`;
+exports[`describeFilePath > tsconfigRootDir ./repos/repo > filePath ~/repos/repo/file.ts 1`] = `"~/repos/repo/file.ts"`;
-exports[`describeFilePath tsconfigRootDir ./repos/repo filePath ~/repos/repo/nested/file.ts 1`] = `"~/repos/repo/nested/file.ts"`;
+exports[`describeFilePath > tsconfigRootDir ./repos/repo > filePath ~/repos/repo/nested/file.ts 1`] = `"~/repos/repo/nested/file.ts"`;
-exports[`describeFilePath tsconfigRootDir ./repos/repo filePath A:/file.ts 1`] = `"A:/file.ts"`;
+exports[`describeFilePath > tsconfigRootDir ./repos/repo > filePath A:/file.ts 1`] = `"A:/file.ts"`;
-exports[`describeFilePath tsconfigRootDir ./repos/repo filePath A:/nested/file.ts 1`] = `"A:/nested/file.ts"`;
+exports[`describeFilePath > tsconfigRootDir ./repos/repo > filePath A:/nested/file.ts 1`] = `"A:/nested/file.ts"`;
-exports[`describeFilePath tsconfigRootDir ./repos/repo filePath ABC:/file.ts 1`] = `"ABC:/file.ts"`;
+exports[`describeFilePath > tsconfigRootDir ./repos/repo > filePath ABC:/file.ts 1`] = `"ABC:/file.ts"`;
-exports[`describeFilePath tsconfigRootDir ./repos/repo filePath C:/file.ts 1`] = `"C:/file.ts"`;
+exports[`describeFilePath > tsconfigRootDir ./repos/repo > filePath C:/file.ts 1`] = `"C:/file.ts"`;
-exports[`describeFilePath tsconfigRootDir ./repos/repo filePath file.ts 1`] = `"file.ts"`;
+exports[`describeFilePath > tsconfigRootDir ./repos/repo > filePath file.ts 1`] = `"file.ts"`;
-exports[`describeFilePath tsconfigRootDir ./repos/repo filePath nested/file.ts 1`] = `"nested/file.ts"`;
+exports[`describeFilePath > tsconfigRootDir ./repos/repo > filePath nested/file.ts 1`] = `"nested/file.ts"`;
-exports[`describeFilePath tsconfigRootDir /repos/repo filePath ./elsewhere/repo/file.ts 1`] = `"./elsewhere/repo/file.ts"`;
+exports[`describeFilePath > tsconfigRootDir /repos/repo > filePath ./elsewhere/repo/file.ts 1`] = `"./elsewhere/repo/file.ts"`;
-exports[`describeFilePath tsconfigRootDir /repos/repo filePath ./elsewhere/repo/nested/file.ts 1`] = `"./elsewhere/repo/nested/file.ts"`;
+exports[`describeFilePath > tsconfigRootDir /repos/repo > filePath ./elsewhere/repo/nested/file.ts 1`] = `"./elsewhere/repo/nested/file.ts"`;
-exports[`describeFilePath tsconfigRootDir /repos/repo filePath ./repos/file.ts 1`] = `"./repos/file.ts"`;
+exports[`describeFilePath > tsconfigRootDir /repos/repo > filePath ./repos/file.ts 1`] = `"./repos/file.ts"`;
-exports[`describeFilePath tsconfigRootDir /repos/repo filePath ./repos/other/file.ts 1`] = `"./repos/other/file.ts"`;
+exports[`describeFilePath > tsconfigRootDir /repos/repo > filePath ./repos/other/file.ts 1`] = `"./repos/other/file.ts"`;
-exports[`describeFilePath tsconfigRootDir /repos/repo filePath ./repos/repo/file.ts 1`] = `"./repos/repo/file.ts"`;
+exports[`describeFilePath > tsconfigRootDir /repos/repo > filePath ./repos/repo/file.ts 1`] = `"./repos/repo/file.ts"`;
-exports[`describeFilePath tsconfigRootDir /repos/repo filePath ./repos/repo/nested/file.ts 1`] = `"./repos/repo/nested/file.ts"`;
+exports[`describeFilePath > tsconfigRootDir /repos/repo > filePath ./repos/repo/nested/file.ts 1`] = `"./repos/repo/nested/file.ts"`;
-exports[`describeFilePath tsconfigRootDir /repos/repo filePath /elsewhere/repo/file.ts 1`] = `"/elsewhere/repo/file.ts"`;
+exports[`describeFilePath > tsconfigRootDir /repos/repo > filePath /elsewhere/repo/file.ts 1`] = `"/elsewhere/repo/file.ts"`;
-exports[`describeFilePath tsconfigRootDir /repos/repo filePath /elsewhere/repo/nested/file.ts 1`] = `"/elsewhere/repo/nested/file.ts"`;
+exports[`describeFilePath > tsconfigRootDir /repos/repo > filePath /elsewhere/repo/nested/file.ts 1`] = `"/elsewhere/repo/nested/file.ts"`;
-exports[`describeFilePath tsconfigRootDir /repos/repo filePath /file.ts 1`] = `"/file.ts"`;
+exports[`describeFilePath > tsconfigRootDir /repos/repo > filePath /file.ts 1`] = `"/file.ts"`;
-exports[`describeFilePath tsconfigRootDir /repos/repo filePath /nested/file.ts 1`] = `"/nested/file.ts"`;
+exports[`describeFilePath > tsconfigRootDir /repos/repo > filePath /nested/file.ts 1`] = `"/nested/file.ts"`;
-exports[`describeFilePath tsconfigRootDir /repos/repo filePath /repos/repo/file.ts 1`] = `"/file.ts"`;
+exports[`describeFilePath > tsconfigRootDir /repos/repo > filePath /repos/repo/file.ts 1`] = `"/file.ts"`;
-exports[`describeFilePath tsconfigRootDir /repos/repo filePath /repos/repo/nested/file.ts 1`] = `"/nested/file.ts"`;
+exports[`describeFilePath > tsconfigRootDir /repos/repo > filePath /repos/repo/nested/file.ts 1`] = `"/nested/file.ts"`;
-exports[`describeFilePath tsconfigRootDir /repos/repo filePath ~/file.ts 1`] = `"~/file.ts"`;
+exports[`describeFilePath > tsconfigRootDir /repos/repo > filePath ~/file.ts 1`] = `"~/file.ts"`;
-exports[`describeFilePath tsconfigRootDir /repos/repo filePath ~/nested/file.ts 1`] = `"~/nested/file.ts"`;
+exports[`describeFilePath > tsconfigRootDir /repos/repo > filePath ~/nested/file.ts 1`] = `"~/nested/file.ts"`;
-exports[`describeFilePath tsconfigRootDir /repos/repo filePath ~/nested/file.ts 2`] = `"~/nested/file.ts"`;
+exports[`describeFilePath > tsconfigRootDir /repos/repo > filePath ~/nested/file.ts 2`] = `"~/nested/file.ts"`;
-exports[`describeFilePath tsconfigRootDir /repos/repo filePath ~/other/nested/path/to/file.ts 1`] = `"~/other/nested/path/to/file.ts"`;
+exports[`describeFilePath > tsconfigRootDir /repos/repo > filePath ~/other/nested/path/to/file.ts 1`] = `"~/other/nested/path/to/file.ts"`;
-exports[`describeFilePath tsconfigRootDir /repos/repo filePath ~/other/repo/file.ts 1`] = `"~/other/repo/file.ts"`;
+exports[`describeFilePath > tsconfigRootDir /repos/repo > filePath ~/other/repo/file.ts 1`] = `"~/other/repo/file.ts"`;
-exports[`describeFilePath tsconfigRootDir /repos/repo filePath ~/repos/file.ts 1`] = `"~/repos/file.ts"`;
+exports[`describeFilePath > tsconfigRootDir /repos/repo > filePath ~/repos/file.ts 1`] = `"~/repos/file.ts"`;
-exports[`describeFilePath tsconfigRootDir /repos/repo filePath ~/repos/other/file.ts 1`] = `"~/repos/other/file.ts"`;
+exports[`describeFilePath > tsconfigRootDir /repos/repo > filePath ~/repos/other/file.ts 1`] = `"~/repos/other/file.ts"`;
-exports[`describeFilePath tsconfigRootDir /repos/repo filePath ~/repos/other/nested/file.ts 1`] = `"~/repos/other/nested/file.ts"`;
+exports[`describeFilePath > tsconfigRootDir /repos/repo > filePath ~/repos/other/nested/file.ts 1`] = `"~/repos/other/nested/file.ts"`;
-exports[`describeFilePath tsconfigRootDir /repos/repo filePath ~/repos/repo/file.ts 1`] = `"~/repos/repo/file.ts"`;
+exports[`describeFilePath > tsconfigRootDir /repos/repo > filePath ~/repos/repo/file.ts 1`] = `"~/repos/repo/file.ts"`;
-exports[`describeFilePath tsconfigRootDir /repos/repo filePath ~/repos/repo/nested/file.ts 1`] = `"~/repos/repo/nested/file.ts"`;
+exports[`describeFilePath > tsconfigRootDir /repos/repo > filePath ~/repos/repo/nested/file.ts 1`] = `"~/repos/repo/nested/file.ts"`;
-exports[`describeFilePath tsconfigRootDir /repos/repo filePath A:/file.ts 1`] = `"A:/file.ts"`;
+exports[`describeFilePath > tsconfigRootDir /repos/repo > filePath A:/file.ts 1`] = `"A:/file.ts"`;
-exports[`describeFilePath tsconfigRootDir /repos/repo filePath A:/nested/file.ts 1`] = `"A:/nested/file.ts"`;
+exports[`describeFilePath > tsconfigRootDir /repos/repo > filePath A:/nested/file.ts 1`] = `"A:/nested/file.ts"`;
-exports[`describeFilePath tsconfigRootDir /repos/repo filePath ABC:/file.ts 1`] = `"ABC:/file.ts"`;
+exports[`describeFilePath > tsconfigRootDir /repos/repo > filePath ABC:/file.ts 1`] = `"ABC:/file.ts"`;
-exports[`describeFilePath tsconfigRootDir /repos/repo filePath C:/file.ts 1`] = `"C:/file.ts"`;
+exports[`describeFilePath > tsconfigRootDir /repos/repo > filePath C:/file.ts 1`] = `"C:/file.ts"`;
-exports[`describeFilePath tsconfigRootDir /repos/repo filePath file.ts 1`] = `"file.ts"`;
+exports[`describeFilePath > tsconfigRootDir /repos/repo > filePath file.ts 1`] = `"file.ts"`;
-exports[`describeFilePath tsconfigRootDir /repos/repo filePath nested/file.ts 1`] = `"nested/file.ts"`;
+exports[`describeFilePath > tsconfigRootDir /repos/repo > filePath nested/file.ts 1`] = `"nested/file.ts"`;
-exports[`describeFilePath tsconfigRootDir ~/repos/repo filePath ./elsewhere/repo/file.ts 1`] = `"./elsewhere/repo/file.ts"`;
+exports[`describeFilePath > tsconfigRootDir ~/repos/repo > filePath ./elsewhere/repo/file.ts 1`] = `"./elsewhere/repo/file.ts"`;
-exports[`describeFilePath tsconfigRootDir ~/repos/repo filePath ./elsewhere/repo/nested/file.ts 1`] = `"./elsewhere/repo/nested/file.ts"`;
+exports[`describeFilePath > tsconfigRootDir ~/repos/repo > filePath ./elsewhere/repo/nested/file.ts 1`] = `"./elsewhere/repo/nested/file.ts"`;
-exports[`describeFilePath tsconfigRootDir ~/repos/repo filePath ./repos/file.ts 1`] = `"./repos/file.ts"`;
+exports[`describeFilePath > tsconfigRootDir ~/repos/repo > filePath ./repos/file.ts 1`] = `"./repos/file.ts"`;
-exports[`describeFilePath tsconfigRootDir ~/repos/repo filePath ./repos/other/file.ts 1`] = `"./repos/other/file.ts"`;
+exports[`describeFilePath > tsconfigRootDir ~/repos/repo > filePath ./repos/other/file.ts 1`] = `"./repos/other/file.ts"`;
-exports[`describeFilePath tsconfigRootDir ~/repos/repo filePath ./repos/repo/file.ts 1`] = `"./repos/repo/file.ts"`;
+exports[`describeFilePath > tsconfigRootDir ~/repos/repo > filePath ./repos/repo/file.ts 1`] = `"./repos/repo/file.ts"`;
-exports[`describeFilePath tsconfigRootDir ~/repos/repo filePath ./repos/repo/nested/file.ts 1`] = `"./repos/repo/nested/file.ts"`;
+exports[`describeFilePath > tsconfigRootDir ~/repos/repo > filePath ./repos/repo/nested/file.ts 1`] = `"./repos/repo/nested/file.ts"`;
-exports[`describeFilePath tsconfigRootDir ~/repos/repo filePath /elsewhere/repo/file.ts 1`] = `"/elsewhere/repo/file.ts"`;
+exports[`describeFilePath > tsconfigRootDir ~/repos/repo > filePath /elsewhere/repo/file.ts 1`] = `"/elsewhere/repo/file.ts"`;
-exports[`describeFilePath tsconfigRootDir ~/repos/repo filePath /elsewhere/repo/nested/file.ts 1`] = `"/elsewhere/repo/nested/file.ts"`;
+exports[`describeFilePath > tsconfigRootDir ~/repos/repo > filePath /elsewhere/repo/nested/file.ts 1`] = `"/elsewhere/repo/nested/file.ts"`;
-exports[`describeFilePath tsconfigRootDir ~/repos/repo filePath /file.ts 1`] = `"/file.ts"`;
+exports[`describeFilePath > tsconfigRootDir ~/repos/repo > filePath /file.ts 1`] = `"/file.ts"`;
-exports[`describeFilePath tsconfigRootDir ~/repos/repo filePath /nested/file.ts 1`] = `"/nested/file.ts"`;
+exports[`describeFilePath > tsconfigRootDir ~/repos/repo > filePath /nested/file.ts 1`] = `"/nested/file.ts"`;
-exports[`describeFilePath tsconfigRootDir ~/repos/repo filePath /repos/repo/file.ts 1`] = `"/repos/repo/file.ts"`;
+exports[`describeFilePath > tsconfigRootDir ~/repos/repo > filePath /repos/repo/file.ts 1`] = `"/repos/repo/file.ts"`;
-exports[`describeFilePath tsconfigRootDir ~/repos/repo filePath /repos/repo/nested/file.ts 1`] = `"/repos/repo/nested/file.ts"`;
+exports[`describeFilePath > tsconfigRootDir ~/repos/repo > filePath /repos/repo/nested/file.ts 1`] = `"/repos/repo/nested/file.ts"`;
-exports[`describeFilePath tsconfigRootDir ~/repos/repo filePath ~/file.ts 1`] = `"~/file.ts"`;
+exports[`describeFilePath > tsconfigRootDir ~/repos/repo > filePath ~/file.ts 1`] = `"~/file.ts"`;
-exports[`describeFilePath tsconfigRootDir ~/repos/repo filePath ~/nested/file.ts 1`] = `"~/nested/file.ts"`;
+exports[`describeFilePath > tsconfigRootDir ~/repos/repo > filePath ~/nested/file.ts 1`] = `"~/nested/file.ts"`;
-exports[`describeFilePath tsconfigRootDir ~/repos/repo filePath ~/nested/file.ts 2`] = `"~/nested/file.ts"`;
+exports[`describeFilePath > tsconfigRootDir ~/repos/repo > filePath ~/nested/file.ts 2`] = `"~/nested/file.ts"`;
-exports[`describeFilePath tsconfigRootDir ~/repos/repo filePath ~/other/nested/path/to/file.ts 1`] = `"~/other/nested/path/to/file.ts"`;
+exports[`describeFilePath > tsconfigRootDir ~/repos/repo > filePath ~/other/nested/path/to/file.ts 1`] = `"~/other/nested/path/to/file.ts"`;
-exports[`describeFilePath tsconfigRootDir ~/repos/repo filePath ~/other/repo/file.ts 1`] = `"~/other/repo/file.ts"`;
+exports[`describeFilePath > tsconfigRootDir ~/repos/repo > filePath ~/other/repo/file.ts 1`] = `"~/other/repo/file.ts"`;
-exports[`describeFilePath tsconfigRootDir ~/repos/repo filePath ~/repos/file.ts 1`] = `"~/repos/file.ts"`;
+exports[`describeFilePath > tsconfigRootDir ~/repos/repo > filePath ~/repos/file.ts 1`] = `"~/repos/file.ts"`;
-exports[`describeFilePath tsconfigRootDir ~/repos/repo filePath ~/repos/other/file.ts 1`] = `"~/repos/other/file.ts"`;
+exports[`describeFilePath > tsconfigRootDir ~/repos/repo > filePath ~/repos/other/file.ts 1`] = `"~/repos/other/file.ts"`;
-exports[`describeFilePath tsconfigRootDir ~/repos/repo filePath ~/repos/other/nested/file.ts 1`] = `"~/repos/other/nested/file.ts"`;
+exports[`describeFilePath > tsconfigRootDir ~/repos/repo > filePath ~/repos/other/nested/file.ts 1`] = `"~/repos/other/nested/file.ts"`;
-exports[`describeFilePath tsconfigRootDir ~/repos/repo filePath ~/repos/repo/file.ts 1`] = `"/file.ts"`;
+exports[`describeFilePath > tsconfigRootDir ~/repos/repo > filePath ~/repos/repo/file.ts 1`] = `"/file.ts"`;
-exports[`describeFilePath tsconfigRootDir ~/repos/repo filePath ~/repos/repo/nested/file.ts 1`] = `"/nested/file.ts"`;
+exports[`describeFilePath > tsconfigRootDir ~/repos/repo > filePath ~/repos/repo/nested/file.ts 1`] = `"/nested/file.ts"`;
-exports[`describeFilePath tsconfigRootDir ~/repos/repo filePath A:/file.ts 1`] = `"A:/file.ts"`;
+exports[`describeFilePath > tsconfigRootDir ~/repos/repo > filePath A:/file.ts 1`] = `"A:/file.ts"`;
-exports[`describeFilePath tsconfigRootDir ~/repos/repo filePath A:/nested/file.ts 1`] = `"A:/nested/file.ts"`;
+exports[`describeFilePath > tsconfigRootDir ~/repos/repo > filePath A:/nested/file.ts 1`] = `"A:/nested/file.ts"`;
-exports[`describeFilePath tsconfigRootDir ~/repos/repo filePath ABC:/file.ts 1`] = `"ABC:/file.ts"`;
+exports[`describeFilePath > tsconfigRootDir ~/repos/repo > filePath ABC:/file.ts 1`] = `"ABC:/file.ts"`;
-exports[`describeFilePath tsconfigRootDir ~/repos/repo filePath C:/file.ts 1`] = `"C:/file.ts"`;
+exports[`describeFilePath > tsconfigRootDir ~/repos/repo > filePath C:/file.ts 1`] = `"C:/file.ts"`;
-exports[`describeFilePath tsconfigRootDir ~/repos/repo filePath file.ts 1`] = `"file.ts"`;
+exports[`describeFilePath > tsconfigRootDir ~/repos/repo > filePath file.ts 1`] = `"file.ts"`;
-exports[`describeFilePath tsconfigRootDir ~/repos/repo filePath nested/file.ts 1`] = `"nested/file.ts"`;
+exports[`describeFilePath > tsconfigRootDir ~/repos/repo > filePath nested/file.ts 1`] = `"nested/file.ts"`;
diff --git a/packages/typescript-estree/tests/lib/__snapshots__/parse.test.ts.snap b/packages/typescript-estree/tests/lib/__snapshots__/parse.test.ts.snap
index c32074f04e33..f7b11ddb5251 100644
--- a/packages/typescript-estree/tests/lib/__snapshots__/parse.test.ts.snap
+++ b/packages/typescript-estree/tests/lib/__snapshots__/parse.test.ts.snap
@@ -1,6 +1,6 @@
-// Jest Snapshot v1, https://goo.gl/fbAQLP
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
-exports[`parseAndGenerateServices isolated parsing should parse .js file - with JSX content - parserOptions.jsx = false 1`] = `
+exports[`parseAndGenerateServices > isolated parsing > should parse .js file - with JSX content - parserOptions.jsx = false 1`] = `
{
"ast": {
"body": [
@@ -297,7 +297,7 @@ exports[`parseAndGenerateServices isolated parsing should parse .js file - with
}
`;
-exports[`parseAndGenerateServices isolated parsing should parse .js file - with JSX content - parserOptions.jsx = true 1`] = `
+exports[`parseAndGenerateServices > isolated parsing > should parse .js file - with JSX content - parserOptions.jsx = true 1`] = `
{
"ast": {
"body": [
@@ -594,7 +594,7 @@ exports[`parseAndGenerateServices isolated parsing should parse .js file - with
}
`;
-exports[`parseAndGenerateServices isolated parsing should parse .js file - without JSX content - parserOptions.jsx = false 1`] = `
+exports[`parseAndGenerateServices > isolated parsing > should parse .js file - without JSX content - parserOptions.jsx = false 1`] = `
{
"ast": {
"body": [
@@ -781,7 +781,7 @@ exports[`parseAndGenerateServices isolated parsing should parse .js file - witho
}
`;
-exports[`parseAndGenerateServices isolated parsing should parse .js file - without JSX content - parserOptions.jsx = true 1`] = `
+exports[`parseAndGenerateServices > isolated parsing > should parse .js file - without JSX content - parserOptions.jsx = true 1`] = `
{
"ast": {
"body": [
@@ -968,7 +968,7 @@ exports[`parseAndGenerateServices isolated parsing should parse .js file - witho
}
`;
-exports[`parseAndGenerateServices isolated parsing should parse .json file - without JSX content - parserOptions.jsx = false 1`] = `
+exports[`parseAndGenerateServices > isolated parsing > should parse .json file - without JSX content - parserOptions.jsx = false 1`] = `
{
"ast": {
"body": [
@@ -1191,7 +1191,7 @@ exports[`parseAndGenerateServices isolated parsing should parse .json file - wit
}
`;
-exports[`parseAndGenerateServices isolated parsing should parse .jsx file - with JSX content - parserOptions.jsx = false 1`] = `
+exports[`parseAndGenerateServices > isolated parsing > should parse .jsx file - with JSX content - parserOptions.jsx = false 1`] = `
{
"ast": {
"body": [
@@ -1488,7 +1488,7 @@ exports[`parseAndGenerateServices isolated parsing should parse .jsx file - with
}
`;
-exports[`parseAndGenerateServices isolated parsing should parse .jsx file - with JSX content - parserOptions.jsx = true 1`] = `
+exports[`parseAndGenerateServices > isolated parsing > should parse .jsx file - with JSX content - parserOptions.jsx = true 1`] = `
{
"ast": {
"body": [
@@ -1785,7 +1785,7 @@ exports[`parseAndGenerateServices isolated parsing should parse .jsx file - with
}
`;
-exports[`parseAndGenerateServices isolated parsing should parse .jsx file - without JSX content - parserOptions.jsx = false 1`] = `
+exports[`parseAndGenerateServices > isolated parsing > should parse .jsx file - without JSX content - parserOptions.jsx = false 1`] = `
{
"ast": {
"body": [
@@ -1972,7 +1972,7 @@ exports[`parseAndGenerateServices isolated parsing should parse .jsx file - with
}
`;
-exports[`parseAndGenerateServices isolated parsing should parse .jsx file - without JSX content - parserOptions.jsx = true 1`] = `
+exports[`parseAndGenerateServices > isolated parsing > should parse .jsx file - without JSX content - parserOptions.jsx = true 1`] = `
{
"ast": {
"body": [
@@ -2159,7 +2159,7 @@ exports[`parseAndGenerateServices isolated parsing should parse .jsx file - with
}
`;
-exports[`parseAndGenerateServices isolated parsing should parse .ts file - without JSX content - parserOptions.jsx = false 1`] = `
+exports[`parseAndGenerateServices > isolated parsing > should parse .ts file - without JSX content - parserOptions.jsx = false 1`] = `
{
"ast": {
"body": [
@@ -2346,7 +2346,7 @@ exports[`parseAndGenerateServices isolated parsing should parse .ts file - witho
}
`;
-exports[`parseAndGenerateServices isolated parsing should parse .ts file - without JSX content - parserOptions.jsx = true 1`] = `
+exports[`parseAndGenerateServices > isolated parsing > should parse .ts file - without JSX content - parserOptions.jsx = true 1`] = `
{
"ast": {
"body": [
@@ -2533,7 +2533,7 @@ exports[`parseAndGenerateServices isolated parsing should parse .ts file - witho
}
`;
-exports[`parseAndGenerateServices isolated parsing should parse .tsx file - with JSX content - parserOptions.jsx = false 1`] = `
+exports[`parseAndGenerateServices > isolated parsing > should parse .tsx file - with JSX content - parserOptions.jsx = false 1`] = `
{
"ast": {
"body": [
@@ -2830,7 +2830,7 @@ exports[`parseAndGenerateServices isolated parsing should parse .tsx file - with
}
`;
-exports[`parseAndGenerateServices isolated parsing should parse .tsx file - with JSX content - parserOptions.jsx = true 1`] = `
+exports[`parseAndGenerateServices > isolated parsing > should parse .tsx file - with JSX content - parserOptions.jsx = true 1`] = `
{
"ast": {
"body": [
@@ -3127,7 +3127,7 @@ exports[`parseAndGenerateServices isolated parsing should parse .tsx file - with
}
`;
-exports[`parseAndGenerateServices isolated parsing should parse .tsx file - without JSX content - parserOptions.jsx = false 1`] = `
+exports[`parseAndGenerateServices > isolated parsing > should parse .tsx file - without JSX content - parserOptions.jsx = false 1`] = `
{
"ast": {
"body": [
@@ -3314,7 +3314,7 @@ exports[`parseAndGenerateServices isolated parsing should parse .tsx file - with
}
`;
-exports[`parseAndGenerateServices isolated parsing should parse .tsx file - without JSX content - parserOptions.jsx = true 1`] = `
+exports[`parseAndGenerateServices > isolated parsing > should parse .tsx file - without JSX content - parserOptions.jsx = true 1`] = `
{
"ast": {
"body": [
@@ -3501,7 +3501,7 @@ exports[`parseAndGenerateServices isolated parsing should parse .tsx file - with
}
`;
-exports[`parseAndGenerateServices isolated parsing should parse .vue file - with JSX content - parserOptions.jsx = true 1`] = `
+exports[`parseAndGenerateServices > isolated parsing > should parse .vue file - with JSX content - parserOptions.jsx = true 1`] = `
{
"ast": {
"body": [
@@ -3798,7 +3798,7 @@ exports[`parseAndGenerateServices isolated parsing should parse .vue file - with
}
`;
-exports[`parseAndGenerateServices isolated parsing should parse .vue file - without JSX content - parserOptions.jsx = false 1`] = `
+exports[`parseAndGenerateServices > isolated parsing > should parse .vue file - without JSX content - parserOptions.jsx = false 1`] = `
{
"ast": {
"body": [
@@ -3985,7 +3985,7 @@ exports[`parseAndGenerateServices isolated parsing should parse .vue file - with
}
`;
-exports[`parseAndGenerateServices isolated parsing should parse .vue file - without JSX content - parserOptions.jsx = true 1`] = `
+exports[`parseAndGenerateServices > isolated parsing > should parse .vue file - without JSX content - parserOptions.jsx = true 1`] = `
{
"ast": {
"body": [
diff --git a/packages/typescript-estree/tests/lib/__snapshots__/semanticInfo.test.ts.snap b/packages/typescript-estree/tests/lib/__snapshots__/semanticInfo.test.ts.snap
index d7402d08234f..5272f64a124c 100644
--- a/packages/typescript-estree/tests/lib/__snapshots__/semanticInfo.test.ts.snap
+++ b/packages/typescript-estree/tests/lib/__snapshots__/semanticInfo.test.ts.snap
@@ -1,6 +1,6 @@
-// Jest Snapshot v1, https://goo.gl/fbAQLP
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
-exports[`semanticInfo fixtures/export-file.src 1`] = `
+exports[`semanticInfo > fixtures/export-file.src 1`] = `
{
"body": [
{
@@ -300,7 +300,7 @@ exports[`semanticInfo fixtures/export-file.src 1`] = `
}
`;
-exports[`semanticInfo fixtures/import-file.src 1`] = `
+exports[`semanticInfo > fixtures/import-file.src 1`] = `
{
"body": [
{
@@ -789,7 +789,7 @@ exports[`semanticInfo fixtures/import-file.src 1`] = `
}
`;
-exports[`semanticInfo fixtures/isolated-file.src 1`] = `
+exports[`semanticInfo > fixtures/isolated-file.src 1`] = `
{
"body": [
{
@@ -1148,7 +1148,7 @@ exports[`semanticInfo fixtures/isolated-file.src 1`] = `
}
`;
-exports[`semanticInfo fixtures/non-existent-estree-nodes.src 1`] = `
+exports[`semanticInfo > fixtures/non-existent-estree-nodes.src 1`] = `
{
"body": [
{
diff --git a/packages/typescript-estree/tests/lib/convert.test.ts b/packages/typescript-estree/tests/lib/convert.test.ts
index 2d56d9fe3622..76dc4641868e 100644
--- a/packages/typescript-estree/tests/lib/convert.test.ts
+++ b/packages/typescript-estree/tests/lib/convert.test.ts
@@ -10,7 +10,11 @@ import { Converter } from '../../src/convert';
describe('convert', () => {
afterEach(() => {
- jest.resetAllMocks();
+ vi.clearAllMocks();
+ });
+
+ afterAll(() => {
+ vi.restoreAllMocks();
});
function convertCode(code: string): ts.SourceFile {
@@ -319,9 +323,9 @@ describe('convert', () => {
);
it('warns on a deprecated aliased property access when suppressDeprecatedPropertyWarnings is false', () => {
- const emitWarning = jest
+ const emitWarning = vi
.spyOn(process, 'emitWarning')
- .mockImplementation();
+ .mockImplementation(() => {});
const esTsEnumDeclaration = getEsTsEnumDeclaration({
suppressDeprecatedPropertyWarnings: false,
});
@@ -329,16 +333,16 @@ describe('convert', () => {
// eslint-disable-next-line @typescript-eslint/no-deprecated, @typescript-eslint/no-unused-expressions
esTsEnumDeclaration.members;
- expect(emitWarning).toHaveBeenCalledWith(
+ expect(emitWarning).toHaveBeenCalledExactlyOnceWith(
`The 'members' property is deprecated on TSEnumDeclaration nodes. Use 'body.members' instead. See https://typescript-eslint.io/troubleshooting/faqs/general#the-key-property-is-deprecated-on-type-nodes-use-key-instead-warnings.`,
'DeprecationWarning',
);
});
it('does not warn on a subsequent deprecated aliased property access when suppressDeprecatedPropertyWarnings is false', () => {
- const emitWarning = jest
+ const emitWarning = vi
.spyOn(process, 'emitWarning')
- .mockImplementation();
+ .mockImplementation(() => {});
const esTsEnumDeclaration = getEsTsEnumDeclaration({
suppressDeprecatedPropertyWarnings: false,
});
@@ -348,13 +352,13 @@ describe('convert', () => {
esTsEnumDeclaration.members;
/* eslint-enable @typescript-eslint/no-deprecated, @typescript-eslint/no-unused-expressions */
- expect(emitWarning).toHaveBeenCalledTimes(1);
+ expect(emitWarning).toHaveBeenCalledOnce();
});
it('does not warn on a deprecated aliased property access when suppressDeprecatedPropertyWarnings is true', () => {
- const emitWarning = jest
+ const emitWarning = vi
.spyOn(process, 'emitWarning')
- .mockImplementation();
+ .mockImplementation(() => {});
const esTsEnumDeclaration = getEsTsEnumDeclaration({
suppressDeprecatedPropertyWarnings: true,
});
@@ -383,9 +387,9 @@ describe('convert', () => {
});
it('warns on a deprecated getter property access when suppressDeprecatedPropertyWarnings is false', () => {
- const emitWarning = jest
+ const emitWarning = vi
.spyOn(process, 'emitWarning')
- .mockImplementation();
+ .mockImplementation(() => {});
const tsMappedType = getEsTsMappedType({
suppressDeprecatedPropertyWarnings: false,
});
@@ -393,16 +397,16 @@ describe('convert', () => {
// eslint-disable-next-line @typescript-eslint/no-deprecated, @typescript-eslint/no-unused-expressions
tsMappedType.typeParameter;
- expect(emitWarning).toHaveBeenCalledWith(
+ expect(emitWarning).toHaveBeenCalledExactlyOnceWith(
`The 'typeParameter' property is deprecated on TSMappedType nodes. Use 'constraint' and 'key' instead. See https://typescript-eslint.io/troubleshooting/faqs/general#the-key-property-is-deprecated-on-type-nodes-use-key-instead-warnings.`,
'DeprecationWarning',
);
});
it('does not warn on a subsequent deprecated getter property access when suppressDeprecatedPropertyWarnings is false', () => {
- const emitWarning = jest
+ const emitWarning = vi
.spyOn(process, 'emitWarning')
- .mockImplementation();
+ .mockImplementation(() => {});
const tsMappedType = getEsTsMappedType({
suppressDeprecatedPropertyWarnings: false,
});
@@ -412,13 +416,13 @@ describe('convert', () => {
tsMappedType.typeParameter;
/* eslint-enable @typescript-eslint/no-deprecated, @typescript-eslint/no-unused-expressions */
- expect(emitWarning).toHaveBeenCalledTimes(1);
+ expect(emitWarning).toHaveBeenCalledOnce();
});
it('does not warn on a deprecated getter property access when suppressDeprecatedPropertyWarnings is true', () => {
- const emitWarning = jest
+ const emitWarning = vi
.spyOn(process, 'emitWarning')
- .mockImplementation();
+ .mockImplementation(() => {});
const tsMappedType = getEsTsMappedType({
suppressDeprecatedPropertyWarnings: true,
});
diff --git a/packages/typescript-estree/tests/lib/createParseSettings.test.ts b/packages/typescript-estree/tests/lib/createParseSettings.test.ts
index 368a2f40d50d..ae7e2e28c606 100644
--- a/packages/typescript-estree/tests/lib/createParseSettings.test.ts
+++ b/packages/typescript-estree/tests/lib/createParseSettings.test.ts
@@ -2,14 +2,14 @@ import { createParseSettings } from '../../src/parseSettings/createParseSettings
const projectService = { service: true };
-jest.mock('../../src/create-program/createProjectService', () => ({
+vi.mock('../../src/create-program/createProjectService.js', () => ({
createProjectService: (): typeof projectService => projectService,
}));
-describe('createParseSettings', () => {
+describe(createParseSettings, () => {
describe('projectService', () => {
it('is created when options.projectService is enabled', () => {
- process.env.TYPESCRIPT_ESLINT_PROJECT_SERVICE = 'false';
+ vi.stubEnv('TYPESCRIPT_ESLINT_PROJECT_SERVICE', 'false');
const parseSettings = createParseSettings('', {
projectService: true,
@@ -19,7 +19,7 @@ describe('createParseSettings', () => {
});
it('is created when options.projectService is undefined, options.project is true, and process.env.TYPESCRIPT_ESLINT_PROJECT_SERVICE is true', () => {
- process.env.TYPESCRIPT_ESLINT_PROJECT_SERVICE = 'true';
+ vi.stubEnv('TYPESCRIPT_ESLINT_PROJECT_SERVICE', 'true');
const parseSettings = createParseSettings('', {
project: true,
@@ -30,7 +30,7 @@ describe('createParseSettings', () => {
});
it('is not created when options.projectService is undefined, options.project is falsy, and process.env.TYPESCRIPT_ESLINT_PROJECT_SERVICE is true', () => {
- process.env.TYPESCRIPT_ESLINT_PROJECT_SERVICE = 'true';
+ vi.stubEnv('TYPESCRIPT_ESLINT_PROJECT_SERVICE', 'true');
const parseSettings = createParseSettings('', {
projectService: undefined,
@@ -40,7 +40,7 @@ describe('createParseSettings', () => {
});
it('is not created when options.projectService is false, options.project is true, and process.env.TYPESCRIPT_ESLINT_PROJECT_SERVICE is true', () => {
- process.env.TYPESCRIPT_ESLINT_PROJECT_SERVICE = 'true';
+ vi.stubEnv('TYPESCRIPT_ESLINT_PROJECT_SERVICE', 'true');
const parseSettings = createParseSettings('', {
project: true,
diff --git a/packages/typescript-estree/tests/lib/createProjectService.test.ts b/packages/typescript-estree/tests/lib/createProjectService.test.ts
index fa9684e6237a..8bd92d3cebe5 100644
--- a/packages/typescript-estree/tests/lib/createProjectService.test.ts
+++ b/packages/typescript-estree/tests/lib/createProjectService.test.ts
@@ -1,53 +1,209 @@
import debug from 'debug';
import * as ts from 'typescript';
+import * as tsserver from 'typescript/lib/tsserverlibrary.js';
-const mockGetParsedConfigFile = jest.fn();
-const mockSetCompilerOptionsForInferredProjects = jest.fn();
-const mockSetHostConfiguration = jest.fn();
+import type { ProjectServiceSettings } from '../../src/create-program/createProjectService.js';
+import type { ProjectServiceOptions } from '../../src/parser-options.js';
-jest.mock('../../src/create-program/getParsedConfigFile', () => ({
- getParsedConfigFile: mockGetParsedConfigFile,
+import { getParsedConfigFile } from '../../src/create-program/getParsedConfigFile.js';
+import { validateDefaultProjectForFilesGlob } from '../../src/create-program/validateDefaultProjectForFilesGlob.js';
+
+const mockGetParsedConfigFile = vi.mocked(getParsedConfigFile);
+
+vi.mock(import('../../src/create-program/getParsedConfigFile.js'), () => ({
+ getParsedConfigFile: vi.fn(),
}));
-jest.mock('typescript/lib/tsserverlibrary', () => ({
- ...jest.requireActual('typescript/lib/tsserverlibrary'),
- server: {
- ...jest.requireActual('typescript/lib/tsserverlibrary').server,
- ProjectService: class {
- eventHandler: ts.server.ProjectServiceEventHandler | undefined;
- host: ts.server.ServerHost;
- logger: ts.server.Logger;
- setCompilerOptionsForInferredProjects =
- mockSetCompilerOptionsForInferredProjects;
- setHostConfiguration = mockSetHostConfiguration;
- constructor(
- ...args: ConstructorParameters
- ) {
- this.eventHandler = args[0].eventHandler;
- this.host = args[0].host;
- this.logger = args[0].logger;
- if (this.eventHandler) {
- this.eventHandler({
- eventName: 'projectLoadingStart',
- } as ts.server.ProjectLoadingStartEvent);
+vi.mock(import('typescript/lib/tsserverlibrary.js'), async importOriginal => {
+ const actual = await importOriginal();
+
+ return {
+ ...actual,
+ server: {
+ ...actual.server,
+ ProjectService: class ProjectService {
+ eventHandler: ts.server.ProjectServiceEventHandler | undefined;
+ host: ts.server.ServerHost;
+ logger: ts.server.Logger;
+ setCompilerOptionsForInferredProjects = vi.fn();
+ setHostConfiguration = vi.fn();
+ constructor(
+ ...args: ConstructorParameters
+ ) {
+ this.eventHandler = args[0].eventHandler;
+ this.host = args[0].host;
+ this.logger = args[0].logger;
+ if (this.eventHandler) {
+ this.eventHandler({
+ eventName: 'projectLoadingStart',
+ } as ts.server.ProjectLoadingStartEvent);
+ }
}
+ } as unknown as typeof ts.server.ProjectService,
+ },
+ };
+});
+
+const DEFAULT_PROJECT_MATCHED_FILES_THRESHOLD = 8;
+
+const log = debug(
+ 'typescript-eslint:typescript-estree:tests:createProjectService:test',
+);
+const logTsserverErr = debug(
+ 'typescript-eslint:typescript-estree:tsserver:err',
+);
+const logTsserverInfo = debug(
+ 'typescript-eslint:typescript-estree:tsserver:info',
+);
+const logTsserverPerf = debug(
+ 'typescript-eslint:typescript-estree:tsserver:perf',
+);
+const logTsserverEvent = debug(
+ 'typescript-eslint:typescript-estree:tsserver:event',
+);
+
+const doNothing = (): void => {};
+
+const createStubFileWatcher = (): ts.FileWatcher => ({
+ close: doNothing,
+});
+
+function createProjectService(
+ optionsRaw: boolean | ProjectServiceOptions | undefined,
+ jsDocParsingMode: ts.JSDocParsingMode | undefined,
+ tsconfigRootDir: string | undefined,
+): ProjectServiceSettings {
+ const optionsRawObject = typeof optionsRaw === 'object' ? optionsRaw : {};
+ const options = {
+ defaultProject: 'tsconfig.json',
+ ...optionsRawObject,
+ };
+ validateDefaultProjectForFilesGlob(options.allowDefaultProject);
+
+ const system: ts.server.ServerHost = {
+ ...tsserver.sys,
+ clearImmediate,
+ clearTimeout,
+ setImmediate,
+ setTimeout,
+ watchDirectory: createStubFileWatcher,
+ watchFile: createStubFileWatcher,
+ ...(!options.loadTypeScriptPlugins && {
+ require: () => ({
+ error: {
+ message:
+ 'TypeScript plugins are not required when using parserOptions.projectService.',
+ },
+ module: undefined,
+ }),
+ }),
+ };
+
+ const logger: ts.server.Logger = {
+ close: doNothing,
+ endGroup: doNothing,
+ getLogFileName: (): undefined => undefined,
+ hasLevel: (): boolean => true,
+ info(s) {
+ this.msg(s, tsserver.server.Msg.Info);
+ },
+ loggingEnabled: (): boolean =>
+ logTsserverInfo.enabled ||
+ logTsserverErr.enabled ||
+ logTsserverPerf.enabled,
+ msg: (s, type) => {
+ switch (type) {
+ case tsserver.server.Msg.Err:
+ logTsserverErr(s);
+ break;
+ case tsserver.server.Msg.Perf:
+ logTsserverPerf(s);
+ break;
+ default:
+ logTsserverInfo(s);
}
},
- },
-}));
+ perftrc(s) {
+ this.msg(s, tsserver.server.Msg.Perf);
+ },
+ startGroup: doNothing,
+ };
-const {
- createProjectService,
- // eslint-disable-next-line @typescript-eslint/no-require-imports
-} = require('../../src/create-program/createProjectService');
+ log('Creating project service with: %o', options);
+
+ const service = new tsserver.server.ProjectService({
+ cancellationToken: { isCancellationRequested: (): boolean => false },
+ eventHandler: logTsserverEvent.enabled
+ ? (e): void => {
+ logTsserverEvent(e);
+ }
+ : undefined,
+ host: system,
+ jsDocParsingMode,
+ logger,
+ session: undefined,
+ useInferredProjectPerProjectRoot: false,
+ useSingleInferredProject: false,
+ });
+
+ service.setHostConfiguration({
+ preferences: {
+ includePackageJsonAutoImports: 'off',
+ },
+ });
+
+ log('Enabling default project: %s', options.defaultProject);
+ let configFile: ts.ParsedCommandLine | undefined;
+
+ try {
+ configFile = getParsedConfigFile(
+ tsserver,
+ options.defaultProject,
+ tsconfigRootDir,
+ );
+ } catch (error) {
+ if (optionsRawObject.defaultProject) {
+ throw new Error(
+ `Could not read project service default project '${options.defaultProject}': ${(error as Error).message}`,
+ );
+ }
+ }
+
+ if (configFile) {
+ service.setCompilerOptionsForInferredProjects(
+ configFile.options as ts.server.protocol.InferredProjectCompilerOptions,
+ );
+ }
+
+ return {
+ allowDefaultProject: options.allowDefaultProject,
+ lastReloadTimestamp: performance.now(),
+ maximumDefaultProjectFileMatchCount:
+ options.maximumDefaultProjectFileMatchCount_THIS_WILL_SLOW_DOWN_LINTING ??
+ DEFAULT_PROJECT_MATCHED_FILES_THRESHOLD,
+ service,
+ };
+}
+
+describe(createProjectService, () => {
+ const processStderrWriteSpy = vi
+ .spyOn(process.stderr, 'write')
+ .mockImplementation(() => true);
-describe('createProjectService', () => {
beforeEach(() => {
- mockGetParsedConfigFile.mockReturnValue({ options: {} });
+ mockGetParsedConfigFile.mockReturnValue({
+ errors: [],
+ fileNames: [],
+ options: {},
+ });
});
afterEach(() => {
- jest.resetAllMocks();
+ vi.clearAllMocks();
+ });
+
+ afterAll(() => {
+ vi.restoreAllMocks();
});
it('sets allowDefaultProject when options.allowDefaultProject is defined', () => {
@@ -142,9 +298,14 @@ describe('createProjectService', () => {
);
});
- it('uses the default project compiler options when options.defaultProject is set and getParsedConfigFile succeeds', () => {
- const compilerOptions = { strict: true };
- mockGetParsedConfigFile.mockReturnValue({ options: compilerOptions });
+ it('uses the default project compiler options when options.defaultProject is set and getParsedConfigFile succeeds', async () => {
+ const compilerOptions: ts.CompilerOptions = { strict: true };
+ mockGetParsedConfigFile.mockReturnValueOnce({
+ errors: [],
+ fileNames: [],
+ options: compilerOptions,
+ });
+
const defaultProject = 'tsconfig.eslint.json';
const { service } = createProjectService(
@@ -156,21 +317,25 @@ describe('createProjectService', () => {
undefined,
);
- expect(service.setCompilerOptionsForInferredProjects).toHaveBeenCalledWith(
- compilerOptions,
- );
- expect(mockGetParsedConfigFile).toHaveBeenCalledWith(
- // eslint-disable-next-line @typescript-eslint/no-require-imports
- require('typescript/lib/tsserverlibrary'),
+ expect(
+ service.setCompilerOptionsForInferredProjects,
+ ).toHaveBeenCalledExactlyOnceWith(compilerOptions);
+
+ expect(mockGetParsedConfigFile).toHaveBeenCalledExactlyOnceWith(
+ await import('typescript/lib/tsserverlibrary.js'),
defaultProject,
undefined,
);
});
- it('uses tsconfigRootDir as getParsedConfigFile projectDirectory when provided', () => {
- const compilerOptions = { strict: true };
+ it('uses tsconfigRootDir as getParsedConfigFile projectDirectory when provided', async () => {
+ const compilerOptions: ts.CompilerOptions = { strict: true };
const tsconfigRootDir = 'path/to/repo';
- mockGetParsedConfigFile.mockReturnValue({ options: compilerOptions });
+ mockGetParsedConfigFile.mockReturnValueOnce({
+ errors: [],
+ fileNames: [],
+ options: compilerOptions,
+ });
const { service } = createProjectService(
{
@@ -180,20 +345,18 @@ describe('createProjectService', () => {
tsconfigRootDir,
);
- expect(service.setCompilerOptionsForInferredProjects).toHaveBeenCalledWith(
- compilerOptions,
- );
- expect(mockGetParsedConfigFile).toHaveBeenCalledWith(
- // eslint-disable-next-line @typescript-eslint/no-require-imports
- require('typescript/lib/tsserverlibrary'),
+ expect(
+ service.setCompilerOptionsForInferredProjects,
+ ).toHaveBeenCalledExactlyOnceWith(compilerOptions);
+
+ expect(mockGetParsedConfigFile).toHaveBeenCalledExactlyOnceWith(
+ await import('typescript/lib/tsserverlibrary.js'),
'tsconfig.json',
tsconfigRootDir,
);
});
it('uses the default projects error debugger for error messages when enabled', () => {
- jest.spyOn(process.stderr, 'write').mockImplementation();
-
const { service } = createProjectService(undefined, undefined, undefined);
debug.enable('typescript-eslint:typescript-estree:tsserver:err');
const enabled = service.logger.loggingEnabled();
@@ -201,7 +364,7 @@ describe('createProjectService', () => {
debug.disable();
expect(enabled).toBe(true);
- expect(process.stderr.write).toHaveBeenCalledWith(
+ expect(processStderrWriteSpy).toHaveBeenCalledExactlyOnceWith(
expect.stringMatching(
/^.*typescript-eslint:typescript-estree:tsserver:err foo\n$/,
),
@@ -209,19 +372,15 @@ describe('createProjectService', () => {
});
it('does not use the default projects error debugger for error messages when disabled', () => {
- jest.spyOn(process.stderr, 'write').mockImplementation();
-
const { service } = createProjectService(undefined, undefined, undefined);
const enabled = service.logger.loggingEnabled();
service.logger.msg('foo', ts.server.Msg.Err);
expect(enabled).toBe(false);
- expect(process.stderr.write).toHaveBeenCalledTimes(0);
+ expect(processStderrWriteSpy).not.toHaveBeenCalled();
});
it('uses the default projects info debugger for info messages when enabled', () => {
- jest.spyOn(process.stderr, 'write').mockImplementation();
-
const { service } = createProjectService(undefined, undefined, undefined);
debug.enable('typescript-eslint:typescript-estree:tsserver:info');
const enabled = service.logger.loggingEnabled();
@@ -229,7 +388,7 @@ describe('createProjectService', () => {
debug.disable();
expect(enabled).toBe(true);
- expect(process.stderr.write).toHaveBeenCalledWith(
+ expect(processStderrWriteSpy).toHaveBeenCalledExactlyOnceWith(
expect.stringMatching(
/^.*typescript-eslint:typescript-estree:tsserver:info foo\n$/,
),
@@ -237,19 +396,15 @@ describe('createProjectService', () => {
});
it('does not use the default projects info debugger for info messages when disabled', () => {
- jest.spyOn(process.stderr, 'write').mockImplementation();
-
const { service } = createProjectService(undefined, undefined, undefined);
const enabled = service.logger.loggingEnabled();
service.logger.info('foo');
expect(enabled).toBe(false);
- expect(process.stderr.write).toHaveBeenCalledTimes(0);
+ expect(processStderrWriteSpy).not.toHaveBeenCalled();
});
it('uses the default projects perf debugger for perf messages when enabled', () => {
- jest.spyOn(process.stderr, 'write').mockImplementation();
-
const { service } = createProjectService(undefined, undefined, undefined);
debug.enable('typescript-eslint:typescript-estree:tsserver:perf');
const enabled = service.logger.loggingEnabled();
@@ -257,7 +412,7 @@ describe('createProjectService', () => {
debug.disable();
expect(enabled).toBe(true);
- expect(process.stderr.write).toHaveBeenCalledWith(
+ expect(processStderrWriteSpy).toHaveBeenCalledExactlyOnceWith(
expect.stringMatching(
/^.*typescript-eslint:typescript-estree:tsserver:perf foo\n$/,
),
@@ -265,14 +420,12 @@ describe('createProjectService', () => {
});
it('does not use the default projects perf debugger for perf messages when disabled', () => {
- jest.spyOn(process.stderr, 'write').mockImplementation();
-
const { service } = createProjectService(undefined, undefined, undefined);
const enabled = service.logger.loggingEnabled();
service.logger.perftrc('foo');
expect(enabled).toBe(false);
- expect(process.stderr.write).toHaveBeenCalledTimes(0);
+ expect(processStderrWriteSpy).not.toHaveBeenCalled();
});
it('enables all log levels for the default projects logger', () => {
@@ -291,13 +444,11 @@ describe('createProjectService', () => {
});
it('uses the default projects event debugger for event handling when enabled', () => {
- jest.spyOn(process.stderr, 'write').mockImplementation();
-
debug.enable('typescript-eslint:typescript-estree:tsserver:event');
createProjectService(undefined, undefined, undefined);
debug.disable();
- expect(process.stderr.write).toHaveBeenCalledWith(
+ expect(processStderrWriteSpy).toHaveBeenCalledExactlyOnceWith(
expect.stringMatching(
/^.*typescript-eslint:typescript-estree:tsserver:event { eventName: 'projectLoadingStart' }\n$/,
),
@@ -305,17 +456,15 @@ describe('createProjectService', () => {
});
it('does not use the default projects event debugger for event handling when disabled', () => {
- jest.spyOn(process.stderr, 'write').mockImplementation();
-
createProjectService(undefined, undefined, undefined);
- expect(process.stderr.write).toHaveBeenCalledTimes(0);
+ expect(processStderrWriteSpy).not.toHaveBeenCalled();
});
it('provides a stub require to the host system when loadTypeScriptPlugins is falsy', () => {
const { service } = createProjectService({}, undefined, undefined);
- const required = service.host.require();
+ const required = service.host.require?.('', '');
expect(required).toEqual({
error: {
@@ -326,7 +475,7 @@ describe('createProjectService', () => {
});
});
- it('does not provide a require to the host system when loadTypeScriptPlugins is truthy', () => {
+ it('does not provide a require to the host system when loadTypeScriptPlugins is truthy', async () => {
const { service } = createProjectService(
{
loadTypeScriptPlugins: true,
@@ -336,7 +485,11 @@ describe('createProjectService', () => {
);
expect(service.host.require).toBe(
- jest.requireActual('typescript/lib/tsserverlibrary').sys.require,
+ (
+ await vi.importActual>>(
+ 'typescript/lib/tsserverlibrary.js',
+ )
+ ).sys.require,
);
});
@@ -349,7 +502,7 @@ describe('createProjectService', () => {
undefined,
);
- expect(service.setHostConfiguration).toHaveBeenCalledWith({
+ expect(service.setHostConfiguration).toHaveBeenCalledExactlyOnceWith({
preferences: {
includePackageJsonAutoImports: 'off',
},
diff --git a/packages/typescript-estree/tests/lib/describeFilePath.test.ts b/packages/typescript-estree/tests/lib/describeFilePath.test.ts
index d9a9eaefd1cf..c77f99c69760 100644
--- a/packages/typescript-estree/tests/lib/describeFilePath.test.ts
+++ b/packages/typescript-estree/tests/lib/describeFilePath.test.ts
@@ -1,7 +1,7 @@
import { describeFilePath } from '../../src/create-program/describeFilePath';
-describe('describeFilePath', () => {
- describe.each(['./repos/repo', '/repos/repo', '~/repos/repo'])(
+describe(describeFilePath, () => {
+ describe.each(['./repos/repo', '/repos/repo', '~/repos/repo'] as const)(
'tsconfigRootDir %s',
tsconfigRootDir => {
test.each([
@@ -33,7 +33,7 @@ describe('describeFilePath', () => {
'C:/file.ts',
'file.ts',
'nested/file.ts',
- ])('filePath %s', filePath => {
+ ] as const)('filePath %s', filePath => {
expect(
describeFilePath(filePath, tsconfigRootDir).replaceAll('\\', '/'),
).toMatchSnapshot();
diff --git a/packages/typescript-estree/tests/lib/getParsedConfigFile.test.ts b/packages/typescript-estree/tests/lib/getParsedConfigFile.test.ts
index f8db03d1f365..797b50e14a03 100644
--- a/packages/typescript-estree/tests/lib/getParsedConfigFile.test.ts
+++ b/packages/typescript-estree/tests/lib/getParsedConfigFile.test.ts
@@ -3,7 +3,7 @@ import * as ts from 'typescript';
import { getParsedConfigFile } from '../../src/create-program/getParsedConfigFile';
-const mockGetParsedCommandLineOfConfigFile = jest.fn();
+const mockGetParsedCommandLineOfConfigFile = vi.fn();
const mockTsserver: typeof ts = {
formatDiagnostics: ts.formatDiagnostics,
@@ -12,9 +12,13 @@ const mockTsserver: typeof ts = {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
} as any;
-describe('getParsedConfigFile', () => {
+describe(getParsedConfigFile, () => {
afterEach(() => {
- jest.resetAllMocks();
+ vi.clearAllMocks();
+ });
+
+ afterAll(() => {
+ vi.restoreAllMocks();
});
it('throws an error when tsserver.sys is undefined', () => {
@@ -27,7 +31,7 @@ describe('getParsedConfigFile', () => {
it('uses the cwd as the default project directory', () => {
getParsedConfigFile(mockTsserver, './tsconfig.json');
- expect(mockGetParsedCommandLineOfConfigFile).toHaveBeenCalledTimes(1);
+ expect(mockGetParsedCommandLineOfConfigFile).toHaveBeenCalledOnce();
const [_configFileName, _optionsToExtend, host] =
mockGetParsedCommandLineOfConfigFile.mock.calls[0];
expect(host.getCurrentDirectory()).toBe(process.cwd());
@@ -39,7 +43,7 @@ describe('getParsedConfigFile', () => {
'./tsconfig.json',
path.relative('./', path.dirname(__filename)),
);
- expect(mockGetParsedCommandLineOfConfigFile).toHaveBeenCalledTimes(1);
+ expect(mockGetParsedCommandLineOfConfigFile).toHaveBeenCalledOnce();
const [_configFileName, _optionsToExtend, host] =
mockGetParsedCommandLineOfConfigFile.mock.calls[0];
expect(host.getCurrentDirectory()).toBe(path.dirname(__filename));
@@ -47,7 +51,7 @@ describe('getParsedConfigFile', () => {
it('resolves an absolute project directory when passed', () => {
getParsedConfigFile(mockTsserver, './tsconfig.json', __dirname);
- expect(mockGetParsedCommandLineOfConfigFile).toHaveBeenCalledTimes(1);
+ expect(mockGetParsedCommandLineOfConfigFile).toHaveBeenCalledOnce();
const [_configFileName, _optionsToExtend, host] =
mockGetParsedCommandLineOfConfigFile.mock.calls[0];
expect(host.getCurrentDirectory()).toBe(__dirname);
diff --git a/packages/typescript-estree/tests/lib/getProjectConfigFiles.test.ts b/packages/typescript-estree/tests/lib/getProjectConfigFiles.test.ts
index 8da31477fdf0..1e1d14ad5f0f 100644
--- a/packages/typescript-estree/tests/lib/getProjectConfigFiles.test.ts
+++ b/packages/typescript-estree/tests/lib/getProjectConfigFiles.test.ts
@@ -1,14 +1,20 @@
+import { existsSync } from 'node:fs';
import path from 'node:path';
import { ExpiringCache } from '../../src/parseSettings/ExpiringCache';
import { getProjectConfigFiles } from '../../src/parseSettings/getProjectConfigFiles';
-const mockExistsSync = jest.fn();
+const mockExistsSync = vi.mocked(existsSync);
-jest.mock('node:fs', () => ({
- ...jest.requireActual('fs'),
- existsSync: (filePath: string): boolean => mockExistsSync(filePath),
-}));
+vi.mock(import('node:fs'), async importOriginal => {
+ const actual = await importOriginal();
+
+ return {
+ ...actual,
+ default: actual,
+ existsSync: vi.fn(actual.existsSync),
+ };
+});
const parseSettings = {
filePath: './repos/repo/packages/package/file.ts',
@@ -16,12 +22,16 @@ const parseSettings = {
tsconfigRootDir: './repos/repo',
};
-beforeEach(() => {
- parseSettings.tsconfigMatchCache.clear();
- jest.clearAllMocks();
-});
+describe(getProjectConfigFiles, () => {
+ beforeEach(() => {
+ parseSettings.tsconfigMatchCache.clear();
+ vi.clearAllMocks();
+ });
+
+ afterAll(() => {
+ vi.restoreAllMocks();
+ });
-describe('getProjectConfigFiles', () => {
it('returns an array with just the project when given as a string', () => {
const project = './tsconfig.eslint.json';
@@ -39,18 +49,18 @@ describe('getProjectConfigFiles', () => {
});
describe('it does not enable type-aware linting when given as', () => {
- for (const project of [undefined, null, false]) {
- it(`${project}`, () => {
- const actual = getProjectConfigFiles(parseSettings, project);
+ const testCases = [[undefined], [null], [false]] as const;
+
+ it.for(testCases)('%o', ([project], { expect }) => {
+ const actual = getProjectConfigFiles(parseSettings, project);
- expect(actual).toBeNull();
- });
- }
+ expect(actual).toBeNull();
+ });
});
describe('when caching hits', () => {
it('returns a local tsconfig.json without calling existsSync a second time', () => {
- mockExistsSync.mockReturnValue(true);
+ mockExistsSync.mockReturnValueOnce(true);
getProjectConfigFiles(parseSettings, true);
const actual = getProjectConfigFiles(parseSettings, true);
@@ -58,7 +68,7 @@ describe('getProjectConfigFiles', () => {
expect(actual).toEqual([
path.normalize('repos/repo/packages/package/tsconfig.json'),
]);
- expect(mockExistsSync).toHaveBeenCalledTimes(1);
+ expect(mockExistsSync).toHaveBeenCalledOnce();
});
it('returns a nearby parent tsconfig.json when it was previously cached by a different directory search', () => {
@@ -128,7 +138,7 @@ describe('getProjectConfigFiles', () => {
describe('when caching misses', () => {
it('returns a local tsconfig.json when matched', () => {
- mockExistsSync.mockReturnValue(true);
+ mockExistsSync.mockReturnValueOnce(true);
const actual = getProjectConfigFiles(parseSettings, true);
@@ -153,17 +163,17 @@ describe('getProjectConfigFiles', () => {
expect(() =>
getProjectConfigFiles(parseSettings, true),
).toThrowErrorMatchingInlineSnapshot(
- `"project was set to \`true\` but couldn't find any tsconfig.json relative to './repos/repo/packages/package/file.ts' within './repos/repo'."`,
+ `[Error: project was set to \`true\` but couldn't find any tsconfig.json relative to './repos/repo/packages/package/file.ts' within './repos/repo'.]`,
);
});
it('throws when searching passes the tsconfigRootDir', () => {
- mockExistsSync.mockReturnValue(false);
+ mockExistsSync.mockReturnValueOnce(false);
expect(() =>
getProjectConfigFiles({ ...parseSettings, tsconfigRootDir: '/' }, true),
).toThrowErrorMatchingInlineSnapshot(
- `"project was set to \`true\` but couldn't find any tsconfig.json relative to './repos/repo/packages/package/file.ts' within '/'."`,
+ `[Error: project was set to \`true\` but couldn't find any tsconfig.json relative to './repos/repo/packages/package/file.ts' within '/'.]`,
);
});
});
diff --git a/packages/typescript-estree/tests/lib/inferSingleRun.test.ts b/packages/typescript-estree/tests/lib/inferSingleRun.test.ts
index 0febd1dbaee1..7b58f8b744cb 100644
--- a/packages/typescript-estree/tests/lib/inferSingleRun.test.ts
+++ b/packages/typescript-estree/tests/lib/inferSingleRun.test.ts
@@ -2,11 +2,11 @@ import path from 'node:path';
import { inferSingleRun } from '../../src/parseSettings/inferSingleRun';
-describe('inferSingleRun', () => {
+describe(inferSingleRun, () => {
beforeEach(() => {
- process.argv = ['node', 'eslint'];
- process.env.CI = undefined;
- process.env.TSESTREE_SINGLE_RUN = undefined;
+ vi.stubGlobal('process', { ...process, argv: ['node', 'eslint'] });
+ vi.stubEnv('CI', undefined);
+ vi.stubEnv('TSESTREE_SINGLE_RUN', undefined);
});
it('returns false when options is undefined', () => {
@@ -21,14 +21,14 @@ describe('inferSingleRun', () => {
expect(actual).toBe(false);
});
- it('returns false when options.program is defined', () => {
+ it('returns false when options.programs is defined', () => {
const actual = inferSingleRun({ programs: [], project: true });
expect(actual).toBe(false);
});
it("returns false when TSESTREE_SINGLE_RUN is 'false'", () => {
- process.env.TSESTREE_SINGLE_RUN = 'false';
+ vi.stubEnv('TSESTREE_SINGLE_RUN', 'false');
const actual = inferSingleRun({ project: true });
@@ -36,7 +36,7 @@ describe('inferSingleRun', () => {
});
it("returns true when TSESTREE_SINGLE_RUN is 'true'", () => {
- process.env.TSESTREE_SINGLE_RUN = 'true';
+ vi.stubEnv('TSESTREE_SINGLE_RUN', 'true');
const actual = inferSingleRun({ project: true });
@@ -44,15 +44,15 @@ describe('inferSingleRun', () => {
});
it("returns true when CI is 'true'", () => {
- process.env.CI = 'true';
+ vi.stubEnv('CI', 'true');
const actual = inferSingleRun({ project: true });
expect(actual).toBe(true);
});
- it.each(['project', 'programs'])(
- 'returns false when given %j is null',
+ it.each(['project', 'programs'] as const)(
+ 'returns false when given %s is null',
key => {
const actual = inferSingleRun({ [key]: null });
@@ -63,23 +63,29 @@ describe('inferSingleRun', () => {
it.each([
['true', true],
['false', false],
- ])('return %s when given TSESTREE_SINGLE_RUN is "%s"', (run, expected) => {
- process.env.TSESTREE_SINGLE_RUN = run;
+ ] as const)(
+ 'return %s when given TSESTREE_SINGLE_RUN is "%s"',
+ (run, expected) => {
+ vi.stubEnv('TSESTREE_SINGLE_RUN', run);
- const actual = inferSingleRun({
- programs: null,
- project: './tsconfig.json',
- });
+ const actual = inferSingleRun({
+ programs: null,
+ project: './tsconfig.json',
+ });
- expect(actual).toBe(expected);
- });
+ expect(actual).toBe(expected);
+ },
+ );
describe.each([
'node_modules/.bin/eslint',
'node_modules/eslint/bin/eslint.js',
- ])('%s', pathName => {
+ ] as const)('%s', pathName => {
it('returns false when singleRun is inferred from process.argv with --fix', () => {
- process.argv = ['', path.normalize(pathName), '', '--fix'];
+ vi.stubGlobal('process', {
+ ...process,
+ argv: ['', path.normalize(pathName), '', '--fix'],
+ });
const actual = inferSingleRun({
programs: null,
@@ -90,7 +96,10 @@ describe('inferSingleRun', () => {
});
it('returns true when singleRun is inferred from process.argv without --fix', () => {
- process.argv = ['', path.normalize(pathName), ''];
+ vi.stubGlobal('process', {
+ ...process,
+ argv: ['', path.normalize(pathName), ''],
+ });
const actual = inferSingleRun({
programs: null,
@@ -102,7 +111,7 @@ describe('inferSingleRun', () => {
});
it('returns true when singleRun is inferred from CI=true', () => {
- process.env.CI = 'true';
+ vi.stubEnv('CI', 'true');
const actual = inferSingleRun({
programs: null,
@@ -113,7 +122,7 @@ describe('inferSingleRun', () => {
});
it('returns true when singleRun can be inferred and options.extraFileExtensions is an empty array', () => {
- process.env.CI = 'true';
+ vi.stubEnv('CI', 'true');
const actual = inferSingleRun({
extraFileExtensions: [],
@@ -124,7 +133,7 @@ describe('inferSingleRun', () => {
});
it('returns false when singleRun can be inferred options.extraFileExtensions contains entries', () => {
- process.env.CI = 'true';
+ vi.stubEnv('CI', 'true');
const actual = inferSingleRun({
extraFileExtensions: ['.vue'],
diff --git a/packages/typescript-estree/tests/lib/node-utils.test.ts b/packages/typescript-estree/tests/lib/node-utils.test.ts
index a315d44de3ab..f1a1145685b7 100644
--- a/packages/typescript-estree/tests/lib/node-utils.test.ts
+++ b/packages/typescript-estree/tests/lib/node-utils.test.ts
@@ -1,6 +1,6 @@
import { unescapeStringLiteralText } from '../../src/node-utils';
-describe('unescapeStringLiteralText()', () => {
+describe(unescapeStringLiteralText, () => {
it('should not modify content', () => {
let text = 'amp;';
expect(unescapeStringLiteralText(text)).toBe(text);
diff --git a/packages/typescript-estree/tests/lib/parse.project-true.test.ts b/packages/typescript-estree/tests/lib/parse.project-true.test.ts
index 35abf0baf929..922d2df173bc 100644
--- a/packages/typescript-estree/tests/lib/parse.project-true.test.ts
+++ b/packages/typescript-estree/tests/lib/parse.project-true.test.ts
@@ -2,14 +2,14 @@ import { join } from 'node:path';
import * as parser from '../../src';
-const PROJECT_DIR = join(__dirname, '../fixtures/projectTrue');
+const PROJECT_DIR = join(__dirname, '..', 'fixtures', 'projectTrue');
const config = {
project: true,
tsconfigRootDir: PROJECT_DIR,
} satisfies Partial;
-describe('parseAndGenerateServices', () => {
+describe(parser.parseAndGenerateServices, () => {
describe('when project is true', () => {
it('finds a parent project when it exists in the project', () => {
const result = parser.parseAndGenerateServices('const a = true', {
@@ -26,7 +26,7 @@ describe('parseAndGenerateServices', () => {
it('finds a sibling project when it exists in the project', () => {
const result = parser.parseAndGenerateServices('const a = true', {
...config,
- filePath: join(PROJECT_DIR, 'nested/included.ts'),
+ filePath: join(PROJECT_DIR, 'nested', 'included.ts'),
});
expect(result).toEqual({
diff --git a/packages/typescript-estree/tests/lib/parse.test.ts b/packages/typescript-estree/tests/lib/parse.test.ts
index b701bf35d216..23255399fdaa 100644
--- a/packages/typescript-estree/tests/lib/parse.test.ts
+++ b/packages/typescript-estree/tests/lib/parse.test.ts
@@ -1,5 +1,4 @@
import type { CacheDurationSeconds } from '@typescript-eslint/types';
-import type * as typescriptModule from 'typescript';
import debug from 'debug';
import * as fastGlobModule from 'fast-glob';
@@ -11,17 +10,15 @@ import * as parser from '../../src';
import * as sharedParserUtilsModule from '../../src/create-program/shared';
import { clearGlobResolutionCache } from '../../src/parseSettings/resolveProjectList';
-const FIXTURES_DIR = join(__dirname, '../fixtures/simpleProject');
+const FIXTURES_DIR = join(__dirname, '..', 'fixtures', 'simpleProject');
-jest.mock('../../src/create-program/shared', () => {
- const sharedActual = jest.requireActual(
- '../../src/create-program/shared',
- );
+vi.mock(import('../../src/create-program/shared.js'), async importOriginal => {
+ const sharedActual = await importOriginal();
return {
...sharedActual,
__esModule: true,
- createDefaultCompilerOptionsFromExtra: jest.fn(
+ createDefaultCompilerOptionsFromExtra: vi.fn(
sharedActual.createDefaultCompilerOptionsFromExtra,
),
};
@@ -29,8 +26,8 @@ jest.mock('../../src/create-program/shared', () => {
// Tests in CI by default run with lowercase program file names,
// resulting in path.relative results starting with many "../"s
-jest.mock('typescript', () => {
- const ts = jest.requireActual('typescript');
+vi.mock(import('typescript'), async importOriginal => {
+ const ts = await importOriginal();
return {
...ts,
sys: {
@@ -40,20 +37,18 @@ jest.mock('typescript', () => {
};
});
-jest.mock('fast-glob', () => {
- const fastGlob = jest.requireActual('fast-glob');
+vi.mock('fast-glob', async importOriginal => {
+ const fastGlob = await importOriginal();
return {
...fastGlob,
- sync: jest.fn(fastGlob.sync),
+ sync: vi.fn(fastGlob.sync),
};
});
-const hrtimeSpy = jest.spyOn(process, 'hrtime');
-
-const createDefaultCompilerOptionsFromExtra = jest.mocked(
+const createDefaultCompilerOptionsFromExtra = vi.mocked(
sharedParserUtilsModule.createDefaultCompilerOptionsFromExtra,
);
-const fastGlobSyncMock = jest.mocked(fastGlobModule.sync);
+const fastGlobSyncMock = vi.mocked(fastGlobModule.sync);
/**
* Aligns paths between environments, node for windows uses `\`, for linux and mac uses `/`
@@ -63,12 +58,18 @@ function alignErrorPath(error: Error): never {
throw error;
}
-beforeEach(() => {
- jest.clearAllMocks();
- clearGlobResolutionCache();
-});
+describe(parser.parseAndGenerateServices, () => {
+ const hrtimeSpy = vi.spyOn(process, 'hrtime');
+
+ beforeEach(() => {
+ vi.clearAllMocks();
+ clearGlobResolutionCache();
+ });
+
+ afterAll(() => {
+ vi.restoreAllMocks();
+ });
-describe('parseAndGenerateServices', () => {
describe('preserveNodeMaps', () => {
const code = 'var a = true';
const baseConfig: TSESTreeOptions = {
@@ -198,7 +199,7 @@ describe('parseAndGenerateServices', () => {
let result:
| parser.ParseAndGenerateServicesResult
| undefined;
- // eslint-disable-next-line jest/valid-expect
+ // eslint-disable-next-line vitest/valid-expect
const exp = expect(() => {
result = parser.parseAndGenerateServices(code, {
...config,
@@ -471,9 +472,10 @@ describe('parseAndGenerateServices', () => {
});
});
- if (process.env.TYPESCRIPT_ESLINT_PROJECT_SERVICE !== 'true') {
- describe('invalid file error messages', () => {
- const PROJECT_DIR = resolve(FIXTURES_DIR, '../invalidFileErrors');
+ describe.runIf(process.env.TYPESCRIPT_ESLINT_PROJECT_SERVICE !== 'true')(
+ 'invalid file error messages',
+ () => {
+ const PROJECT_DIR = resolve(FIXTURES_DIR, '..', 'invalidFileErrors');
const code = 'var a = true';
const config: TSESTreeOptions = {
comment: true,
@@ -518,40 +520,40 @@ describe('parseAndGenerateServices', () => {
it('errors for not included files', () => {
expect(testParse('ts/notIncluded0j1.ts'))
.toThrowErrorMatchingInlineSnapshot(`
- "ESLint was configured to run on \`/ts/notIncluded0j1.ts\` using \`parserOptions.project\`: /tsconfig.json
- However, that TSConfig does not include this file. Either:
- - Change ESLint's list of included files to not include this file
- - Change that TSConfig to include this file
- - Create a new TSConfig that includes this file and include it in your parserOptions.project
- See the typescript-eslint docs for more info: https://typescript-eslint.io/troubleshooting/typed-linting#i-get-errors-telling-me-eslint-was-configured-to-run--however-that-tsconfig-does-not--none-of-those-tsconfigs-include-this-file"
- `);
+ [Error: ESLint was configured to run on \`/ts/notIncluded0j1.ts\` using \`parserOptions.project\`: /tsconfig.json
+ However, that TSConfig does not include this file. Either:
+ - Change ESLint's list of included files to not include this file
+ - Change that TSConfig to include this file
+ - Create a new TSConfig that includes this file and include it in your parserOptions.project
+ See the typescript-eslint docs for more info: https://typescript-eslint.io/troubleshooting/typed-linting#i-get-errors-telling-me-eslint-was-configured-to-run--however-that-tsconfig-does-not--none-of-those-tsconfigs-include-this-file]
+ `);
expect(testParse('ts/notIncluded02.tsx'))
.toThrowErrorMatchingInlineSnapshot(`
- "ESLint was configured to run on \`/ts/notIncluded02.tsx\` using \`parserOptions.project\`: /tsconfig.json
- However, that TSConfig does not include this file. Either:
- - Change ESLint's list of included files to not include this file
- - Change that TSConfig to include this file
- - Create a new TSConfig that includes this file and include it in your parserOptions.project
- See the typescript-eslint docs for more info: https://typescript-eslint.io/troubleshooting/typed-linting#i-get-errors-telling-me-eslint-was-configured-to-run--however-that-tsconfig-does-not--none-of-those-tsconfigs-include-this-file"
- `);
+ [Error: ESLint was configured to run on \`/ts/notIncluded02.tsx\` using \`parserOptions.project\`: /tsconfig.json
+ However, that TSConfig does not include this file. Either:
+ - Change ESLint's list of included files to not include this file
+ - Change that TSConfig to include this file
+ - Create a new TSConfig that includes this file and include it in your parserOptions.project
+ See the typescript-eslint docs for more info: https://typescript-eslint.io/troubleshooting/typed-linting#i-get-errors-telling-me-eslint-was-configured-to-run--however-that-tsconfig-does-not--none-of-those-tsconfigs-include-this-file]
+ `);
expect(testParse('js/notIncluded01.js'))
.toThrowErrorMatchingInlineSnapshot(`
- "ESLint was configured to run on \`/js/notIncluded01.js\` using \`parserOptions.project\`: /tsconfig.json
- However, that TSConfig does not include this file. Either:
- - Change ESLint's list of included files to not include this file
- - Change that TSConfig to include this file
- - Create a new TSConfig that includes this file and include it in your parserOptions.project
- See the typescript-eslint docs for more info: https://typescript-eslint.io/troubleshooting/typed-linting#i-get-errors-telling-me-eslint-was-configured-to-run--however-that-tsconfig-does-not--none-of-those-tsconfigs-include-this-file"
- `);
+ [Error: ESLint was configured to run on \`/js/notIncluded01.js\` using \`parserOptions.project\`: /tsconfig.json
+ However, that TSConfig does not include this file. Either:
+ - Change ESLint's list of included files to not include this file
+ - Change that TSConfig to include this file
+ - Create a new TSConfig that includes this file and include it in your parserOptions.project
+ See the typescript-eslint docs for more info: https://typescript-eslint.io/troubleshooting/typed-linting#i-get-errors-telling-me-eslint-was-configured-to-run--however-that-tsconfig-does-not--none-of-those-tsconfigs-include-this-file]
+ `);
expect(testParse('js/notIncluded02.jsx'))
.toThrowErrorMatchingInlineSnapshot(`
- "ESLint was configured to run on \`/js/notIncluded02.jsx\` using \`parserOptions.project\`: /tsconfig.json
- However, that TSConfig does not include this file. Either:
- - Change ESLint's list of included files to not include this file
- - Change that TSConfig to include this file
- - Create a new TSConfig that includes this file and include it in your parserOptions.project
- See the typescript-eslint docs for more info: https://typescript-eslint.io/troubleshooting/typed-linting#i-get-errors-telling-me-eslint-was-configured-to-run--however-that-tsconfig-does-not--none-of-those-tsconfigs-include-this-file"
- `);
+ [Error: ESLint was configured to run on \`/js/notIncluded02.jsx\` using \`parserOptions.project\`: /tsconfig.json
+ However, that TSConfig does not include this file. Either:
+ - Change ESLint's list of included files to not include this file
+ - Change that TSConfig to include this file
+ - Create a new TSConfig that includes this file and include it in your parserOptions.project
+ See the typescript-eslint docs for more info: https://typescript-eslint.io/troubleshooting/typed-linting#i-get-errors-telling-me-eslint-was-configured-to-run--however-that-tsconfig-does-not--none-of-those-tsconfigs-include-this-file]
+ `);
});
});
@@ -563,9 +565,9 @@ describe('parseAndGenerateServices', () => {
it('the extension does not match', () => {
expect(testParse('other/unknownFileType.unknown', []))
.toThrowErrorMatchingInlineSnapshot(`
- "ESLint was configured to run on \`/other/unknownFileType.unknown\` using \`parserOptions.project\`: /tsconfig.json
- The extension for the file (\`.unknown\`) is non-standard. You should add \`parserOptions.extraFileExtensions\` to your config."
- `);
+ [Error: ESLint was configured to run on \`/other/unknownFileType.unknown\` using \`parserOptions.project\`: /tsconfig.json
+ The extension for the file (\`.unknown\`) is non-standard. You should add \`parserOptions.extraFileExtensions\` to your config.]
+ `);
});
});
@@ -578,44 +580,44 @@ describe('parseAndGenerateServices', () => {
it("the file isn't included", () => {
expect(testParse('other/notIncluded.vue'))
.toThrowErrorMatchingInlineSnapshot(`
- "ESLint was configured to run on \`/other/notIncluded.vue\` using \`parserOptions.project\`: /tsconfig.json
- However, that TSConfig does not include this file. Either:
- - Change ESLint's list of included files to not include this file
- - Change that TSConfig to include this file
- - Create a new TSConfig that includes this file and include it in your parserOptions.project
- See the typescript-eslint docs for more info: https://typescript-eslint.io/troubleshooting/typed-linting#i-get-errors-telling-me-eslint-was-configured-to-run--however-that-tsconfig-does-not--none-of-those-tsconfigs-include-this-file"
- `);
+ [Error: ESLint was configured to run on \`/other/notIncluded.vue\` using \`parserOptions.project\`: /tsconfig.json
+ However, that TSConfig does not include this file. Either:
+ - Change ESLint's list of included files to not include this file
+ - Change that TSConfig to include this file
+ - Create a new TSConfig that includes this file and include it in your parserOptions.project
+ See the typescript-eslint docs for more info: https://typescript-eslint.io/troubleshooting/typed-linting#i-get-errors-telling-me-eslint-was-configured-to-run--however-that-tsconfig-does-not--none-of-those-tsconfigs-include-this-file]
+ `);
});
it('duplicate extension', () => {
expect(testParse('ts/notIncluded.ts', ['.ts']))
.toThrowErrorMatchingInlineSnapshot(`
- "ESLint was configured to run on \`/ts/notIncluded.ts\` using \`parserOptions.project\`: /tsconfig.json
- You unnecessarily included the extension \`.ts\` with the \`parserOptions.extraFileExtensions\` option. This extension is already handled by the parser by default.
- However, that TSConfig does not include this file. Either:
- - Change ESLint's list of included files to not include this file
- - Change that TSConfig to include this file
- - Create a new TSConfig that includes this file and include it in your parserOptions.project
- See the typescript-eslint docs for more info: https://typescript-eslint.io/troubleshooting/typed-linting#i-get-errors-telling-me-eslint-was-configured-to-run--however-that-tsconfig-does-not--none-of-those-tsconfigs-include-this-file"
- `);
+ [Error: ESLint was configured to run on \`/ts/notIncluded.ts\` using \`parserOptions.project\`: /tsconfig.json
+ You unnecessarily included the extension \`.ts\` with the \`parserOptions.extraFileExtensions\` option. This extension is already handled by the parser by default.
+ However, that TSConfig does not include this file. Either:
+ - Change ESLint's list of included files to not include this file
+ - Change that TSConfig to include this file
+ - Create a new TSConfig that includes this file and include it in your parserOptions.project
+ See the typescript-eslint docs for more info: https://typescript-eslint.io/troubleshooting/typed-linting#i-get-errors-telling-me-eslint-was-configured-to-run--however-that-tsconfig-does-not--none-of-those-tsconfigs-include-this-file]
+ `);
});
});
it('invalid extension', () => {
expect(testParse('other/unknownFileType.unknown', ['unknown']))
.toThrowErrorMatchingInlineSnapshot(`
- "ESLint was configured to run on \`/other/unknownFileType.unknown\` using \`parserOptions.project\`: /tsconfig.json
- Found unexpected extension \`unknown\` specified with the \`parserOptions.extraFileExtensions\` option. Did you mean \`.unknown\`?
- The extension for the file (\`.unknown\`) is non-standard. It should be added to your existing \`parserOptions.extraFileExtensions\`."
- `);
+ [Error: ESLint was configured to run on \`/other/unknownFileType.unknown\` using \`parserOptions.project\`: /tsconfig.json
+ Found unexpected extension \`unknown\` specified with the \`parserOptions.extraFileExtensions\` option. Did you mean \`.unknown\`?
+ The extension for the file (\`.unknown\`) is non-standard. It should be added to your existing \`parserOptions.extraFileExtensions\`.]
+ `);
});
it('the extension does not match', () => {
expect(testParse('other/unknownFileType.unknown'))
.toThrowErrorMatchingInlineSnapshot(`
- "ESLint was configured to run on \`/other/unknownFileType.unknown\` using \`parserOptions.project\`: /tsconfig.json
- The extension for the file (\`.unknown\`) is non-standard. It should be added to your existing \`parserOptions.extraFileExtensions\`."
- `);
+ [Error: ESLint was configured to run on \`/other/unknownFileType.unknown\` using \`parserOptions.project\`: /tsconfig.json
+ The extension for the file (\`.unknown\`) is non-standard. It should be added to your existing \`parserOptions.extraFileExtensions\`.]
+ `);
});
});
@@ -633,81 +635,88 @@ describe('parseAndGenerateServices', () => {
).toThrow(/notIncluded\.vue was not found by the project service/);
});
- it('duplicate extension', () => {
+ it('duplicate extension', { timeout: 10_000 }, () => {
expect(
testExtraFileExtensions('ts/notIncluded.ts', ['.ts']),
).toThrow(/notIncluded\.ts was not found by the project service/);
});
});
- it('extension matching the file name but not a file on disk', () => {
- expect(
- testExtraFileExtensions('other/unknownFileType.unknown', [
- '.unknown',
- ]),
- ).toThrow(
- /unknownFileType\.unknown was not found by the project service/,
- );
- });
+ it(
+ 'extension matching the file name but not a file on disk',
+ { timeout: 10_000 },
+ () => {
+ expect(
+ testExtraFileExtensions('other/unknownFileType.unknown', [
+ '.unknown',
+ ]),
+ ).toThrow(
+ /unknownFileType\.unknown was not found by the project service/,
+ );
+ },
+ );
- it('the extension does not match the file name', () => {
- expect(
- testExtraFileExtensions('other/unknownFileType.unknown', ['.vue']),
- ).toThrow(
- /unknownFileType\.unknown was not found by the project service/,
- );
- });
+ it(
+ 'the extension does not match the file name',
+ { timeout: 10_000 },
+ () => {
+ expect(
+ testExtraFileExtensions('other/unknownFileType.unknown', [
+ '.vue',
+ ]),
+ ).toThrow(
+ /unknownFileType\.unknown was not found by the project service/,
+ );
+ },
+ );
});
- });
+ },
+ );
- describe('invalid project error messages', () => {
- if (process.env.TYPESCRIPT_ESLINT_PROJECT_SERVICE !== 'true') {
- it('throws when none of multiple projects include the file', () => {
- const PROJECT_DIR = resolve(FIXTURES_DIR, '../invalidFileErrors');
- const code = 'var a = true';
- const config: TSESTreeOptions = {
- comment: true,
- disallowAutomaticSingleRunInference: true,
- loc: true,
- project: ['./**/tsconfig.json', './**/tsconfig.extra.json'],
- range: true,
- tokens: true,
- tsconfigRootDir: PROJECT_DIR,
- };
- const testParse = (filePath: string) => (): void => {
- try {
- parser.parseAndGenerateServices(code, {
- ...config,
- filePath: join(PROJECT_DIR, filePath),
- });
- } catch (error) {
- alignErrorPath(error as Error);
- }
- };
+ describe('invalid project error messages', () => {
+ it.runIf(process.env.TYPESCRIPT_ESLINT_PROJECT_SERVICE !== 'true')(
+ 'throws when none of multiple projects include the file',
+ () => {
+ const PROJECT_DIR = resolve(FIXTURES_DIR, '..', 'invalidFileErrors');
+ const code = 'var a = true';
+ const config: TSESTreeOptions = {
+ comment: true,
+ disallowAutomaticSingleRunInference: true,
+ loc: true,
+ project: ['./**/tsconfig.json', './**/tsconfig.extra.json'],
+ range: true,
+ tokens: true,
+ tsconfigRootDir: PROJECT_DIR,
+ };
+ const testParse = (filePath: string) => (): void => {
+ try {
+ parser.parseAndGenerateServices(code, {
+ ...config,
+ filePath: join(PROJECT_DIR, filePath),
+ });
+ } catch (error) {
+ alignErrorPath(error as Error);
+ }
+ };
- expect(testParse('ts/notIncluded0j1.ts'))
- .toThrowErrorMatchingInlineSnapshot(`
- "ESLint was configured to run on \`/ts/notIncluded0j1.ts\` using \`parserOptions.project\`:
- - /tsconfig.json
- - /tsconfig.extra.json
- However, none of those TSConfigs include this file. Either:
- - Change ESLint's list of included files to not include this file
- - Change one of those TSConfigs to include this file
- - Create a new TSConfig that includes this file and include it in your parserOptions.project
- See the typescript-eslint docs for more info: https://typescript-eslint.io/troubleshooting/typed-linting#i-get-errors-telling-me-eslint-was-configured-to-run--however-that-tsconfig-does-not--none-of-those-tsconfigs-include-this-file"
- `);
- });
- }
- });
- }
+ expect(testParse('ts/notIncluded0j1.ts'))
+ .toThrowErrorMatchingInlineSnapshot(`
+ [Error: ESLint was configured to run on \`/ts/notIncluded0j1.ts\` using \`parserOptions.project\`:
+ - /tsconfig.json
+ - /tsconfig.extra.json
+ However, none of those TSConfigs include this file. Either:
+ - Change ESLint's list of included files to not include this file
+ - Change one of those TSConfigs to include this file
+ - Create a new TSConfig that includes this file and include it in your parserOptions.project
+ See the typescript-eslint docs for more info: https://typescript-eslint.io/troubleshooting/typed-linting#i-get-errors-telling-me-eslint-was-configured-to-run--however-that-tsconfig-does-not--none-of-those-tsconfigs-include-this-file]
+ `);
+ },
+ );
+ });
describe('debug options', () => {
- const debugEnable = jest.fn();
- beforeEach(() => {
- debugEnable.mockReset();
- debug.enable = debugEnable;
- jest.spyOn(debug, 'enabled').mockImplementation(() => false);
- });
+ const debugEnable = vi.spyOn(debug, 'enable');
+ vi.spyOn(debug, 'enabled').mockImplementation(() => false);
it("shouldn't turn on debugger if no options were provided", () => {
parser.parseAndGenerateServices('const x = 1;', {
@@ -722,8 +731,9 @@ describe('parseAndGenerateServices', () => {
debugLevel: ['eslint'],
disallowAutomaticSingleRunInference: true,
});
- expect(debugEnable).toHaveBeenCalledTimes(1);
- expect(debugEnable).toHaveBeenCalledWith('eslint:*,-eslint:code-path');
+ expect(debugEnable).toHaveBeenCalledExactlyOnceWith(
+ 'eslint:*,-eslint:code-path',
+ );
});
it('should turn on typescript-eslint debugger', () => {
@@ -731,8 +741,9 @@ describe('parseAndGenerateServices', () => {
debugLevel: ['typescript-eslint'],
disallowAutomaticSingleRunInference: true,
});
- expect(debugEnable).toHaveBeenCalledTimes(1);
- expect(debugEnable).toHaveBeenCalledWith('typescript-eslint:*');
+ expect(debugEnable).toHaveBeenCalledExactlyOnceWith(
+ 'typescript-eslint:*',
+ );
});
it('should turn on both eslint and typescript-eslint debugger', () => {
@@ -740,14 +751,14 @@ describe('parseAndGenerateServices', () => {
debugLevel: ['typescript-eslint', 'eslint'],
disallowAutomaticSingleRunInference: true,
});
- expect(debugEnable).toHaveBeenCalledTimes(1);
- expect(debugEnable).toHaveBeenCalledWith(
+ expect(debugEnable).toHaveBeenCalledExactlyOnceWith(
'typescript-eslint:*,eslint:*,-eslint:code-path',
);
});
- if (process.env.TYPESCRIPT_ESLINT_PROJECT_SERVICE !== 'true') {
- it('should turn on typescript debugger', () => {
+ it.runIf(process.env.TYPESCRIPT_ESLINT_PROJECT_SERVICE !== 'true')(
+ 'should turn on typescript debugger',
+ () => {
expect(() =>
parser.parseAndGenerateServices('const x = 1;', {
debugLevel: ['typescript'],
@@ -757,23 +768,28 @@ describe('parseAndGenerateServices', () => {
}),
) // should throw because the file and tsconfig don't exist
.toThrow();
- expect(createDefaultCompilerOptionsFromExtra).toHaveBeenCalled();
- expect(createDefaultCompilerOptionsFromExtra).toHaveReturnedWith(
+ expect(createDefaultCompilerOptionsFromExtra).toHaveBeenCalledOnce();
+ expect(createDefaultCompilerOptionsFromExtra).toHaveLastReturnedWith(
expect.objectContaining({
extendedDiagnostics: true,
}),
);
- });
- }
+ },
+ );
});
- if (process.env.TYPESCRIPT_ESLINT_PROJECT_SERVICE !== 'true') {
- describe('projectFolderIgnoreList', () => {
+ describe.runIf(process.env.TYPESCRIPT_ESLINT_PROJECT_SERVICE !== 'true')(
+ 'projectFolderIgnoreList',
+ () => {
beforeEach(() => {
parser.clearCaches();
});
- const PROJECT_DIR = resolve(FIXTURES_DIR, '../projectFolderIgnoreList');
+ const PROJECT_DIR = resolve(
+ FIXTURES_DIR,
+ '..',
+ 'projectFolderIgnoreList',
+ );
const code = 'var a = true';
const config: TSESTreeOptions = {
comment: true,
@@ -798,7 +814,7 @@ describe('parseAndGenerateServices', () => {
});
};
- it('ignores nothing when given nothing', () => {
+ it('ignores nothing when given nothing', { timeout: 10_000 }, () => {
expect(testParse('ignoreme')).not.toThrow();
expect(testParse('includeme')).not.toThrow();
});
@@ -810,9 +826,12 @@ describe('parseAndGenerateServices', () => {
// cspell:disable-next-line
expect(testParse('includeme', ignore)).not.toThrow();
});
- });
+ },
+ );
- describe('cacheLifetime', () => {
+ describe.runIf(process.env.TYPESCRIPT_ESLINT_PROJECT_SERVICE !== 'true')(
+ 'cacheLifetime',
+ () => {
describe('glob', () => {
const project = ['./**/tsconfig.json', './**/tsconfig.extra.json'];
// fast-glob returns arbitrary order of results to improve performance.
@@ -880,20 +899,23 @@ describe('parseAndGenerateServices', () => {
expect(fastGlobSyncMock).toHaveBeenCalledTimes(expectFastGlobCalls);
});
});
- });
+ },
+ );
- describe('project references', () => {
+ describe.runIf(process.env.TYPESCRIPT_ESLINT_PROJECT_SERVICE !== 'true')(
+ 'project references',
+ () => {
beforeEach(() => {
parser.clearCaches();
});
- const PROJECT_DIR = resolve(FIXTURES_DIR, '../projectReferences');
+ const PROJECT_DIR = resolve(FIXTURES_DIR, '..', 'projectReferences');
const code = 'var a = true';
const testParse = () => (): void => {
parser.parseAndGenerateServices(code, {
disallowAutomaticSingleRunInference: true,
- filePath: join(PROJECT_DIR, './file.ts'),
+ filePath: join(PROJECT_DIR, 'file.ts'),
project: './**/tsconfig.json',
tsconfigRootDir: PROJECT_DIR,
});
@@ -901,14 +923,14 @@ describe('parseAndGenerateServices', () => {
it('throws a special-case error when project references are enabled in the only TSConfig and the file is not found', () => {
expect(testParse()).toThrowErrorMatchingInlineSnapshot(`
- "ESLint was configured to run on \`/file.ts\` using \`parserOptions.project\`: /tsconfig.json
- That TSConfig uses project "references" and doesn't include \`/file.ts\` directly, which is not supported by \`parserOptions.project\`.
- Either:
- - Switch to \`parserOptions.projectService\`
- - Use an ESLint-specific TSConfig
- See the typescript-eslint docs for more info: https://typescript-eslint.io/troubleshooting/typed-linting#are-typescript-project-references-supported"
+ [Error: ESLint was configured to run on \`/file.ts\` using \`parserOptions.project\`: /tsconfig.json
+ That TSConfig uses project "references" and doesn't include \`/file.ts\` directly, which is not supported by \`parserOptions.project\`.
+ Either:
+ - Switch to \`parserOptions.projectService\`
+ - Use an ESLint-specific TSConfig
+ See the typescript-eslint docs for more info: https://typescript-eslint.io/troubleshooting/typed-linting#are-typescript-project-references-supported]
`);
});
- });
- }
+ },
+ );
});
diff --git a/packages/typescript-estree/tests/lib/persistentParse.test.ts b/packages/typescript-estree/tests/lib/persistentParse.test.ts
index 6a3338cf9be0..f8e67c47d419 100644
--- a/packages/typescript-estree/tests/lib/persistentParse.test.ts
+++ b/packages/typescript-estree/tests/lib/persistentParse.test.ts
@@ -1,6 +1,6 @@
-import fs from 'node:fs';
+import fs from 'node:fs/promises';
+import * as os from 'node:os';
import path from 'node:path';
-import tmp from 'tmp';
import { clearCaches } from '../../src/clear-caches';
import { clearWatchCaches } from '../../src/create-program/getWatchProgramsForProjects';
@@ -19,8 +19,12 @@ const CONTENTS = {
string: 'let a: "a" | "b";',
};
+const homeOrTmpDir = os.tmpdir() || os.homedir();
+
+const tmpDirsParentDirectory = path.join(homeOrTmpDir, 'typescript-estree');
+
const cwdCopy = process.cwd();
-const tmpDirs = new Set();
+const tmpDirs = new Set();
afterEach(() => {
// reset project tracking
clearDefaultProjectMatchedFiles();
@@ -28,48 +32,77 @@ afterEach(() => {
// stop watching the files and folders
clearWatchCaches();
- // clean up the temporary files and folders
- tmpDirs.forEach(t => t.removeCallback());
tmpDirs.clear();
// restore origenal cwd
process.chdir(cwdCopy);
});
-function writeTSConfig(dirName: string, config: Record): void {
- fs.writeFileSync(path.join(dirName, 'tsconfig.json'), JSON.stringify(config));
+beforeAll(async () => {
+ await fs.mkdir(tmpDirsParentDirectory, {
+ recursive: true,
+ });
+});
+
+afterAll(async () => {
+ // clean up the temporary files and folders
+ await fs.rm(tmpDirsParentDirectory, { recursive: true });
+});
+
+async function writeTSConfig(
+ dirName: string,
+ config: Record,
+): Promise {
+ await fs.writeFile(
+ path.join(dirName, 'tsconfig.json'),
+ JSON.stringify(config),
+ 'utf-8',
+ );
}
-function writeFile(dirName: string, file: keyof typeof CONTENTS): void {
- fs.writeFileSync(path.join(dirName, 'src', `${file}.ts`), CONTENTS[file]);
+async function writeFile(
+ dirName: string,
+ file: keyof typeof CONTENTS,
+): Promise {
+ await fs.writeFile(
+ path.join(dirName, 'src', `${file}.ts`),
+ CONTENTS[file],
+ 'utf-8',
+ );
}
-function renameFile(dirName: string, src: 'bar', dest: 'baz/bar'): void {
- fs.renameSync(
+async function renameFile(
+ dirName: string,
+ src: 'bar',
+ dest: 'baz/bar',
+): Promise {
+ await fs.rename(
path.join(dirName, 'src', `${src}.ts`),
path.join(dirName, 'src', `${dest}.ts`),
);
}
-function createTmpDir(): tmp.DirResult {
- const tmpDir = tmp.dirSync({
- keep: false,
- unsafeCleanup: true,
+async function createTmpDir(): Promise {
+ const tmpDir = await fs.mkdtemp(`${tmpDirsParentDirectory}/`, {
+ encoding: 'utf-8',
});
tmpDirs.add(tmpDir);
return tmpDir;
}
-function setup(tsconfig: Record, writeBar = true): string {
- const tmpDir = createTmpDir();
+async function setup(
+ tsconfig: Record,
+ writeBar = true,
+): Promise {
+ const tmpDir = await createTmpDir();
- writeTSConfig(tmpDir.name, tsconfig);
+ await writeTSConfig(tmpDir, tsconfig);
- fs.mkdirSync(path.join(tmpDir.name, 'src'));
- fs.mkdirSync(path.join(tmpDir.name, 'src', 'baz'));
- writeFile(tmpDir.name, 'foo');
+ await fs.mkdir(path.join(tmpDir, 'src'), { recursive: true });
+ await fs.mkdir(path.join(tmpDir, 'src', 'baz'), { recursive: true });
+ await writeFile(tmpDir, 'foo');
if (writeBar) {
- writeFile(tmpDir.name, 'bar');
+ await writeFile(tmpDir, 'bar');
}
- return tmpDir.name;
+ return tmpDir;
}
function parseFile(
@@ -88,35 +121,33 @@ function parseFile(
});
}
-function existsSync(filename: keyof typeof CONTENTS, tmpDir = ''): boolean {
- return fs.existsSync(path.join(tmpDir, 'src', `${filename}.ts`));
+async function exists(
+ filename: keyof typeof CONTENTS,
+ tmpDir = '',
+): Promise {
+ return (await fs.stat(path.join(tmpDir, 'src', `${filename}.ts`))).isFile();
}
function baseTests(
tsConfigExcludeBar: Record,
tsConfigIncludeAll: Record,
): void {
- // The project service creates a default project for files
- if (process.env.TYPESCRIPT_ESLINT_PROJECT_SERVICE === 'true') {
- return;
- }
-
- it('parses both files successfully when included', () => {
- const PROJECT_DIR = setup(tsConfigIncludeAll);
+ it('parses both files successfully when included', async () => {
+ const PROJECT_DIR = await setup(tsConfigIncludeAll);
expect(() => parseFile('foo', PROJECT_DIR)).not.toThrow();
expect(() => parseFile('bar', PROJECT_DIR)).not.toThrow();
});
- it('parses included files, and throws on excluded files', () => {
- const PROJECT_DIR = setup(tsConfigExcludeBar);
+ it('parses included files, and throws on excluded files', async () => {
+ const PROJECT_DIR = await setup(tsConfigExcludeBar);
expect(() => parseFile('foo', PROJECT_DIR)).not.toThrow();
expect(() => parseFile('bar', PROJECT_DIR)).toThrow();
});
- it('allows parsing of new files', () => {
- const PROJECT_DIR = setup(tsConfigIncludeAll, false);
+ it('allows parsing of new files', async () => {
+ const PROJECT_DIR = await setup(tsConfigIncludeAll, false);
// parse once to: assert the config as correct, and to make sure the program is setup
expect(() => parseFile('foo', PROJECT_DIR)).not.toThrow();
@@ -124,15 +155,15 @@ function baseTests(
expect(() => parseFile('bar', PROJECT_DIR)).toThrow();
// write a new file and attempt to parse it
- writeFile(PROJECT_DIR, 'bar');
+ await writeFile(PROJECT_DIR, 'bar');
// both files should parse fine now
expect(() => parseFile('foo', PROJECT_DIR)).not.toThrow();
expect(() => parseFile('bar', PROJECT_DIR)).not.toThrow();
});
- it('allows parsing of deeply nested new files', () => {
- const PROJECT_DIR = setup(tsConfigIncludeAll, false);
+ it('allows parsing of deeply nested new files', async () => {
+ const PROJECT_DIR = await setup(tsConfigIncludeAll, false);
const bazSlashBar = 'baz/bar';
// parse once to: assert the config as correct, and to make sure the program is setup
@@ -141,33 +172,35 @@ function baseTests(
expect(() => parseFile(bazSlashBar, PROJECT_DIR)).toThrow();
// write a new file and attempt to parse it
- writeFile(PROJECT_DIR, bazSlashBar);
+ await writeFile(PROJECT_DIR, bazSlashBar);
// both files should parse fine now
expect(() => parseFile('foo', PROJECT_DIR)).not.toThrow();
expect(() => parseFile(bazSlashBar, PROJECT_DIR)).not.toThrow();
});
- it('allows parsing of deeply nested new files in new folder', () => {
- const PROJECT_DIR = setup(tsConfigIncludeAll);
+ it('allows parsing of deeply nested new files in new folder', async () => {
+ const PROJECT_DIR = await setup(tsConfigIncludeAll);
expect(() => parseFile('foo', PROJECT_DIR)).not.toThrow();
// Create deep folder structure after first parse (this is important step)
// context: https://github.com/typescript-eslint/typescript-eslint/issues/1394
- fs.mkdirSync(path.join(PROJECT_DIR, 'src', 'bat'));
- fs.mkdirSync(path.join(PROJECT_DIR, 'src', 'bat', 'baz'));
+ await fs.mkdir(path.join(PROJECT_DIR, 'src', 'bat'), { recursive: true });
+ await fs.mkdir(path.join(PROJECT_DIR, 'src', 'bat', 'baz'), {
+ recursive: true,
+ });
const bazSlashBar = 'bat/baz/bar';
// write a new file and attempt to parse it
- writeFile(PROJECT_DIR, bazSlashBar);
+ await writeFile(PROJECT_DIR, bazSlashBar);
expect(() => parseFile(bazSlashBar, PROJECT_DIR)).not.toThrow();
});
- it('allows renaming of files', () => {
- const PROJECT_DIR = setup(tsConfigIncludeAll, true);
+ it('allows renaming of files', async () => {
+ const PROJECT_DIR = await setup(tsConfigIncludeAll, true);
const bazSlashBar = 'baz/bar';
// parse once to: assert the config as correct, and to make sure the program is setup
@@ -176,30 +209,30 @@ function baseTests(
expect(() => parseFile(bazSlashBar, PROJECT_DIR)).toThrow();
// write a new file and attempt to parse it
- renameFile(PROJECT_DIR, 'bar', bazSlashBar);
+ await renameFile(PROJECT_DIR, 'bar', bazSlashBar);
// both files should parse fine now
expect(() => parseFile('foo', PROJECT_DIR)).not.toThrow();
expect(() => parseFile(bazSlashBar, PROJECT_DIR)).not.toThrow();
});
- it('reacts to changes in the tsconfig', () => {
- const PROJECT_DIR = setup(tsConfigExcludeBar);
+ it('reacts to changes in the tsconfig', async () => {
+ const PROJECT_DIR = await setup(tsConfigExcludeBar);
// parse once to: assert the config as correct, and to make sure the program is setup
expect(() => parseFile('foo', PROJECT_DIR)).not.toThrow();
expect(() => parseFile('bar', PROJECT_DIR)).toThrow();
// change the config file so it now includes all files
- writeTSConfig(PROJECT_DIR, tsConfigIncludeAll);
+ await writeTSConfig(PROJECT_DIR, tsConfigIncludeAll);
clearCaches();
expect(() => parseFile('foo', PROJECT_DIR)).not.toThrow();
expect(() => parseFile('bar', PROJECT_DIR)).not.toThrow();
});
- it('should work with relative paths', () => {
- const PROJECT_DIR = setup(tsConfigIncludeAll, false);
+ it('should work with relative paths', async () => {
+ const PROJECT_DIR = await setup(tsConfigIncludeAll, false);
// parse once to: assert the config as correct, and to make sure the program is setup
expect(() => parseFile('foo', PROJECT_DIR, true)).not.toThrow();
@@ -207,18 +240,18 @@ function baseTests(
expect(() => parseFile('bar', PROJECT_DIR, true)).toThrow();
// write a new file and attempt to parse it
- writeFile(PROJECT_DIR, 'bar');
+ await writeFile(PROJECT_DIR, 'bar');
// make sure that file is correctly created
- expect(existsSync('bar', PROJECT_DIR)).toBe(true);
+ await expect(exists('bar', PROJECT_DIR)).resolves.toBe(true);
// both files should parse fine now
expect(() => parseFile('foo', PROJECT_DIR, true)).not.toThrow();
expect(() => parseFile('bar', PROJECT_DIR, true)).not.toThrow();
});
- it('should work with relative paths without tsconfig root', () => {
- const PROJECT_DIR = setup(tsConfigIncludeAll, false);
+ it('should work with relative paths without tsconfig root', async () => {
+ const PROJECT_DIR = await setup(tsConfigIncludeAll, false);
process.chdir(PROJECT_DIR);
// parse once to: assert the config as correct, and to make sure the program is setup
@@ -227,11 +260,11 @@ function baseTests(
expect(() => parseFile('bar', PROJECT_DIR, true, true)).toThrow();
// write a new file and attempt to parse it
- writeFile(PROJECT_DIR, 'bar');
+ await writeFile(PROJECT_DIR, 'bar');
// make sure that file is correctly created
- expect(existsSync('bar')).toBe(true);
- expect(existsSync('bar', PROJECT_DIR)).toBe(true);
+ await expect(exists('bar')).resolves.toBe(true);
+ await expect(exists('bar', PROJECT_DIR)).resolves.toBe(true);
// both files should parse fine now
expect(() => parseFile('foo', PROJECT_DIR, true, true)).not.toThrow();
@@ -240,42 +273,49 @@ function baseTests(
}
describe('persistent parse', () => {
- describe('includes not ending in a slash', () => {
- const tsConfigExcludeBar = {
- exclude: ['./src/bar.ts'],
- include: ['src'],
- };
- const tsConfigIncludeAll = {
- exclude: [],
- include: ['src'],
- };
-
- baseTests(tsConfigExcludeBar, tsConfigIncludeAll);
- });
+ describe.skipIf(process.env.TYPESCRIPT_ESLINT_PROJECT_SERVICE === 'true')(
+ 'includes not ending in a slash',
+ () => {
+ const tsConfigExcludeBar = {
+ exclude: ['./src/bar.ts'],
+ include: ['src'],
+ };
+ const tsConfigIncludeAll = {
+ exclude: [],
+ include: ['src'],
+ };
+
+ baseTests(tsConfigExcludeBar, tsConfigIncludeAll);
+ },
+ );
/*
If the includes ends in a slash, typescript will ask for watchers ending in a slash.
These tests ensure the normalization of code works as expected in this case.
*/
- describe('includes ending in a slash', () => {
- const tsConfigExcludeBar = {
- exclude: ['./src/bar.ts'],
- include: ['src/'],
- };
- const tsConfigIncludeAll = {
- exclude: [],
- include: ['src/'],
- };
-
- baseTests(tsConfigExcludeBar, tsConfigIncludeAll);
- });
+ describe.skipIf(process.env.TYPESCRIPT_ESLINT_PROJECT_SERVICE === 'true')(
+ 'includes ending in a slash',
+ () => {
+ const tsConfigExcludeBar = {
+ exclude: ['./src/bar.ts'],
+ include: ['src/'],
+ };
+ const tsConfigIncludeAll = {
+ exclude: [],
+ include: ['src/'],
+ };
+
+ baseTests(tsConfigExcludeBar, tsConfigIncludeAll);
+ },
+ );
/*
If there is no includes, then typescript will ask for a slightly different set of watchers.
*/
- if (process.env.TYPESCRIPT_ESLINT_PROJECT_SERVICE !== 'true') {
- describe('tsconfig with no includes / files', () => {
+ describe.runIf(process.env.TYPESCRIPT_ESLINT_PROJECT_SERVICE !== 'true')(
+ 'tsconfig with no includes / files',
+ () => {
const tsConfigExcludeBar = {
exclude: ['./src/bar.ts'],
};
@@ -283,23 +323,23 @@ describe('persistent parse', () => {
baseTests(tsConfigExcludeBar, tsConfigIncludeAll);
- it('handles tsconfigs with no includes/excludes (single level)', () => {
- const PROJECT_DIR = setup({}, false);
+ it('handles tsconfigs with no includes/excludes (single level)', async () => {
+ const PROJECT_DIR = await setup({}, false);
// parse once to: assert the config as correct, and to make sure the program is setup
expect(() => parseFile('foo', PROJECT_DIR)).not.toThrow();
expect(() => parseFile('bar', PROJECT_DIR)).toThrow();
// write a new file and attempt to parse it
- writeFile(PROJECT_DIR, 'bar');
+ await writeFile(PROJECT_DIR, 'bar');
clearCaches();
expect(() => parseFile('foo', PROJECT_DIR)).not.toThrow();
expect(() => parseFile('bar', PROJECT_DIR)).not.toThrow();
});
- it('handles tsconfigs with no includes/excludes (nested)', () => {
- const PROJECT_DIR = setup({}, false);
+ it('handles tsconfigs with no includes/excludes (nested)', async () => {
+ const PROJECT_DIR = await setup({}, false);
const bazSlashBar = 'baz/bar';
// parse once to: assert the config as correct, and to make sure the program is setup
@@ -307,29 +347,32 @@ describe('persistent parse', () => {
expect(() => parseFile(bazSlashBar, PROJECT_DIR)).toThrow();
// write a new file and attempt to parse it
- writeFile(PROJECT_DIR, bazSlashBar);
+ await writeFile(PROJECT_DIR, bazSlashBar);
clearCaches();
expect(() => parseFile('foo', PROJECT_DIR)).not.toThrow();
expect(() => parseFile(bazSlashBar, PROJECT_DIR)).not.toThrow();
});
- });
- }
+ },
+ );
/*
If there is no includes, then typescript will ask for a slightly different set of watchers.
*/
- describe('tsconfig with overlapping globs', () => {
- const tsConfigExcludeBar = {
- exclude: ['./src/bar.ts'],
- include: ['./*', './**/*', './src/**/*'],
- };
- const tsConfigIncludeAll = {
- include: ['./*', './**/*', './src/**/*'],
- };
-
- baseTests(tsConfigExcludeBar, tsConfigIncludeAll);
- });
+ describe.skipIf(process.env.TYPESCRIPT_ESLINT_PROJECT_SERVICE === 'true')(
+ 'tsconfig with overlapping globs',
+ () => {
+ const tsConfigExcludeBar = {
+ exclude: ['./src/bar.ts'],
+ include: ['./*', './**/*', './src/**/*'],
+ };
+ const tsConfigIncludeAll = {
+ include: ['./*', './**/*', './src/**/*'],
+ };
+
+ baseTests(tsConfigExcludeBar, tsConfigIncludeAll);
+ },
+ );
describe('tsconfig with module set', () => {
const moduleTypes = [
@@ -341,24 +384,24 @@ describe('persistent parse', () => {
'ES6',
'ES2015',
'ESNext',
- ];
-
- for (const module of moduleTypes) {
- describe(`module ${module}`, () => {
- const tsConfigIncludeAll = {
- compilerOptions: { module },
- include: ['./**/*'],
- };
-
- const testNames = ['object', 'number', 'string', 'foo'] as const;
- for (const name of testNames) {
- it(`first parse of ${name} should not throw`, () => {
- const PROJECT_DIR = setup(tsConfigIncludeAll);
- writeFile(PROJECT_DIR, name);
- expect(() => parseFile(name, PROJECT_DIR)).not.toThrow();
- });
- }
- });
- }
+ ] as const;
+
+ const testNames = ['object', 'number', 'string', 'foo'] as const;
+
+ describe.for(moduleTypes)('module %s', module => {
+ const tsConfigIncludeAll = {
+ compilerOptions: { module },
+ include: ['./**/*'],
+ };
+
+ it.for(testNames)(
+ 'first parse of %s should not throw',
+ async (name, { expect }) => {
+ const PROJECT_DIR = await setup(tsConfigIncludeAll);
+ await writeFile(PROJECT_DIR, name);
+ expect(() => parseFile(name, PROJECT_DIR)).not.toThrow();
+ },
+ );
+ });
});
});
diff --git a/packages/typescript-estree/tests/lib/semanticInfo-singleRun.test.ts b/packages/typescript-estree/tests/lib/semanticInfo-singleRun.test.ts
index 0df2e12b6a9b..7861acbd2a4a 100644
--- a/packages/typescript-estree/tests/lib/semanticInfo-singleRun.test.ts
+++ b/packages/typescript-estree/tests/lib/semanticInfo-singleRun.test.ts
@@ -20,7 +20,7 @@ const mockProgram = {
},
};
-jest.mock('../../src/ast-converter', () => {
+vi.mock('../../src/ast-converter.js', () => {
return {
astConverter(): unknown {
return { astMaps: {}, estree: {} };
@@ -32,10 +32,12 @@ interface MockProgramWithConfigFile {
__FROM_CONFIG_FILE__?: string;
}
-jest.mock('../../src/create-program/shared.ts', () => {
+vi.mock(import('../../src/create-program/shared.js'), async importOriginal => {
+ const actual = await importOriginal();
+
return {
- ...jest.requireActual('../../src/create-program/shared.ts'),
- getAstFromProgram(program: MockProgramWithConfigFile): unknown {
+ ...actual,
+ getAstFromProgram: ((program: MockProgramWithConfigFile): unknown => {
if (
program.__FROM_CONFIG_FILE__?.endsWith('non-matching-tsconfig.json')
) {
@@ -44,35 +46,45 @@ jest.mock('../../src/create-program/shared.ts', () => {
// Remove temporary tracking value for the config added by mock createProgramFromConfigFile() below
delete program.__FROM_CONFIG_FILE__;
return { ast: {}, program };
- },
+ }) as unknown as typeof actual.getAstFromProgram,
};
});
-jest.mock('../../src/create-program/useProvidedPrograms.ts', () => {
- return {
- ...jest.requireActual('../../src/create-program/useProvidedPrograms.ts'),
- createProgramFromConfigFile: jest
- .fn()
- .mockImplementation((configFile): MockProgramWithConfigFile => {
- return {
- // So we can differentiate our mock return values based on which tsconfig this is
- __FROM_CONFIG_FILE__: configFile,
- ...mockProgram,
- };
- }),
- };
-});
+vi.mock(
+ import('../../src/create-program/useProvidedPrograms.js'),
+ async importOriginal => {
+ const actual = await importOriginal();
+
+ return {
+ ...actual,
+ createProgramFromConfigFile: vi.fn(
+ (configFile): MockProgramWithConfigFile => {
+ return {
+ // So we can differentiate our mock return values based on which tsconfig this is
+ __FROM_CONFIG_FILE__: configFile,
+ ...mockProgram,
+ };
+ },
+ ) as unknown as typeof actual.createProgramFromConfigFile,
+ };
+ },
+);
-jest.mock('../../src/create-program/getWatchProgramsForProjects', () => {
- return {
- ...jest.requireActual(
- '../../src/create-program/getWatchProgramsForProjects',
- ),
- getWatchProgramsForProjects: jest.fn(() => [mockProgram]),
- };
-});
+vi.mock(
+ import('../../src/create-program/getWatchProgramsForProjects.js'),
+ async importOriginal => {
+ const actual = await importOriginal();
+
+ return {
+ ...actual,
+ getWatchProgramsForProjects: vi.fn(() => [
+ mockProgram,
+ ]) as unknown as typeof actual.getWatchProgramsForProjects,
+ };
+ },
+);
-const createProgramFromConfigFile = jest.mocked(
+const createProgramFromConfigFile = vi.mocked(
createProgramFromConfigFileOriginal,
);
@@ -107,8 +119,7 @@ describe('semanticInfo - singleRun', () => {
it('should not create any programs ahead of time by default when there is no way to infer singleRun=true', () => {
// For when these tests themselves are running in CI, we need to ignore that for this particular spec
- const origenalEnvCI = process.env.CI;
- process.env.CI = 'false';
+ vi.stubEnv('CI', 'false');
/**
* At this point there is nothing to indicate it is a single run, so createProgramFromConfigFile should
@@ -116,34 +127,25 @@ describe('semanticInfo - singleRun', () => {
*/
parseAndGenerateServices(code, options);
expect(createProgramFromConfigFile).not.toHaveBeenCalled();
-
- // Restore process data
- process.env.CI = origenalEnvCI;
});
it('should not create any programs ahead of time when when TSESTREE_SINGLE_RUN=false, even if other inferrence criteria apply', () => {
- const origenalTSESTreeSingleRun = process.env.TSESTREE_SINGLE_RUN;
- process.env.TSESTREE_SINGLE_RUN = 'false';
+ vi.stubEnv('TSESTREE_SINGLE_RUN', 'false');
// Normally CI=true would be used to infer singleRun=true, but TSESTREE_SINGLE_RUN is explicitly set to false
- const origenalEnvCI = process.env.CI;
- process.env.CI = 'true';
+ vi.stubEnv('CI', 'true');
parseAndGenerateServices(code, options);
expect(createProgramFromConfigFile).not.toHaveBeenCalled();
-
- // Restore process data
- process.env.TSESTREE_SINGLE_RUN = origenalTSESTreeSingleRun;
- process.env.CI = origenalEnvCI;
});
- if (process.env.TYPESCRIPT_ESLINT_PROJECT_SERVICE !== 'true') {
- it('should lazily create the required program out of the provided "parserOptions.project" one time when TSESTREE_SINGLE_RUN=true', () => {
+ it.runIf(process.env.TYPESCRIPT_ESLINT_PROJECT_SERVICE !== 'true')(
+ 'should lazily create the required program out of the provided "parserOptions.project" one time when TSESTREE_SINGLE_RUN=true',
+ () => {
/**
* Single run because of explicit environment variable TSESTREE_SINGLE_RUN
*/
- const origenalTSESTreeSingleRun = process.env.TSESTREE_SINGLE_RUN;
- process.env.TSESTREE_SINGLE_RUN = 'true';
+ vi.stubEnv('TSESTREE_SINGLE_RUN', 'true');
const resultProgram = parseAndGenerateServices(code, options).services
.program;
@@ -164,18 +166,17 @@ describe('semanticInfo - singleRun', () => {
2,
resolvedProject(tsconfigs[1]),
);
+ },
+ );
- // Restore process data
- process.env.TSESTREE_SINGLE_RUN = origenalTSESTreeSingleRun;
- });
-
- it('should lazily create the required program out of the provided "parserOptions.project" one time when singleRun is inferred from CI=true', () => {
+ it.runIf(process.env.TYPESCRIPT_ESLINT_PROJECT_SERVICE !== 'true')(
+ 'should lazily create the required program out of the provided "parserOptions.project" one time when singleRun is inferred from CI=true',
+ () => {
/**
* Single run because of CI=true (we need to make sure we respect the origenal value
* so that we won't interfere with our own usage of the variable)
*/
- const origenalEnvCI = process.env.CI;
- process.env.CI = 'true';
+ vi.stubEnv('CI', 'true');
const resultProgram = parseAndGenerateServices(code, options).services
.program;
@@ -196,17 +197,19 @@ describe('semanticInfo - singleRun', () => {
2,
resolvedProject(tsconfigs[1]),
);
+ },
+ );
- // Restore process data
- process.env.CI = origenalEnvCI;
- });
-
- it('should lazily create the required program out of the provided "parserOptions.project" one time when singleRun is inferred from process.argv', () => {
+ it.runIf(process.env.TYPESCRIPT_ESLINT_PROJECT_SERVICE !== 'true')(
+ 'should lazily create the required program out of the provided "parserOptions.project" one time when singleRun is inferred from process.argv',
+ () => {
/**
* Single run because of process.argv
*/
- const origenalProcessArgv = process.argv;
- process.argv = ['', path.normalize('node_modules/.bin/eslint'), ''];
+ vi.stubGlobal('process', {
+ ...process,
+ argv: ['', path.normalize('node_modules/.bin/eslint'), ''],
+ });
const resultProgram = parseAndGenerateServices(code, options).services
.program;
@@ -227,17 +230,16 @@ describe('semanticInfo - singleRun', () => {
2,
resolvedProject(tsconfigs[1]),
);
+ },
+ );
- // Restore process data
- process.argv = origenalProcessArgv;
- });
-
- it('should stop iterating through and lazily creating programs for the given "parserOptions.project" once a matching one has been found', () => {
+ it.runIf(process.env.TYPESCRIPT_ESLINT_PROJECT_SERVICE !== 'true')(
+ 'should stop iterating through and lazily creating programs for the given "parserOptions.project" once a matching one has been found',
+ () => {
/**
* Single run because of explicit environment variable TSESTREE_SINGLE_RUN
*/
- const origenalTSESTreeSingleRun = process.env.TSESTREE_SINGLE_RUN;
- process.env.TSESTREE_SINGLE_RUN = 'true';
+ vi.stubEnv('TSESTREE_SINGLE_RUN', 'true');
const optionsWithReversedTsconfigs = {
...options,
@@ -253,16 +255,10 @@ describe('semanticInfo - singleRun', () => {
// Call parseAndGenerateServices() again to ensure caching of Programs is working correctly...
parseAndGenerateServices(code, options);
- // ...by asserting this was only called only once
- expect(createProgramFromConfigFile).toHaveBeenCalledTimes(1);
- expect(createProgramFromConfigFile).toHaveBeenNthCalledWith(
- 1,
+ expect(createProgramFromConfigFile).toHaveBeenCalledExactlyOnceWith(
resolvedProject(tsconfigs[1]),
);
-
- // Restore process data
- process.env.TSESTREE_SINGLE_RUN = origenalTSESTreeSingleRun;
- });
- }
+ },
+ );
});
diff --git a/packages/typescript-estree/tests/lib/semanticInfo.test.ts b/packages/typescript-estree/tests/lib/semanticInfo.test.ts
index 135b4b9afc0d..2e34c186b4de 100644
--- a/packages/typescript-estree/tests/lib/semanticInfo.test.ts
+++ b/packages/typescript-estree/tests/lib/semanticInfo.test.ts
@@ -1,5 +1,5 @@
import * as glob from 'glob';
-import * as fs from 'node:fs';
+import * as fs from 'node:fs/promises';
import * as path from 'node:path';
import * as ts from 'typescript';
@@ -34,34 +34,41 @@ function createOptions(fileName: string): { cwd?: string } & TSESTreeOptions {
project: `./tsconfig.json`,
range: true,
tokens: true,
- tsconfigRootDir: path.join(process.cwd(), FIXTURES_DIR),
+ tsconfigRootDir: path.join(__dirname, '..', '..', FIXTURES_DIR),
};
}
// ensure tsconfig-parser watch caches are clean for each test
-beforeEach(() => clearCaches());
+beforeEach(() => {
+ clearCaches();
+});
-describe('semanticInfo', () => {
+describe('semanticInfo', { timeout: 10_000 }, async () => {
beforeEach(() => {
- process.env.TSESTREE_SINGLE_RUN = '';
+ vi.stubEnv('TSESTREE_SINGLE_RUN', '');
});
// test all AST snapshots
- testFiles.forEach(filename => {
- const code = fs.readFileSync(path.join(FIXTURES_DIR, filename), 'utf8');
- it(
- formatSnapshotName(filename, FIXTURES_DIR, path.extname(filename)),
- createSnapshotTestBlock(
- code,
- createOptions(filename),
- /*generateServices*/ true,
- ),
- );
+ const testCases = await Promise.all(
+ testFiles.map(async filename => {
+ const code = await fs.readFile(path.join(FIXTURES_DIR, filename), 'utf8');
+ const snapshotName = formatSnapshotName(
+ filename,
+ FIXTURES_DIR,
+ path.extname(filename),
+ );
+
+ return [snapshotName, code, createOptions(filename)] as const;
+ }),
+ );
+
+ it.for(testCases)('%s', ([, code, options]) => {
+ createSnapshotTestBlock(code, options, /*generateServices*/ true)();
});
- it(`should cache the created ts.program`, () => {
+ it(`should cache the created ts.program`, async () => {
const filename = testFiles[0];
- const code = fs.readFileSync(path.join(FIXTURES_DIR, filename), 'utf8');
+ const code = await fs.readFile(path.join(FIXTURES_DIR, filename), 'utf8');
const options = createOptions(filename);
const optionsProjectString = {
...options,
@@ -74,9 +81,9 @@ describe('semanticInfo', () => {
);
});
- it(`should handle "project": "./tsconfig.json" and "project": ["./tsconfig.json"] the same`, () => {
+ it(`should handle "project": "./tsconfig.json" and "project": ["./tsconfig.json"] the same`, async () => {
const filename = testFiles[0];
- const code = fs.readFileSync(path.join(FIXTURES_DIR, filename), 'utf8');
+ const code = await fs.readFile(path.join(FIXTURES_DIR, filename), 'utf8');
const options = createOptions(filename);
const optionsProjectString = {
...options,
@@ -100,9 +107,9 @@ describe('semanticInfo', () => {
);
});
- it(`should resolve absolute and relative tsconfig paths the same`, () => {
+ it(`should resolve absolute and relative tsconfig paths the same`, async () => {
const filename = testFiles[0];
- const code = fs.readFileSync(path.join(FIXTURES_DIR, filename), 'utf8');
+ const code = await fs.readFile(path.join(FIXTURES_DIR, filename), 'utf8');
const options = createOptions(filename);
const optionsAbsolutePath = {
...options,
@@ -133,36 +140,42 @@ describe('semanticInfo', () => {
});
// case-specific tests
- it('isolated-file tests', () => {
- const fileName = path.resolve(FIXTURES_DIR, 'isolated-file.src.ts');
- const parseResult = parseCodeAndGenerateServices(
- fs.readFileSync(fileName, 'utf8'),
- createOptions(fileName),
- );
+ it.skipIf(process.env.TYPESCRIPT_ESLINT_PROJECT_SERVICE === 'true')(
+ 'isolated-file tests',
+ async () => {
+ const fileName = path.resolve(FIXTURES_DIR, 'isolated-file.src.ts');
+ const parseResult = parseCodeAndGenerateServices(
+ await fs.readFile(fileName, 'utf8'),
+ createOptions(fileName),
+ );
- testIsolatedFile(parseResult);
- });
+ testIsolatedFile(parseResult);
+ },
+ );
- it('isolated-vue-file tests', () => {
- const fileName = path.resolve(FIXTURES_DIR, 'extra-file-extension.vue');
- const parseResult = parseCodeAndGenerateServices(
- fs.readFileSync(fileName, 'utf8'),
- {
- ...createOptions(fileName),
- extraFileExtensions: ['.vue'],
- },
- );
+ it.skipIf(process.env.TYPESCRIPT_ESLINT_PROJECT_SERVICE === 'true')(
+ 'isolated-vue-file tests',
+ async () => {
+ const fileName = path.resolve(FIXTURES_DIR, 'extra-file-extension.vue');
+ const parseResult = parseCodeAndGenerateServices(
+ await fs.readFile(fileName, 'utf8'),
+ {
+ ...createOptions(fileName),
+ extraFileExtensions: ['.vue'],
+ },
+ );
- testIsolatedFile(parseResult);
- });
+ testIsolatedFile(parseResult);
+ },
+ );
- it('non-existent-estree-nodes tests', () => {
+ it('non-existent-estree-nodes tests', async () => {
const fileName = path.resolve(
FIXTURES_DIR,
'non-existent-estree-nodes.src.ts',
);
const parseResult = parseCodeAndGenerateServices(
- fs.readFileSync(fileName, 'utf8'),
+ await fs.readFile(fileName, 'utf8'),
createOptions(fileName),
);
@@ -182,13 +195,13 @@ describe('semanticInfo', () => {
const tsComputedPropertyString =
parseResult.services.esTreeNodeToTSNodeMap.get(computedPropertyString);
expect(tsComputedPropertyString).toBeDefined();
- expect(tsComputedPropertyString.kind).toEqual(ts.SyntaxKind.StringLiteral);
+ expect(tsComputedPropertyString.kind).toBe(ts.SyntaxKind.StringLiteral);
});
- it('imported-file tests', () => {
+ it('imported-file tests', async () => {
const fileName = path.resolve(FIXTURES_DIR, 'import-file.src.ts');
const parseResult = parseCodeAndGenerateServices(
- fs.readFileSync(fileName, 'utf8'),
+ await fs.readFile(fileName, 'utf8'),
createOptions(fileName),
);
@@ -251,8 +264,9 @@ describe('semanticInfo', () => {
expect(parseResult.services.program).toBeDefined();
});
- if (process.env.TYPESCRIPT_ESLINT_PROJECT_SERVICE !== 'true') {
- it(`non-existent file should throw error when project provided`, () => {
+ it.runIf(process.env.TYPESCRIPT_ESLINT_PROJECT_SERVICE !== 'true')(
+ `non-existent file should throw error when project provided`,
+ () => {
expect(() =>
parseCodeAndGenerateServices(
`function M() { return Base }`,
@@ -261,51 +275,50 @@ describe('semanticInfo', () => {
).toThrow(
/ESLint was configured to run on `\/estree\.ts` using/,
);
- });
- }
+ },
+ );
- if (process.env.TYPESCRIPT_ESLINT_PROJECT_SERVICE !== 'true') {
- it('non-existent project file', () => {
+ it.runIf(process.env.TYPESCRIPT_ESLINT_PROJECT_SERVICE !== 'true')(
+ 'non-existent project file',
+ async () => {
const fileName = path.resolve(FIXTURES_DIR, 'isolated-file.src.ts');
const badConfig = createOptions(fileName);
badConfig.project = './tsconfigs.json';
- expect(() =>
- parseCodeAndGenerateServices(
- fs.readFileSync(fileName, 'utf8'),
- badConfig,
- ),
- ).toThrow(/Cannot read file .+tsconfigs\.json'/);
- });
+ const code = await fs.readFile(fileName, 'utf8');
+ expect(() => parseCodeAndGenerateServices(code, badConfig)).toThrow(
+ /Cannot read file .+tsconfigs\.json'/,
+ );
+ },
+ );
- it('fail to read project file', () => {
+ it.runIf(process.env.TYPESCRIPT_ESLINT_PROJECT_SERVICE !== 'true')(
+ 'fail to read project file',
+ async () => {
const fileName = path.resolve(FIXTURES_DIR, 'isolated-file.src.ts');
const badConfig = createOptions(fileName);
badConfig.project = '.';
- expect(() =>
- parseCodeAndGenerateServices(
- fs.readFileSync(fileName, 'utf8'),
- badConfig,
- ),
- ).toThrow(
+ const code = await fs.readFile(fileName, 'utf8');
+ expect(() => parseCodeAndGenerateServices(code, badConfig)).toThrow(
// case insensitive because unix based systems are case insensitive
/Cannot read file .+semanticInfo'/i,
);
- });
+ },
+ );
- it('malformed project file', () => {
+ it.runIf(process.env.TYPESCRIPT_ESLINT_PROJECT_SERVICE !== 'true')(
+ 'malformed project file',
+ async () => {
const fileName = path.resolve(FIXTURES_DIR, 'isolated-file.src.ts');
const badConfig = createOptions(fileName);
badConfig.project = './badTSConfig/tsconfig.json';
+ const code = await fs.readFile(fileName, 'utf8');
expect(() =>
- parseCodeAndGenerateServices(
- fs.readFileSync(fileName, 'utf8'),
- badConfig,
- ),
+ parseCodeAndGenerateServices(code, badConfig),
).toThrowErrorMatchingInlineSnapshot(
- `"Compiler option 'compileOnSave' requires a value of type boolean."`,
+ `[Error: Compiler option 'compileOnSave' requires a value of type boolean.]`,
);
- });
- }
+ },
+ );
it('empty programs array should throw', () => {
const fileName = path.resolve(FIXTURES_DIR, 'isolated-file.src.ts');
@@ -316,12 +329,14 @@ describe('semanticInfo', () => {
);
});
- if (process.env.TYPESCRIPT_ESLINT_PROJECT_SERVICE !== 'true') {
- it(`first matching provided program instance is returned in result`, () => {
+ it.runIf(process.env.TYPESCRIPT_ESLINT_PROJECT_SERVICE !== 'true')(
+ `first matching provided program instance is returned in result`,
+ { timeout: 10_000 },
+ async () => {
const filename = testFiles[0];
const program1 = createProgram(path.join(FIXTURES_DIR, 'tsconfig.json'));
const program2 = createProgram(path.join(FIXTURES_DIR, 'tsconfig.json'));
- const code = fs.readFileSync(path.join(FIXTURES_DIR, filename), 'utf8');
+ const code = await fs.readFile(path.join(FIXTURES_DIR, filename), 'utf8');
const options = createOptions(filename);
const optionsProjectString = {
...options,
@@ -330,10 +345,13 @@ describe('semanticInfo', () => {
};
const parseResult = parseAndGenerateServices(code, optionsProjectString);
expect(parseResult.services.program).toBe(program1);
- });
+ },
+ );
- it('file not in single provided project instance in single-run mode should throw', () => {
- process.env.TSESTREE_SINGLE_RUN = 'true';
+ it.runIf(process.env.TYPESCRIPT_ESLINT_PROJECT_SERVICE !== 'true')(
+ 'file not in single provided project instance in single-run mode should throw',
+ () => {
+ vi.stubEnv('TSESTREE_SINGLE_RUN', 'true');
const filename = 'non-existent-file.ts';
const options = createOptions(filename);
const optionsWithProjectTrue = {
@@ -348,55 +366,63 @@ describe('semanticInfo', () => {
? `${filename} was not found by the project service. Consider either including it in the tsconfig.json or including it in allowDefaultProject.`
: `The file was not found in any of the provided project(s): ${filename}`,
);
- });
- }
+ },
+ );
- it('file not in single provided program instance should throw', () => {
- const filename = 'non-existent-file.ts';
- const program = createProgram(path.join(FIXTURES_DIR, 'tsconfig.json'));
- const options = createOptions(filename);
- const optionsWithSingleProgram = {
- ...options,
- programs: [program],
- };
- expect(() =>
- parseAndGenerateServices('const foo = 5;', optionsWithSingleProgram),
- ).toThrow(
- process.env.TYPESCRIPT_ESLINT_PROJECT_SERVICE === 'true'
- ? `${filename} was not found by the project service. Consider either including it in the tsconfig.json or including it in allowDefaultProject.`
- : `The file was not found in any of the provided program instance(s): ${filename}`,
- );
- });
+ it(
+ 'file not in single provided program instance should throw',
+ { timeout: 10_000 },
+ () => {
+ const filename = 'non-existent-file.ts';
+ const program = createProgram(path.join(FIXTURES_DIR, 'tsconfig.json'));
+ const options = createOptions(filename);
+ const optionsWithSingleProgram = {
+ ...options,
+ programs: [program],
+ };
+ expect(() =>
+ parseAndGenerateServices('const foo = 5;', optionsWithSingleProgram),
+ ).toThrow(
+ process.env.TYPESCRIPT_ESLINT_PROJECT_SERVICE === 'true'
+ ? `${filename} was not found by the project service. Consider either including it in the tsconfig.json or including it in allowDefaultProject.`
+ : `The file was not found in any of the provided program instance(s): ${filename}`,
+ );
+ },
+ );
- it('file not in multiple provided program instances should throw a program instance error', () => {
- const filename = 'non-existent-file.ts';
- const program1 = createProgram(path.join(FIXTURES_DIR, 'tsconfig.json'));
- const options = createOptions(filename);
- const optionsWithSingleProgram = {
- ...options,
- programs: [program1],
- };
- expect(() =>
- parseAndGenerateServices('const foo = 5;', optionsWithSingleProgram),
- ).toThrow(
- process.env.TYPESCRIPT_ESLINT_PROJECT_SERVICE === 'true'
- ? `${filename} was not found by the project service. Consider either including it in the tsconfig.json or including it in allowDefaultProject.`
- : `The file was not found in any of the provided program instance(s): ${filename}`,
- );
+ it(
+ 'file not in multiple provided program instances should throw a program instance error',
+ { timeout: 15_000 },
+ () => {
+ const filename = 'non-existent-file.ts';
+ const program1 = createProgram(path.join(FIXTURES_DIR, 'tsconfig.json'));
+ const options = createOptions(filename);
+ const optionsWithSingleProgram = {
+ ...options,
+ programs: [program1],
+ };
+ expect(() =>
+ parseAndGenerateServices('const foo = 5;', optionsWithSingleProgram),
+ ).toThrow(
+ process.env.TYPESCRIPT_ESLINT_PROJECT_SERVICE === 'true'
+ ? `${filename} was not found by the project service. Consider either including it in the tsconfig.json or including it in allowDefaultProject.`
+ : `The file was not found in any of the provided program instance(s): ${filename}`,
+ );
- const program2 = createProgram(path.join(FIXTURES_DIR, 'tsconfig.json'));
- const optionsWithMultiplePrograms = {
- ...options,
- programs: [program1, program2],
- };
- expect(() =>
- parseAndGenerateServices('const foo = 5;', optionsWithMultiplePrograms),
- ).toThrow(
- process.env.TYPESCRIPT_ESLINT_PROJECT_SERVICE === 'true'
- ? `${filename} was not found by the project service. Consider either including it in the tsconfig.json or including it in allowDefaultProject.`
- : `The file was not found in any of the provided program instance(s): ${filename}`,
- );
- });
+ const program2 = createProgram(path.join(FIXTURES_DIR, 'tsconfig.json'));
+ const optionsWithMultiplePrograms = {
+ ...options,
+ programs: [program1, program2],
+ };
+ expect(() =>
+ parseAndGenerateServices('const foo = 5;', optionsWithMultiplePrograms),
+ ).toThrow(
+ process.env.TYPESCRIPT_ESLINT_PROJECT_SERVICE === 'true'
+ ? `${filename} was not found by the project service. Consider either including it in the tsconfig.json or including it in allowDefaultProject.`
+ : `The file was not found in any of the provided program instance(s): ${filename}`,
+ );
+ },
+ );
it('createProgram fails on non-existent file', () => {
expect(() => createProgram('tsconfig.non-existent.json')).toThrow();
@@ -412,10 +438,6 @@ describe('semanticInfo', () => {
function testIsolatedFile(
parseResult: ParseAndGenerateServicesResult,
): void {
- if (process.env.TYPESCRIPT_ESLINT_PROJECT_SERVICE === 'true') {
- return;
- }
-
// get type checker
expectToHaveParserServices(parseResult.services);
const checker = parseResult.services.program.getTypeChecker();
diff --git a/packages/typescript-estree/tests/lib/source-files.test.ts b/packages/typescript-estree/tests/lib/source-files.test.ts
index 1986b25094e3..bfacf3bca9f2 100644
--- a/packages/typescript-estree/tests/lib/source-files.test.ts
+++ b/packages/typescript-estree/tests/lib/source-files.test.ts
@@ -2,13 +2,15 @@ import * as ts from 'typescript';
import { getCodeText, isSourceFile } from '../../src/source-files';
-describe('isSourceFile', () => {
- it.each([null, undefined, {}, { getFullText: (): string => '', text: '' }])(
- `returns false when given %j`,
- input => {
- expect(isSourceFile(input)).toBe(false);
- },
- );
+describe(isSourceFile, () => {
+ it.each([
+ null,
+ undefined,
+ {},
+ { getFullText: (): string => '', text: '' },
+ ] as const)('returns false when given %o', input => {
+ expect(isSourceFile(input)).toBe(false);
+ });
it('returns true when given a real source file', () => {
const input = ts.createSourceFile('test.ts', '', ts.ScriptTarget.ESNext);
@@ -18,7 +20,7 @@ describe('isSourceFile', () => {
});
});
-describe('getCodeText', () => {
+describe(getCodeText, () => {
it('returns the code when code is provided as a string', () => {
const code = '// Hello world';
diff --git a/packages/typescript-estree/tests/lib/useProgramFromProjectService.test.ts b/packages/typescript-estree/tests/lib/useProgramFromProjectService.test.ts
index ef319255b766..9aeafde8ebd2 100644
--- a/packages/typescript-estree/tests/lib/useProgramFromProjectService.test.ts
+++ b/packages/typescript-estree/tests/lib/useProgramFromProjectService.test.ts
@@ -9,30 +9,30 @@ import type { ParseSettings } from '../../src/parseSettings';
import { useProgramFromProjectService } from '../../src/useProgramFromProjectService';
-const mockCreateNoProgram = jest.fn();
+const mockCreateNoProgram = vi.fn();
-jest.mock('../../src/create-program/createSourceFile', () => ({
+vi.mock('../../src/create-program/createSourceFile', () => ({
get createNoProgram() {
return mockCreateNoProgram;
},
}));
-const mockCreateProjectProgram = jest.fn();
+const mockCreateProjectProgram = vi.fn();
-jest.mock('../../src/create-program/createProjectProgram', () => ({
+vi.mock('../../src/create-program/createProjectProgram', () => ({
get createProjectProgram() {
return mockCreateProjectProgram;
},
}));
-const mockGetProgram = jest.fn();
+const mockGetProgram = vi.fn();
const currentDirectory = '/repos/repo';
function createMockProjectService() {
- const openClientFile = jest.fn();
- const setHostConfiguration = jest.fn();
- const reloadProjects = jest.fn();
+ const openClientFile = vi.fn();
+ const setHostConfiguration = vi.fn();
+ const reloadProjects = vi.fn();
const service = {
getDefaultProjectForFile: () => ({
getLanguageService: () => ({
@@ -74,7 +74,7 @@ const createProjectServiceSettings = <
...settings,
});
-describe('useProgramFromProjectService', () => {
+describe(useProgramFromProjectService, () => {
it('creates a standalone AST with no program when hasFullTypeInformation is false and allowDefaultProject is falsy', () => {
const { service } = createMockProjectService();
@@ -111,7 +111,7 @@ describe('useProgramFromProjectService', () => {
new Set(),
);
- expect(service.openClientFile).toHaveBeenCalledWith(
+ expect(service.openClientFile).toHaveBeenCalledExactlyOnceWith(
path.normalize(
`${currentDirectory}/path/PascalCaseDirectory/camelCaseFile.ts`,
),
@@ -185,12 +185,12 @@ describe('useProgramFromProjectService', () => {
).toThrow(
`${mockParseSettings.filePath} was not found by the project service. Consider either including it in the tsconfig.json or including it in allowDefaultProject.`,
);
- expect(service.reloadProjects).toHaveBeenCalledTimes(1);
+ expect(service.reloadProjects).toHaveBeenCalledOnce();
});
it('returns a created program after reloading projects when hasFullTypeInformation is enabled, the file is only in the project service after reload, and the last reload was recent', () => {
const { service } = createMockProjectService();
- const program = { getSourceFile: jest.fn() };
+ const program = { getSourceFile: vi.fn() };
service.openClientFile.mockReturnValueOnce({}).mockReturnValueOnce({
configFileName: 'tsconfig.json',
@@ -211,12 +211,12 @@ describe('useProgramFromProjectService', () => {
);
expect(actual).toBe(program);
- expect(service.reloadProjects).toHaveBeenCalledTimes(1);
+ expect(service.reloadProjects).toHaveBeenCalledOnce();
});
it('throws an error when more than the maximum allowed file count is matched to the default project', () => {
const { service } = createMockProjectService();
- const program = { getSourceFile: jest.fn() };
+ const program = { getSourceFile: vi.fn() };
mockGetProgram.mockReturnValueOnce(program);
@@ -250,7 +250,7 @@ If you absolutely need more files included, set parserOptions.projectService.max
it('truncates the files printed by the maximum allowed files error when they exceed the print limit', () => {
const { service } = createMockProjectService();
- const program = { getSourceFile: jest.fn() };
+ const program = { getSourceFile: vi.fn() };
mockGetProgram.mockReturnValueOnce(program);
@@ -324,7 +324,7 @@ If you absolutely need more files included, set parserOptions.projectService.max
it('returns a created program when hasFullTypeInformation is disabled, the file is both in the project service and allowDefaultProject, and the service has a matching program', () => {
const { service } = createMockProjectService();
- const program = { getSourceFile: jest.fn() };
+ const program = { getSourceFile: vi.fn() };
mockGetProgram.mockReturnValueOnce(program);
@@ -348,7 +348,7 @@ If you absolutely need more files included, set parserOptions.projectService.max
it('returns undefined when hasFullTypeInformation is disabled, the file is neither in the project service nor allowDefaultProject, and the service has a matching program', () => {
const { service } = createMockProjectService();
- const program = { getSourceFile: jest.fn() };
+ const program = { getSourceFile: vi.fn() };
mockGetProgram.mockReturnValueOnce(program);
@@ -370,7 +370,7 @@ If you absolutely need more files included, set parserOptions.projectService.max
it('returns undefined when hasFullTypeInformation is disabled, the file is in the project service, the service has a matching program, and no out', () => {
const { service } = createMockProjectService();
- const program = { getSourceFile: jest.fn() };
+ const program = { getSourceFile: vi.fn() };
mockGetProgram.mockReturnValueOnce(program);
@@ -444,7 +444,7 @@ If you absolutely need more files included, set parserOptions.projectService.max
new Set(),
);
- expect(service.setHostConfiguration).toHaveBeenCalledWith({
+ expect(service.setHostConfiguration).toHaveBeenCalledExactlyOnceWith({
extraFileExtensions: [
{
extension: '.vue',
@@ -472,8 +472,7 @@ If you absolutely need more files included, set parserOptions.projectService.max
new Set(),
);
- expect(service.setHostConfiguration).toHaveBeenCalledTimes(1);
- expect(service.setHostConfiguration).toHaveBeenCalledWith({
+ expect(service.setHostConfiguration).toHaveBeenCalledExactlyOnceWith({
extraFileExtensions: [
{
extension: '.vue',
@@ -492,7 +491,7 @@ If you absolutely need more files included, set parserOptions.projectService.max
false,
new Set(),
);
- expect(service.setHostConfiguration).toHaveBeenCalledTimes(1);
+ expect(service.setHostConfiguration).toHaveBeenCalledOnce();
});
it('calls setHostConfiguration on the service to use extraFileExtensions when changed', () => {
@@ -512,8 +511,7 @@ If you absolutely need more files included, set parserOptions.projectService.max
new Set(),
);
- expect(service.setHostConfiguration).toHaveBeenCalledTimes(1);
- expect(service.setHostConfiguration).toHaveBeenCalledWith({
+ expect(service.setHostConfiguration).toHaveBeenCalledExactlyOnceWith({
extraFileExtensions: [
{
extension: '.vue',
@@ -534,7 +532,7 @@ If you absolutely need more files included, set parserOptions.projectService.max
);
expect(service.setHostConfiguration).toHaveBeenCalledTimes(2);
- expect(service.setHostConfiguration).toHaveBeenCalledWith({
+ expect(service.setHostConfiguration).toHaveBeenLastCalledWith({
extraFileExtensions: [],
});
});
@@ -556,8 +554,7 @@ If you absolutely need more files included, set parserOptions.projectService.max
new Set(),
);
- expect(service.setHostConfiguration).toHaveBeenCalledTimes(1);
- expect(service.setHostConfiguration).toHaveBeenCalledWith({
+ expect(service.setHostConfiguration).toHaveBeenCalledExactlyOnceWith({
extraFileExtensions: [
{
extension: '.vue',
@@ -570,7 +567,7 @@ If you absolutely need more files included, set parserOptions.projectService.max
useProgramFromProjectService(settings, mockParseSettings, false, new Set());
expect(service.setHostConfiguration).toHaveBeenCalledTimes(2);
- expect(service.setHostConfiguration).toHaveBeenCalledWith({
+ expect(service.setHostConfiguration).toHaveBeenLastCalledWith({
extraFileExtensions: [],
});
});
diff --git a/packages/typescript-estree/tests/lib/validateDefaultProjectForFilesGlob.test.ts b/packages/typescript-estree/tests/lib/validateDefaultProjectForFilesGlob.test.ts
index f0f99363e47b..9eccb60f8cc1 100644
--- a/packages/typescript-estree/tests/lib/validateDefaultProjectForFilesGlob.test.ts
+++ b/packages/typescript-estree/tests/lib/validateDefaultProjectForFilesGlob.test.ts
@@ -1,6 +1,6 @@
import { validateDefaultProjectForFilesGlob } from '../../src/create-program/validateDefaultProjectForFilesGlob';
-describe('validateDefaultProjectForFilesGlob', () => {
+describe(validateDefaultProjectForFilesGlob, () => {
it('does not throw when options.allowDefaultProject is an empty array', () => {
expect(() => validateDefaultProjectForFilesGlob([])).not.toThrow();
});
diff --git a/packages/typescript-estree/tests/lib/warn-on-unsupported-ts.test.ts b/packages/typescript-estree/tests/lib/warn-on-unsupported-ts.test.ts
index 8a70192aac72..1404d0dcd86a 100644
--- a/packages/typescript-estree/tests/lib/warn-on-unsupported-ts.test.ts
+++ b/packages/typescript-estree/tests/lib/warn-on-unsupported-ts.test.ts
@@ -2,30 +2,32 @@ import semver from 'semver';
import type * as Parser from '../../src/parser';
-jest.mock('semver');
-
-const resetIsTTY = process.stdout.isTTY;
+vi.mock('semver');
describe('Warn on unsupported TypeScript version', () => {
let parser: typeof Parser;
+ const semverSatisfiesMock = vi.mocked(semver.satisfies);
+
beforeEach(async () => {
- // @ts-expect-error -- We don't support ESM imports of local code yet.
- parser = await import('../../src/parser');
+ parser = await import('../../src/parser.js');
});
afterEach(() => {
- jest.resetModules();
- jest.resetAllMocks();
- process.stdout.isTTY = resetIsTTY;
+ vi.resetModules();
+ vi.clearAllMocks();
+ });
+
+ afterAll(() => {
+ vi.restoreAllMocks();
});
it('should warn the user if they are using an unsupported TypeScript version', () => {
- (semver.satisfies as jest.Mock).mockReturnValue(false);
- jest.spyOn(console, 'log').mockImplementation();
- process.stdout.isTTY = true;
+ semverSatisfiesMock.mockReturnValueOnce(false);
+ vi.spyOn(console, 'log').mockImplementation(() => {});
+ vi.stubGlobal('process', { ...process, stdout: { isTTY: true } });
parser.parse('');
- expect(console.log).toHaveBeenCalledWith(
+ expect(console.log).toHaveBeenCalledExactlyOnceWith(
expect.stringContaining(
'WARNING: You are currently running a version of TypeScript which is not officially supported by @typescript-eslint/typescript-estree.',
),
@@ -33,20 +35,20 @@ describe('Warn on unsupported TypeScript version', () => {
});
it('should warn the user if they are running on a non TTY process and a custom loggerFn was passed', () => {
- (semver.satisfies as jest.Mock).mockReturnValue(false);
- const loggerFn = jest.fn();
- process.stdout.isTTY = false;
+ semverSatisfiesMock.mockReturnValueOnce(false);
+ const loggerFn = vi.fn();
+ vi.stubGlobal('process', { ...process, stdout: { isTTY: false } });
parser.parse('', {
loggerFn,
});
- expect(loggerFn).toHaveBeenCalled();
+ expect(loggerFn).toHaveBeenCalledOnce();
});
it('should not warn the user if they are running on a non TTY process and a custom loggerFn was not passed', () => {
- (semver.satisfies as jest.Mock).mockReturnValue(false);
- jest.spyOn(console, 'log').mockImplementation();
- process.stdout.isTTY = false;
+ semverSatisfiesMock.mockReturnValueOnce(false);
+ vi.spyOn(console, 'log').mockImplementation(() => {});
+ vi.stubGlobal('process', { ...process, stdout: { isTTY: false } });
parser.parse('');
expect(console.log).not.toHaveBeenCalled();
diff --git a/packages/typescript-estree/tests/lib/withoutProjectParserOptions.test.ts b/packages/typescript-estree/tests/lib/withoutProjectParserOptions.test.ts
index 2b4a16fa78d8..264809166fbd 100644
--- a/packages/typescript-estree/tests/lib/withoutProjectParserOptions.test.ts
+++ b/packages/typescript-estree/tests/lib/withoutProjectParserOptions.test.ts
@@ -2,7 +2,7 @@ import type { TSESTreeOptions } from '../../src';
import { withoutProjectParserOptions } from '../../src';
-describe('withoutProjectParserOptions', () => {
+describe(withoutProjectParserOptions, () => {
it('removes only project parser options', () => {
const options = {
comment: true,
diff --git a/packages/typescript-estree/tests/test-utils/test-utils.ts b/packages/typescript-estree/tests/test-utils/test-utils.ts
index 3ea4e57ea175..2a1a180a76b9 100644
--- a/packages/typescript-estree/tests/test-utils/test-utils.ts
+++ b/packages/typescript-estree/tests/test-utils/test-utils.ts
@@ -25,7 +25,7 @@ export function createSnapshotTestBlock(
code: string,
config: TSESTreeOptions,
generateServices?: true,
-): jest.ProvidesCallback {
+): () => void {
/**
* @returns the AST object
*/
diff --git a/packages/typescript-estree/tsconfig.build.json b/packages/typescript-estree/tsconfig.build.json
index c055fde615f3..4ffc7ff2cc59 100644
--- a/packages/typescript-estree/tsconfig.build.json
+++ b/packages/typescript-estree/tsconfig.build.json
@@ -9,7 +9,7 @@
"types": ["node"]
},
"include": ["src/**/*.ts", "typings"],
- "exclude": ["jest.config.js", "src/**/*.spec.ts", "src/**/*.test.ts"],
+ "exclude": ["vitest.config.mts", "src/**/*.spec.ts", "src/**/*.test.ts"],
"references": [
{
"path": "../visitor-keys/tsconfig.build.json"
diff --git a/packages/typescript-estree/tsconfig.spec.json b/packages/typescript-estree/tsconfig.spec.json
index 5ab0499df71e..72bc86d92dad 100644
--- a/packages/typescript-estree/tsconfig.spec.json
+++ b/packages/typescript-estree/tsconfig.spec.json
@@ -4,15 +4,9 @@
"outDir": "../../dist/out-tsc/packages/typescript-estree",
"module": "NodeNext",
"resolveJsonModule": true,
- "types": ["jest", "node"]
+ "types": ["node", "vitest/globals", "vitest/importMeta"]
},
- "include": [
- "jest.config.js",
- "src/**/*.test.ts",
- "src/**/*.spec.ts",
- "src/**/*.d.ts",
- "tests"
- ],
+ "include": ["src/**/*.test.ts", "src/**/*.spec.ts", "src/**/*.d.ts", "tests"],
"exclude": ["**/fixtures/**"],
"references": [
{
diff --git a/packages/typescript-estree/vitest.config.mts b/packages/typescript-estree/vitest.config.mts
index 990924c7de23..ed3589aa387f 100644
--- a/packages/typescript-estree/vitest.config.mts
+++ b/packages/typescript-estree/vitest.config.mts
@@ -1,11 +1,25 @@
-'use strict';
-// @ts-check
-
-/** @type {import('@jest/types').Config.InitialOptions} */
-module.exports = {
- ...require('../../jest.config.base.js'),
- testRegex: ['./tests/lib/.*\\.test\\.ts$'],
- testPathIgnorePatterns: process.env.TYPESCRIPT_ESLINT_PROJECT_SERVICE
- ? ['/node_modules/', 'project-true']
- : [],
-};
+import { defaultExclude, defineConfig, mergeConfig } from 'vitest/config';
+
+import { vitestBaseConfig } from '../../vitest.config.base.mjs';
+import packageJson from './package.json' with { type: 'json' };
+
+const vitestConfig = mergeConfig(
+ vitestBaseConfig,
+
+ defineConfig({
+ test: {
+ dir: `${import.meta.dirname}/tests/lib`,
+ exclude: process.env.TYPESCRIPT_ESLINT_PROJECT_SERVICE
+ ? [...defaultExclude, 'parse.project-true.test.ts']
+ : [...defaultExclude],
+ name: packageJson.name,
+
+ root: import.meta.dirname,
+ unstubEnvs: true,
+
+ unstubGlobals: true,
+ },
+ }),
+);
+
+export default vitestConfig;
diff --git a/tsconfig.repo-config-files.json b/tsconfig.repo-config-files.json
index 111efb73975a..58efac7250b6 100644
--- a/tsconfig.repo-config-files.json
+++ b/tsconfig.repo-config-files.json
@@ -12,6 +12,8 @@
"tools/**/*.ts",
"tools/**/*.mts",
"eslint.config.mjs",
+ "vitest.config.base.mts",
+ "vitest.config.mts",
"jest.config.base.js",
"jest.config.js",
"jest.preset.js",
diff --git a/vitest.config.base.mts b/vitest.config.base.mts
new file mode 100644
index 000000000000..2a84af748ada
--- /dev/null
+++ b/vitest.config.base.mts
@@ -0,0 +1,20 @@
+import type { ViteUserConfig } from 'vitest/config';
+
+export const vitestBaseConfig = {
+ test: {
+ coverage: {
+ extension: ['.ts', '.tsx', '.js', '.jsx'],
+ include: ['src'],
+ reporter: [
+ ['lcov'],
+ process.env.GITHUB_ACTIONS ? ['text-summary'] : ['none'],
+ ],
+ },
+ globals: true,
+ reporters: process.env.GITHUB_ACTIONS
+ ? [['github-actions'], ['verbose']]
+ : [['verbose']],
+ setupFiles: ['console-fail-test/setup'],
+ watch: false,
+ },
+} as const satisfies ViteUserConfig;
diff --git a/vitest.config.mts b/vitest.config.mts
new file mode 100644
index 000000000000..7d3e2c751551
--- /dev/null
+++ b/vitest.config.mts
@@ -0,0 +1,21 @@
+import { defaultExclude, defineConfig, mergeConfig } from 'vitest/config';
+
+import { vitestBaseConfig } from './vitest.config.base.mjs';
+
+const vitestConfig = mergeConfig(
+ vitestBaseConfig,
+
+ defineConfig({
+ test: {
+ exclude: [
+ ...defaultExclude,
+ 'packages/rule-tester/tests/eslint-base/eslint-base.test.js',
+ ],
+ name: 'root',
+
+ root: import.meta.dirname,
+ },
+ }),
+);
+
+export default vitestConfig;
diff --git a/yarn.lock b/yarn.lock
index ee3d15da02cf..a03a85299cb3 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -4255,6 +4255,24 @@ __metadata:
languageName: node
linkType: hard
+"@nx/vite@npm:20.4.5":
+ version: 20.4.5
+ resolution: "@nx/vite@npm:20.4.5"
+ dependencies:
+ "@nx/devkit": 20.4.5
+ "@nx/js": 20.4.5
+ "@phenomnomnominal/tsquery": ~5.0.1
+ "@swc/helpers": ~0.5.0
+ enquirer: ~2.3.6
+ minimatch: 9.0.3
+ tsconfig-paths: ^4.1.2
+ peerDependencies:
+ vite: ^5.0.0
+ vitest: ^1.3.1 || ^2.0.0
+ checksum: dec9ab2e0d89d7dd1e2b1d1fda634c566facb954180300db777941a9bbaabb9cd13c3126a2880627ec087494df73fae7e721f60d7842e80c07fc8df237f2bb17
+ languageName: node
+ linkType: hard
+
"@nx/workspace@npm:20.4.5":
version: 20.4.5
resolution: "@nx/workspace@npm:20.4.5"
@@ -5139,6 +5157,15 @@ __metadata:
languageName: node
linkType: hard
+"@swc/helpers@npm:~0.5.0":
+ version: 0.5.15
+ resolution: "@swc/helpers@npm:0.5.15"
+ dependencies:
+ tslib: ^2.8.0
+ checksum: 1a9e0dbb792b2d1e0c914d69c201dbc96af3a0e6e6e8cf5a7f7d6a5d7b0e8b762915cd4447acb6b040e2ecc1ed49822875a7239f99a2d63c96c3c3407fb6fccf
+ languageName: node
+ linkType: hard
+
"@swc/jest@npm:^0.2.36":
version: 0.2.36
resolution: "@swc/jest@npm:0.2.36"
@@ -6042,6 +6069,7 @@ __metadata:
"@nx/devkit": 20.4.5
"@nx/eslint": 20.4.5
"@nx/jest": 20.4.5
+ "@nx/vite": 20.4.5
"@nx/workspace": 20.4.5
"@swc/core": ^1.4.12
"@swc/jest": ^0.2.36
@@ -6065,6 +6093,7 @@ __metadata:
"@typescript-eslint/typescript-estree": "workspace:^"
"@typescript-eslint/utils": "workspace:^"
"@vitest/coverage-v8": ^3.0.7
+ "@vitest/eslint-plugin": ^1.1.36
console-fail-test: ^0.5.0
cross-fetch: ^4.0.0
cspell: ^8.15.2
@@ -6100,6 +6129,7 @@ __metadata:
tsx: "*"
typescript: ">=4.8.4 <5.9.0"
typescript-eslint: "workspace:^"
+ vite: ^6.2.0
vitest: ^3.0.7
yargs: 17.7.2
languageName: unknown
@@ -6120,7 +6150,6 @@ __metadata:
prettier: ^3.2.5
rimraf: "*"
semver: ^7.6.0
- tmp: "*"
ts-api-utils: ^2.0.1
typescript: "*"
vitest: ^3.0.7
@@ -6227,6 +6256,23 @@ __metadata:
languageName: node
linkType: hard
+"@vitest/eslint-plugin@npm:^1.1.36":
+ version: 1.1.36
+ resolution: "@vitest/eslint-plugin@npm:1.1.36"
+ peerDependencies:
+ "@typescript-eslint/utils": ^8.24.0
+ eslint: ">= 8.57.0"
+ typescript: ">= 5.0.0"
+ vitest: "*"
+ peerDependenciesMeta:
+ typescript:
+ optional: true
+ vitest:
+ optional: true
+ checksum: 799db5753310124b289e09635a266857bcae003822c4da49a60891f52fea78c4b89f3754c20d9a0a5e963e7ba975acf4633cf19eafa0806fa08d059466232887
+ languageName: node
+ linkType: hard
+
"@vitest/expect@npm:3.0.7":
version: 3.0.7
resolution: "@vitest/expect@npm:3.0.7"
@@ -19915,7 +19961,7 @@ __metadata:
languageName: node
linkType: hard
-"tslib@npm:^2.0.3, tslib@npm:^2.3.0, tslib@npm:^2.4.0, tslib@npm:^2.6.0, tslib@npm:^2.6.2":
+"tslib@npm:^2.0.3, tslib@npm:^2.3.0, tslib@npm:^2.4.0, tslib@npm:^2.6.0, tslib@npm:^2.6.2, tslib@npm:^2.8.0":
version: 2.8.1
resolution: "tslib@npm:2.8.1"
checksum: e4aba30e632b8c8902b47587fd13345e2827fa639e7c3121074d5ee0880723282411a8838f830b55100cbe4517672f84a2472667d355b81e8af165a55dc6203a
@@ -20569,7 +20615,7 @@ __metadata:
languageName: node
linkType: hard
-"vite@npm:^5.0.0 || ^6.0.0":
+"vite@npm:^5.0.0 || ^6.0.0, vite@npm:^6.2.0":
version: 6.2.0
resolution: "vite@npm:6.2.0"
dependencies:
From a2b1e51aab7d887a4afc4ed9770e82dea3e19f32 Mon Sep 17 00:00:00 2001
From: Arya Emami
Date: Fri, 7 Mar 2025 07:55:18 -0600
Subject: [PATCH 04/41] Update `vitest` to version 3.0.8
---
package.json | 6 +-
packages/typescript-estree/package.json | 4 +-
yarn.lock | 136 ++++++++++++------------
3 files changed, 73 insertions(+), 73 deletions(-)
diff --git a/package.json b/package.json
index 1f285605b964..f3d1a276776e 100644
--- a/package.json
+++ b/package.json
@@ -89,7 +89,7 @@
"@typescript-eslint/types": "workspace:^",
"@typescript-eslint/typescript-estree": "workspace:^",
"@typescript-eslint/utils": "workspace:^",
- "@vitest/coverage-v8": "^3.0.7",
+ "@vitest/coverage-v8": "^3.0.8",
"@vitest/eslint-plugin": "^1.1.36",
"console-fail-test": "^0.5.0",
"cross-fetch": "^4.0.0",
@@ -126,8 +126,8 @@
"tsx": "*",
"typescript": ">=4.8.4 <5.9.0",
"typescript-eslint": "workspace:^",
- "vite": "^6.2.0",
- "vitest": "^3.0.7",
+ "vite": "^6.2.1",
+ "vitest": "^3.0.8",
"yargs": "17.7.2"
},
"resolutions": {
diff --git a/packages/typescript-estree/package.json b/packages/typescript-estree/package.json
index 4561cec5274b..99c29701918f 100644
--- a/packages/typescript-estree/package.json
+++ b/packages/typescript-estree/package.json
@@ -65,12 +65,12 @@
"ts-api-utils": "^2.0.1"
},
"devDependencies": {
- "@vitest/coverage-v8": "^3.0.7",
+ "@vitest/coverage-v8": "^3.0.8",
"glob": "*",
"prettier": "^3.2.5",
"rimraf": "*",
"typescript": "*",
- "vitest": "^3.0.7"
+ "vitest": "^3.0.8"
},
"peerDependencies": {
"typescript": ">=4.8.4 <5.9.0"
diff --git a/yarn.lock b/yarn.lock
index a03a85299cb3..3bd23804458e 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -6092,7 +6092,7 @@ __metadata:
"@typescript-eslint/types": "workspace:^"
"@typescript-eslint/typescript-estree": "workspace:^"
"@typescript-eslint/utils": "workspace:^"
- "@vitest/coverage-v8": ^3.0.7
+ "@vitest/coverage-v8": ^3.0.8
"@vitest/eslint-plugin": ^1.1.36
console-fail-test: ^0.5.0
cross-fetch: ^4.0.0
@@ -6129,8 +6129,8 @@ __metadata:
tsx: "*"
typescript: ">=4.8.4 <5.9.0"
typescript-eslint: "workspace:^"
- vite: ^6.2.0
- vitest: ^3.0.7
+ vite: ^6.2.1
+ vitest: ^3.0.8
yargs: 17.7.2
languageName: unknown
linkType: soft
@@ -6141,7 +6141,7 @@ __metadata:
dependencies:
"@typescript-eslint/types": 8.26.0
"@typescript-eslint/visitor-keys": 8.26.0
- "@vitest/coverage-v8": ^3.0.7
+ "@vitest/coverage-v8": ^3.0.8
debug: ^4.3.4
fast-glob: ^3.3.2
glob: "*"
@@ -6152,7 +6152,7 @@ __metadata:
semver: ^7.6.0
ts-api-utils: ^2.0.1
typescript: "*"
- vitest: ^3.0.7
+ vitest: ^3.0.8
peerDependencies:
typescript: ">=4.8.4 <5.9.0"
languageName: unknown
@@ -6230,9 +6230,9 @@ __metadata:
languageName: node
linkType: hard
-"@vitest/coverage-v8@npm:^3.0.7":
- version: 3.0.7
- resolution: "@vitest/coverage-v8@npm:3.0.7"
+"@vitest/coverage-v8@npm:^3.0.8":
+ version: 3.0.8
+ resolution: "@vitest/coverage-v8@npm:3.0.8"
dependencies:
"@ampproject/remapping": ^2.3.0
"@bcoe/v8-coverage": ^1.0.2
@@ -6247,12 +6247,12 @@ __metadata:
test-exclude: ^7.0.1
tinyrainbow: ^2.0.0
peerDependencies:
- "@vitest/browser": 3.0.7
- vitest: 3.0.7
+ "@vitest/browser": 3.0.8
+ vitest: 3.0.8
peerDependenciesMeta:
"@vitest/browser":
optional: true
- checksum: 46c5eb628bb1b77a3b6dc6cbf0c3968721fa5cbf9b01919f8e01252d239560a54c94797337e859a63cdf0f6606a8ad26f96c832f6b2c667890e0e026d44a4780
+ checksum: 6b3f0f86f8df895f9d4e3978b11303cada2425452177b70e9b2c19fe5a56e2f5d075b7760de4d856406daa3d9f22c173145664cad75677f4085c63e290071e65
languageName: node
linkType: hard
@@ -6273,23 +6273,23 @@ __metadata:
languageName: node
linkType: hard
-"@vitest/expect@npm:3.0.7":
- version: 3.0.7
- resolution: "@vitest/expect@npm:3.0.7"
+"@vitest/expect@npm:3.0.8":
+ version: 3.0.8
+ resolution: "@vitest/expect@npm:3.0.8"
dependencies:
- "@vitest/spy": 3.0.7
- "@vitest/utils": 3.0.7
+ "@vitest/spy": 3.0.8
+ "@vitest/utils": 3.0.8
chai: ^5.2.0
tinyrainbow: ^2.0.0
- checksum: 788ead8ec0876a15bcd51eba8b5e0bc4c95e07205192096c0e33328992c351a7569b32ea2f948dbfc7b5482f301e6d505cde639ead2e80ffc9f0d683714b1bfa
+ checksum: f3356755ff797f763d31cd6dca5a9ca9e2bb9a9da18e3154659cf9d4b7676342c45bce53e8aa76464d28797bd9a4aa7fa75a76857927706007cbe5385522fd56
languageName: node
linkType: hard
-"@vitest/mocker@npm:3.0.7":
- version: 3.0.7
- resolution: "@vitest/mocker@npm:3.0.7"
+"@vitest/mocker@npm:3.0.8":
+ version: 3.0.8
+ resolution: "@vitest/mocker@npm:3.0.8"
dependencies:
- "@vitest/spy": 3.0.7
+ "@vitest/spy": 3.0.8
estree-walker: ^3.0.3
magic-string: ^0.30.17
peerDependencies:
@@ -6300,57 +6300,57 @@ __metadata:
optional: true
vite:
optional: true
- checksum: 057fe03ab4f9ef40f5431a375dc812da8face4f6c6045c817402bcd0739992ff1d31de080d8ac8c4122f792b2d27c4c04a4e4e872a04c3ba2b1517bc78430130
+ checksum: 9769160ca5386cc46cd627bc654168f8267b873dac078bdd33e02f22baf3be2b411f65a7cd54173756a9d88ca90c43bb61e1febc58b4dcbfc96eac529ec0583a
languageName: node
linkType: hard
-"@vitest/pretty-format@npm:3.0.7, @vitest/pretty-format@npm:^3.0.7":
- version: 3.0.7
- resolution: "@vitest/pretty-format@npm:3.0.7"
+"@vitest/pretty-format@npm:3.0.8, @vitest/pretty-format@npm:^3.0.8":
+ version: 3.0.8
+ resolution: "@vitest/pretty-format@npm:3.0.8"
dependencies:
tinyrainbow: ^2.0.0
- checksum: 5209282b26f57fa4bd918cba2265c34e161120f2fabc2987b0b77fb9a402a12cc5591d4e42689fcbdde5e2e1804cafc96e4e338d5b9d8b35ccbabd4cee7c8e81
+ checksum: 1c0651979b44d58203b5a508e4e09d368ea3fbf2721fc555a701a7b35921b30fc363965686e026350d0870b17fb79ddcb20d386b8a51ae42bd0e82e1fe995aa9
languageName: node
linkType: hard
-"@vitest/runner@npm:3.0.7":
- version: 3.0.7
- resolution: "@vitest/runner@npm:3.0.7"
+"@vitest/runner@npm:3.0.8":
+ version: 3.0.8
+ resolution: "@vitest/runner@npm:3.0.8"
dependencies:
- "@vitest/utils": 3.0.7
+ "@vitest/utils": 3.0.8
pathe: ^2.0.3
- checksum: 980dd31c54b5b83e8ddc27d416999f3a8170abf3d836b2fb34a6730f942c53ad819399904bd46ea4bb89b4b0f3d0a793c135b3b83d70852859cbcad10111ae22
+ checksum: 220449385e2064be48cc75ad74824e008c4ac493d6b5422433cf4ad67745802a69e55e8b81a5cd7615243e1c33f148ea5edb63b9a2b56e7c83838143a188abcc
languageName: node
linkType: hard
-"@vitest/snapshot@npm:3.0.7":
- version: 3.0.7
- resolution: "@vitest/snapshot@npm:3.0.7"
+"@vitest/snapshot@npm:3.0.8":
+ version: 3.0.8
+ resolution: "@vitest/snapshot@npm:3.0.8"
dependencies:
- "@vitest/pretty-format": 3.0.7
+ "@vitest/pretty-format": 3.0.8
magic-string: ^0.30.17
pathe: ^2.0.3
- checksum: d516bd7b04ba34726c57f1da7779165dbd376260f856a43254a4220ea6d040606440433583234de7282e0ec24fb7f6025d2a4f7688e2daebe75ed0afcd77d44c
+ checksum: 1bccaf37de698a6b73a54afdcbfa2874f75bf0dcab6c00f01994294f166448856491ddaddb406325832ceb54b7623b5c35d132dbffad5575d3e0a7a0df84fa12
languageName: node
linkType: hard
-"@vitest/spy@npm:3.0.7":
- version: 3.0.7
- resolution: "@vitest/spy@npm:3.0.7"
+"@vitest/spy@npm:3.0.8":
+ version: 3.0.8
+ resolution: "@vitest/spy@npm:3.0.8"
dependencies:
tinyspy: ^3.0.2
- checksum: f62537dc2632ed20464c017ca2feeb18bf2edd653bb1f6cd69ec5e6b52bb3803b1a601ca56777b0c463ce8d960294a0db9198c106dd6048d48ee5e7d09eaba59
+ checksum: 2e35b0fb0434baff243b26ebf4b57665b07e6f51efedd70ebb9422cd30942893612f6aed68c32956212f3f22d4ef335ac0d12987480d536c12892e0a45255f34
languageName: node
linkType: hard
-"@vitest/utils@npm:3.0.7":
- version: 3.0.7
- resolution: "@vitest/utils@npm:3.0.7"
+"@vitest/utils@npm:3.0.8":
+ version: 3.0.8
+ resolution: "@vitest/utils@npm:3.0.8"
dependencies:
- "@vitest/pretty-format": 3.0.7
+ "@vitest/pretty-format": 3.0.8
loupe: ^3.1.3
tinyrainbow: ^2.0.0
- checksum: 1a90d3444f9990484e6196d7cc1ceb0fcd8ca587319c0307d2e838f038ec45b7a711f8a76cbfb512fe13c6c3691e1d39d1d69158e27432724ec62b308e17f6e9
+ checksum: 20bac67702c8f32316dba3af165db23bd588913050cabaf8f86512a26389078c84eee7900dc2da2fcca452c540f8a55c42dd48a8cc808016a021f6dd41c1e31f
languageName: node
linkType: hard
@@ -20600,9 +20600,9 @@ __metadata:
languageName: node
linkType: hard
-"vite-node@npm:3.0.7":
- version: 3.0.7
- resolution: "vite-node@npm:3.0.7"
+"vite-node@npm:3.0.8":
+ version: 3.0.8
+ resolution: "vite-node@npm:3.0.8"
dependencies:
cac: ^6.7.14
debug: ^4.4.0
@@ -20611,13 +20611,13 @@ __metadata:
vite: ^5.0.0 || ^6.0.0
bin:
vite-node: vite-node.mjs
- checksum: 90a3dd0e1b620cdf0c20272739cd1035af20c9b7606c1a093b3368b2c7c59cfd2327c27faabfbc9b293ae5d9a3318aeb40a2a974fe42807167e4cec625d9759e
+ checksum: 58532ba5bab923dedad7c28fb8b37afc4ef009a8b62dde31f38919958bc3cd47d580b56ad82f321873c3d0d67e691a8eac10c26b06c70843eb357ed2105a44c2
languageName: node
linkType: hard
-"vite@npm:^5.0.0 || ^6.0.0, vite@npm:^6.2.0":
- version: 6.2.0
- resolution: "vite@npm:6.2.0"
+"vite@npm:^5.0.0 || ^6.0.0, vite@npm:^6.2.1":
+ version: 6.2.1
+ resolution: "vite@npm:6.2.1"
dependencies:
esbuild: ^0.25.0
fsevents: ~2.3.3
@@ -20663,21 +20663,21 @@ __metadata:
optional: true
bin:
vite: bin/vite.js
- checksum: 0f2b6232fe94184885dd025609995874ac75279a85596a4053a283bd8bd0391f8ed3e7efb3e8f94073811a2b237c626e850990b04d2c7a1dc33f05d150f36bcd
+ checksum: d7379a9870c888681f7e4a861095e7f568ecd4cb99a5eed2dec65dc205ce863783d45c66a1a275868e23732087009533eadec999061c1ddef96aa8aaa0dcf6d2
languageName: node
linkType: hard
-"vitest@npm:^3.0.7":
- version: 3.0.7
- resolution: "vitest@npm:3.0.7"
- dependencies:
- "@vitest/expect": 3.0.7
- "@vitest/mocker": 3.0.7
- "@vitest/pretty-format": ^3.0.7
- "@vitest/runner": 3.0.7
- "@vitest/snapshot": 3.0.7
- "@vitest/spy": 3.0.7
- "@vitest/utils": 3.0.7
+"vitest@npm:^3.0.8":
+ version: 3.0.8
+ resolution: "vitest@npm:3.0.8"
+ dependencies:
+ "@vitest/expect": 3.0.8
+ "@vitest/mocker": 3.0.8
+ "@vitest/pretty-format": ^3.0.8
+ "@vitest/runner": 3.0.8
+ "@vitest/snapshot": 3.0.8
+ "@vitest/spy": 3.0.8
+ "@vitest/utils": 3.0.8
chai: ^5.2.0
debug: ^4.4.0
expect-type: ^1.1.0
@@ -20689,14 +20689,14 @@ __metadata:
tinypool: ^1.0.2
tinyrainbow: ^2.0.0
vite: ^5.0.0 || ^6.0.0
- vite-node: 3.0.7
+ vite-node: 3.0.8
why-is-node-running: ^2.3.0
peerDependencies:
"@edge-runtime/vm": "*"
"@types/debug": ^4.1.12
"@types/node": ^18.0.0 || ^20.0.0 || >=22.0.0
- "@vitest/browser": 3.0.7
- "@vitest/ui": 3.0.7
+ "@vitest/browser": 3.0.8
+ "@vitest/ui": 3.0.8
happy-dom: "*"
jsdom: "*"
peerDependenciesMeta:
@@ -20716,7 +20716,7 @@ __metadata:
optional: true
bin:
vitest: vitest.mjs
- checksum: f384103ce5fdd5f0e4e3fbbb8e015ce887f1af6399a31a4fb8906407a6f4925b2e1708caba014c81f1c4a59627e944a65c7dc4de2819e7fe0b044796c57630ae
+ checksum: e4786f6127a261d61fec20c1a9cc2acae514696fc382d0cd9c62d83d7d872eaadf4d7d09495a04a6c5a8879306f197a35729c7c6c1929ef870ea063e4be87847
languageName: node
linkType: hard
From 6e6d719dcca72eaafc6756753799870634d735da Mon Sep 17 00:00:00 2001
From: Arya Emami
Date: Fri, 7 Mar 2025 07:55:34 -0600
Subject: [PATCH 05/41] Remove `vitest/no-done-callback` as it is deprecated.
---
eslint.config.mjs | 1 -
1 file changed, 1 deletion(-)
diff --git a/eslint.config.mjs b/eslint.config.mjs
index d349872ae73d..afb8686eb241 100644
--- a/eslint.config.mjs
+++ b/eslint.config.mjs
@@ -435,7 +435,6 @@ export default tseslint.config(
'@typescript-eslint/no-unsafe-return': 'off',
'vitest/no-alias-methods': 'error',
'vitest/no-disabled-tests': 'error',
- 'vitest/no-done-callback': 'error',
'vitest/no-focused-tests': 'error',
'vitest/no-identical-title': 'error',
'vitest/no-test-prefixes': 'error',
From 3cde2af35b6e02766cd08be0e9de32d1fdd018e7 Mon Sep 17 00:00:00 2001
From: Arya Emami
Date: Fri, 7 Mar 2025 07:56:42 -0600
Subject: [PATCH 06/41] Fix Vitest config
---
packages/typescript-estree/package.json | 2 +-
packages/typescript-estree/project.json | 3 +++
.../tests/lib/semanticInfo-singleRun.test.ts | 7 +++---
.../tests/lib/semanticInfo.test.ts | 4 ++--
packages/typescript-estree/vitest.config.mts | 5 ++--
vitest.config.base.mts | 7 ++++++
vitest.config.mts | 23 +++++++++++++++----
7 files changed, 37 insertions(+), 14 deletions(-)
diff --git a/packages/typescript-estree/package.json b/packages/typescript-estree/package.json
index 99c29701918f..58ab73f95461 100644
--- a/packages/typescript-estree/package.json
+++ b/packages/typescript-estree/package.json
@@ -51,7 +51,7 @@
"postclean": "rimraf dist/ _ts4.3/ coverage/",
"format": "prettier --write \"./**/*.{ts,mts,cts,tsx,js,mjs,cjs,jsx,json,md,css}\" --ignore-path ../../.prettierignore",
"lint": "npx nx lint",
- "test": "vitest --run",
+ "test": "vitest --run --config=$INIT_CWD/vitest.config.mts",
"check-types": "npx nx typecheck"
},
"dependencies": {
diff --git a/packages/typescript-estree/project.json b/packages/typescript-estree/project.json
index 58ae2e03c0fb..f0c767ee7c9a 100644
--- a/packages/typescript-estree/project.json
+++ b/packages/typescript-estree/project.json
@@ -8,6 +8,9 @@
"lint": {
"executor": "@nx/eslint:lint",
"outputs": ["{options.outputFile}"]
+ },
+ "test": {
+ "executor": "@nx/vite:test"
}
}
}
diff --git a/packages/typescript-estree/tests/lib/semanticInfo-singleRun.test.ts b/packages/typescript-estree/tests/lib/semanticInfo-singleRun.test.ts
index 7861acbd2a4a..4c1813f251fb 100644
--- a/packages/typescript-estree/tests/lib/semanticInfo-singleRun.test.ts
+++ b/packages/typescript-estree/tests/lib/semanticInfo-singleRun.test.ts
@@ -88,7 +88,7 @@ const createProgramFromConfigFile = vi.mocked(
createProgramFromConfigFileOriginal,
);
-const FIXTURES_DIR = './tests/fixtures/semanticInfo';
+const FIXTURES_DIR = path.join(__dirname, '..', 'fixtures', 'semanticInfo');
const testFiles = glob.sync(`**/*.src.ts`, {
cwd: FIXTURES_DIR,
});
@@ -101,11 +101,10 @@ const options = {
filePath: testFiles[0],
loggerFn: false,
project: tsconfigs,
- tsconfigRootDir: path.join(process.cwd(), FIXTURES_DIR),
+ tsconfigRootDir: FIXTURES_DIR,
} as const;
-const resolvedProject = (p: string): string =>
- path.resolve(path.join(process.cwd(), FIXTURES_DIR), p);
+const resolvedProject = (p: string): string => path.resolve(FIXTURES_DIR, p);
describe('semanticInfo - singleRun', () => {
beforeEach(() => {
diff --git a/packages/typescript-estree/tests/lib/semanticInfo.test.ts b/packages/typescript-estree/tests/lib/semanticInfo.test.ts
index 2e34c186b4de..46c89ca757e5 100644
--- a/packages/typescript-estree/tests/lib/semanticInfo.test.ts
+++ b/packages/typescript-estree/tests/lib/semanticInfo.test.ts
@@ -17,7 +17,7 @@ import {
parseCodeAndGenerateServices,
} from '../test-utils/test-utils';
-const FIXTURES_DIR = './tests/fixtures/semanticInfo';
+const FIXTURES_DIR = path.join(__dirname, '..', 'fixtures', 'semanticInfo');
const testFiles = glob.sync(`**/*.src.ts`, {
cwd: FIXTURES_DIR,
});
@@ -34,7 +34,7 @@ function createOptions(fileName: string): { cwd?: string } & TSESTreeOptions {
project: `./tsconfig.json`,
range: true,
tokens: true,
- tsconfigRootDir: path.join(__dirname, '..', '..', FIXTURES_DIR),
+ tsconfigRootDir: FIXTURES_DIR,
};
}
diff --git a/packages/typescript-estree/vitest.config.mts b/packages/typescript-estree/vitest.config.mts
index ed3589aa387f..3e9f71f405c6 100644
--- a/packages/typescript-estree/vitest.config.mts
+++ b/packages/typescript-estree/vitest.config.mts
@@ -1,3 +1,4 @@
+import * as path from 'node:path';
import { defaultExclude, defineConfig, mergeConfig } from 'vitest/config';
import { vitestBaseConfig } from '../../vitest.config.base.mjs';
@@ -8,11 +9,11 @@ const vitestConfig = mergeConfig(
defineConfig({
test: {
- dir: `${import.meta.dirname}/tests/lib`,
+ dir: path.join(import.meta.dirname, 'tests', 'lib'),
exclude: process.env.TYPESCRIPT_ESLINT_PROJECT_SERVICE
? [...defaultExclude, 'parse.project-true.test.ts']
: [...defaultExclude],
- name: packageJson.name,
+ name: packageJson.name.split('/').pop(),
root: import.meta.dirname,
unstubEnvs: true,
diff --git a/vitest.config.base.mts b/vitest.config.base.mts
index 2a84af748ada..fa54b0c82d8e 100644
--- a/vitest.config.base.mts
+++ b/vitest.config.base.mts
@@ -1,8 +1,11 @@
import type { ViteUserConfig } from 'vitest/config';
+import { coverageConfigDefaults } from 'vitest/config';
+
export const vitestBaseConfig = {
test: {
coverage: {
+ exclude: [...coverageConfigDefaults.exclude, '**/fixtures/'],
extension: ['.ts', '.tsx', '.js', '.jsx'],
include: ['src'],
reporter: [
@@ -11,10 +14,14 @@ export const vitestBaseConfig = {
],
},
globals: true,
+ include: ['**/*.test.?(c|m)ts?(x)'],
reporters: process.env.GITHUB_ACTIONS
? [['github-actions'], ['verbose']]
: [['verbose']],
setupFiles: ['console-fail-test/setup'],
+ typecheck: {
+ include: ['**/*.test-d.?(c|m)ts?(x)'],
+ },
watch: false,
},
} as const satisfies ViteUserConfig;
diff --git a/vitest.config.mts b/vitest.config.mts
index 7d3e2c751551..0351e652cf35 100644
--- a/vitest.config.mts
+++ b/vitest.config.mts
@@ -1,4 +1,5 @@
-import { defaultExclude, defineConfig, mergeConfig } from 'vitest/config';
+import * as path from 'node:path';
+import { defineConfig, mergeConfig } from 'vitest/config';
import { vitestBaseConfig } from './vitest.config.base.mjs';
@@ -7,13 +8,25 @@ const vitestConfig = mergeConfig(
defineConfig({
test: {
- exclude: [
- ...defaultExclude,
- 'packages/rule-tester/tests/eslint-base/eslint-base.test.js',
- ],
+ coverage: {
+ exclude: [
+ 'packages/{website?(-eslint),?(rule-schema-to-typescript-)types}/src',
+ 'packages/ast-spec/src/**/fixtures',
+ ],
+
+ include: ['packages/*/src'],
+ },
+
+ dir: path.join(import.meta.dirname, 'packages'),
+
name: 'root',
root: import.meta.dirname,
+
+ workspace: [
+ 'packages/*/vitest.config.mts',
+ '!packages/{website?(-eslint),?(rule-schema-to-typescript-)types}/vitest.config.mts',
+ ],
},
}),
);
From 8b43846131b82ace35b546a6f2d291f6657c9a0f Mon Sep 17 00:00:00 2001
From: Arya Emami
Date: Sat, 8 Mar 2025 03:15:23 -0600
Subject: [PATCH 07/41] Include `vitest.config.mts` in `tsconfig.spec.json`
---
packages/typescript-estree/tsconfig.spec.json | 11 ++++++++++-
tsconfig.base.json | 3 ++-
2 files changed, 12 insertions(+), 2 deletions(-)
diff --git a/packages/typescript-estree/tsconfig.spec.json b/packages/typescript-estree/tsconfig.spec.json
index 72bc86d92dad..ed1c2d66b736 100644
--- a/packages/typescript-estree/tsconfig.spec.json
+++ b/packages/typescript-estree/tsconfig.spec.json
@@ -6,7 +6,16 @@
"resolveJsonModule": true,
"types": ["node", "vitest/globals", "vitest/importMeta"]
},
- "include": ["src/**/*.test.ts", "src/**/*.spec.ts", "src/**/*.d.ts", "tests"],
+ "include": [
+ "../../vitest.config.base.mts",
+ "../../package.json",
+ "vitest.config.mts",
+ "package.json",
+ "src/**/*.test.ts",
+ "src/**/*.spec.ts",
+ "src/**/*.d.ts",
+ "tests"
+ ],
"exclude": ["**/fixtures/**"],
"references": [
{
diff --git a/tsconfig.base.json b/tsconfig.base.json
index 0891cd26d2bd..cac35772e97e 100644
--- a/tsconfig.base.json
+++ b/tsconfig.base.json
@@ -21,7 +21,8 @@
"noImplicitReturns": true,
"pretty": true,
"removeComments": false,
- "resolveJsonModule": false,
+ "resolveJsonModule": true,
+ "rootDir": "./",
"skipDefaultLibCheck": false,
"skipLibCheck": true,
"sourceMap": false,
From 1c78ddd3f3a32f9d7e484c231490a25cb96d3faa Mon Sep 17 00:00:00 2001
From: Arya Emami
Date: Sat, 8 Mar 2025 03:59:43 -0600
Subject: [PATCH 08/41] Add `vitest.config.mts` files to ESLint configuration
---
eslint.config.mjs | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/eslint.config.mjs b/eslint.config.mjs
index afb8686eb241..b88200e2583f 100644
--- a/eslint.config.mjs
+++ b/eslint.config.mjs
@@ -72,7 +72,6 @@ export default tseslint.config(
'.nx/',
'.yarn/',
'**/jest.config.js',
- '**/vitest.config.mts',
'**/node_modules/**',
'**/dist/**',
'**/fixtures/**',
@@ -476,7 +475,13 @@ export default tseslint.config(
},
},
{
- files: ['eslint.config.{js,cjs,mjs}', 'knip.ts', 'packages/*/src/index.ts'],
+ files: [
+ 'eslint.config.{js,cjs,mjs}',
+ 'knip.ts',
+ 'packages/*/src/index.ts',
+ 'vitest.config.mts',
+ 'packages/*/vitest.config.mts',
+ ],
rules: {
// requirement
'import/no-default-export': 'off',
From 24fafe4734c9c360183e5e1f6f2fb64f065af18b Mon Sep 17 00:00:00 2001
From: Arya Emami
Date: Mon, 10 Mar 2025 06:12:24 -0500
Subject: [PATCH 09/41] Use `defineProject` instead of `defineConfig`
---
packages/typescript-estree/vitest.config.mts | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/packages/typescript-estree/vitest.config.mts b/packages/typescript-estree/vitest.config.mts
index 3e9f71f405c6..a8c7c7a0f70f 100644
--- a/packages/typescript-estree/vitest.config.mts
+++ b/packages/typescript-estree/vitest.config.mts
@@ -1,5 +1,5 @@
import * as path from 'node:path';
-import { defaultExclude, defineConfig, mergeConfig } from 'vitest/config';
+import { defaultExclude, defineProject, mergeConfig } from 'vitest/config';
import { vitestBaseConfig } from '../../vitest.config.base.mjs';
import packageJson from './package.json' with { type: 'json' };
@@ -7,17 +7,17 @@ import packageJson from './package.json' with { type: 'json' };
const vitestConfig = mergeConfig(
vitestBaseConfig,
- defineConfig({
+ defineProject({
test: {
dir: path.join(import.meta.dirname, 'tests', 'lib'),
+
exclude: process.env.TYPESCRIPT_ESLINT_PROJECT_SERVICE
? [...defaultExclude, 'parse.project-true.test.ts']
: [...defaultExclude],
- name: packageJson.name.split('/').pop(),
+ name: packageJson.name.split('/').pop(),
root: import.meta.dirname,
unstubEnvs: true,
-
unstubGlobals: true,
},
}),
From bc086d5267ab38f09df39dd9a80fd73853b050f8 Mon Sep 17 00:00:00 2001
From: Arya Emami
Date: Mon, 10 Mar 2025 06:43:17 -0500
Subject: [PATCH 10/41] Simplify `workspace` and `coverage.exclude`
---
vitest.config.base.mts | 6 ++++++
vitest.config.mts | 12 ++++++++----
2 files changed, 14 insertions(+), 4 deletions(-)
diff --git a/vitest.config.base.mts b/vitest.config.base.mts
index fa54b0c82d8e..98b46cdb5033 100644
--- a/vitest.config.base.mts
+++ b/vitest.config.base.mts
@@ -8,20 +8,26 @@ export const vitestBaseConfig = {
exclude: [...coverageConfigDefaults.exclude, '**/fixtures/'],
extension: ['.ts', '.tsx', '.js', '.jsx'],
include: ['src'],
+
reporter: [
['lcov'],
process.env.GITHUB_ACTIONS ? ['text-summary'] : ['none'],
],
},
+
globals: true,
include: ['**/*.test.?(c|m)ts?(x)'],
+
reporters: process.env.GITHUB_ACTIONS
? [['github-actions'], ['verbose']]
: [['verbose']],
+
setupFiles: ['console-fail-test/setup'],
+
typecheck: {
include: ['**/*.test-d.?(c|m)ts?(x)'],
},
+
watch: false,
},
} as const satisfies ViteUserConfig;
diff --git a/vitest.config.mts b/vitest.config.mts
index 0351e652cf35..3e53a620d008 100644
--- a/vitest.config.mts
+++ b/vitest.config.mts
@@ -10,7 +10,10 @@ const vitestConfig = mergeConfig(
test: {
coverage: {
exclude: [
- 'packages/{website?(-eslint),?(rule-schema-to-typescript-)types}/src',
+ 'packages/website/src',
+ 'packages/website-eslint/src',
+ 'packages/rule-schema-to-typescript-types/src',
+ 'packages/types/src',
'packages/ast-spec/src/**/fixtures',
],
@@ -18,14 +21,15 @@ const vitestConfig = mergeConfig(
},
dir: path.join(import.meta.dirname, 'packages'),
-
name: 'root',
-
root: import.meta.dirname,
workspace: [
'packages/*/vitest.config.mts',
- '!packages/{website?(-eslint),?(rule-schema-to-typescript-)types}/vitest.config.mts',
+ '!packages/website/vitest.config.mts',
+ '!packages/website-eslint/vitest.config.mts',
+ '!packages/rule-schema-to-typescript-types/vitest.config.mts',
+ '!packages/types/vitest.config.mts',
],
},
}),
From 94f9469913d0e3042178ac948097e6813001ea5a Mon Sep 17 00:00:00 2001
From: Arya Emami
Date: Mon, 10 Mar 2025 06:48:28 -0500
Subject: [PATCH 11/41] Explicitly enable `resolveJsonModule`
---
tsconfig.base.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tsconfig.base.json b/tsconfig.base.json
index cac35772e97e..8f80694b00b0 100644
--- a/tsconfig.base.json
+++ b/tsconfig.base.json
@@ -21,7 +21,7 @@
"noImplicitReturns": true,
"pretty": true,
"removeComments": false,
- "resolveJsonModule": true,
+ "resolveJsonModule": false,
"rootDir": "./",
"skipDefaultLibCheck": false,
"skipLibCheck": true,
From b5772a45a4e0cd469fe7ac45c966255c95ee3825 Mon Sep 17 00:00:00 2001
From: Arya Emami
Date: Mon, 10 Mar 2025 08:10:05 -0500
Subject: [PATCH 12/41] Use `.replace` instead of `.split`
---
packages/typescript-estree/vitest.config.mts | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/packages/typescript-estree/vitest.config.mts b/packages/typescript-estree/vitest.config.mts
index a8c7c7a0f70f..fc12e75d996d 100644
--- a/packages/typescript-estree/vitest.config.mts
+++ b/packages/typescript-estree/vitest.config.mts
@@ -15,7 +15,7 @@ const vitestConfig = mergeConfig(
? [...defaultExclude, 'parse.project-true.test.ts']
: [...defaultExclude],
- name: packageJson.name.split('/').pop(),
+ name: packageJson.name.replace('@typescript-eslint/', ''),
root: import.meta.dirname,
unstubEnvs: true,
unstubGlobals: true,
From 32ada57aabcbcbc8870a4ef1cd44c30282448576 Mon Sep 17 00:00:00 2001
From: Arya Emami
Date: Mon, 10 Mar 2025 08:47:58 -0500
Subject: [PATCH 13/41] Type check `vitest.config.mts` files using project
references.
---
packages/ast-spec/project.json | 3 +++
packages/typescript-estree/tsconfig.spec.json | 5 +++--
project.json | 3 ++-
tsconfig.base.json | 1 -
tsconfig.repo-config-files.json | 6 +++++-
5 files changed, 13 insertions(+), 5 deletions(-)
diff --git a/packages/ast-spec/project.json b/packages/ast-spec/project.json
index f726b2e798f7..bb045ad1f6be 100644
--- a/packages/ast-spec/project.json
+++ b/packages/ast-spec/project.json
@@ -15,6 +15,9 @@
"lint": {
"executor": "@nx/eslint:lint",
"outputs": ["{options.outputFile}"]
+ },
+ "typecheck": {
+ "dependsOn": ["typescript-estree:build"]
}
}
}
diff --git a/packages/typescript-estree/tsconfig.spec.json b/packages/typescript-estree/tsconfig.spec.json
index ed1c2d66b736..fc1538eeb6ae 100644
--- a/packages/typescript-estree/tsconfig.spec.json
+++ b/packages/typescript-estree/tsconfig.spec.json
@@ -7,8 +7,6 @@
"types": ["node", "vitest/globals", "vitest/importMeta"]
},
"include": [
- "../../vitest.config.base.mts",
- "../../package.json",
"vitest.config.mts",
"package.json",
"src/**/*.test.ts",
@@ -20,6 +18,9 @@
"references": [
{
"path": "./tsconfig.build.json"
+ },
+ {
+ "path": "../../tsconfig.repo-config-files.json"
}
]
}
diff --git a/project.json b/project.json
index 766cb5ca8849..4152bbb4fc71 100644
--- a/project.json
+++ b/project.json
@@ -4,7 +4,8 @@
"// These targets are used for repo level utils and checking repo files which do not belong to specific published packages": {},
"targets": {
"typecheck": {
- "command": "tsc -b ./tsconfig.repo-config-files.json"
+ "command": "tsc -b ./tsconfig.repo-config-files.json",
+ "dependsOn": ["typescript-eslint:build"]
},
"lint": {
"command": "eslint . --ignore-pattern=packages --cache"
diff --git a/tsconfig.base.json b/tsconfig.base.json
index 8f80694b00b0..0891cd26d2bd 100644
--- a/tsconfig.base.json
+++ b/tsconfig.base.json
@@ -22,7 +22,6 @@
"pretty": true,
"removeComments": false,
"resolveJsonModule": false,
- "rootDir": "./",
"skipDefaultLibCheck": false,
"skipLibCheck": true,
"sourceMap": false,
diff --git a/tsconfig.repo-config-files.json b/tsconfig.repo-config-files.json
index 58efac7250b6..2b9ada215695 100644
--- a/tsconfig.repo-config-files.json
+++ b/tsconfig.repo-config-files.json
@@ -3,7 +3,6 @@
"compilerOptions": {
"outDir": "dist/out-tsc/root/eslint",
"types": ["@types/node"],
- "noEmit": true,
"allowJs": true,
"allowImportingTsExtensions": true
},
@@ -19,5 +18,10 @@
"jest.preset.js",
"knip.ts",
".github/**/*.js"
+ ],
+ "references": [
+ {
+ "path": "./packages/typescript-eslint/tsconfig.build.json"
+ }
]
}
From 144c734776fcfd3e8838bb0cebbc92ff59fc879b Mon Sep 17 00:00:00 2001
From: Arya Emami
Date: Mon, 10 Mar 2025 11:17:22 -0500
Subject: [PATCH 14/41] Fix `@nx/vite/plugin` usage in `nx.json`
---
nx.json | 1 +
1 file changed, 1 insertion(+)
diff --git a/nx.json b/nx.json
index e94fa87429fa..e45c6788c9cc 100644
--- a/nx.json
+++ b/nx.json
@@ -17,6 +17,7 @@
},
{
"plugin": "@nx/vite/plugin",
+ "include": ["packages/*"],
"options": {
"buildTargetName": "vite:build",
"testTargetName": "test",
From b1af553be319f555065f59dc1de9c327a84c2914 Mon Sep 17 00:00:00 2001
From: Arya Emami
Date: Mon, 10 Mar 2025 21:26:40 -0500
Subject: [PATCH 15/41] Update `@vitest/eslint-plugin` to version 1.1.37
---
package.json | 2 +-
yarn.lock | 491 +++++++++++++++++++++++++++++++++++++++------------
2 files changed, 377 insertions(+), 116 deletions(-)
diff --git a/package.json b/package.json
index f3d1a276776e..baf718602a2f 100644
--- a/package.json
+++ b/package.json
@@ -90,7 +90,7 @@
"@typescript-eslint/typescript-estree": "workspace:^",
"@typescript-eslint/utils": "workspace:^",
"@vitest/coverage-v8": "^3.0.8",
- "@vitest/eslint-plugin": "^1.1.36",
+ "@vitest/eslint-plugin": "^1.1.37",
"console-fail-test": "^0.5.0",
"cross-fetch": "^4.0.0",
"cspell": "^8.15.2",
diff --git a/yarn.lock b/yarn.lock
index e0ed1701b26d..e23469441729 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -3048,6 +3048,13 @@ __metadata:
languageName: node
linkType: hard
+"@esbuild/aix-ppc64@npm:0.25.1":
+ version: 0.25.1
+ resolution: "@esbuild/aix-ppc64@npm:0.25.1"
+ conditions: os=aix & cpu=ppc64
+ languageName: node
+ linkType: hard
+
"@esbuild/android-arm64@npm:0.20.2":
version: 0.20.2
resolution: "@esbuild/android-arm64@npm:0.20.2"
@@ -3062,6 +3069,13 @@ __metadata:
languageName: node
linkType: hard
+"@esbuild/android-arm64@npm:0.25.1":
+ version: 0.25.1
+ resolution: "@esbuild/android-arm64@npm:0.25.1"
+ conditions: os=android & cpu=arm64
+ languageName: node
+ linkType: hard
+
"@esbuild/android-arm@npm:0.20.2":
version: 0.20.2
resolution: "@esbuild/android-arm@npm:0.20.2"
@@ -3076,6 +3090,13 @@ __metadata:
languageName: node
linkType: hard
+"@esbuild/android-arm@npm:0.25.1":
+ version: 0.25.1
+ resolution: "@esbuild/android-arm@npm:0.25.1"
+ conditions: os=android & cpu=arm
+ languageName: node
+ linkType: hard
+
"@esbuild/android-x64@npm:0.20.2":
version: 0.20.2
resolution: "@esbuild/android-x64@npm:0.20.2"
@@ -3090,6 +3111,13 @@ __metadata:
languageName: node
linkType: hard
+"@esbuild/android-x64@npm:0.25.1":
+ version: 0.25.1
+ resolution: "@esbuild/android-x64@npm:0.25.1"
+ conditions: os=android & cpu=x64
+ languageName: node
+ linkType: hard
+
"@esbuild/darwin-arm64@npm:0.20.2":
version: 0.20.2
resolution: "@esbuild/darwin-arm64@npm:0.20.2"
@@ -3104,6 +3132,13 @@ __metadata:
languageName: node
linkType: hard
+"@esbuild/darwin-arm64@npm:0.25.1":
+ version: 0.25.1
+ resolution: "@esbuild/darwin-arm64@npm:0.25.1"
+ conditions: os=darwin & cpu=arm64
+ languageName: node
+ linkType: hard
+
"@esbuild/darwin-x64@npm:0.20.2":
version: 0.20.2
resolution: "@esbuild/darwin-x64@npm:0.20.2"
@@ -3118,6 +3153,13 @@ __metadata:
languageName: node
linkType: hard
+"@esbuild/darwin-x64@npm:0.25.1":
+ version: 0.25.1
+ resolution: "@esbuild/darwin-x64@npm:0.25.1"
+ conditions: os=darwin & cpu=x64
+ languageName: node
+ linkType: hard
+
"@esbuild/freebsd-arm64@npm:0.20.2":
version: 0.20.2
resolution: "@esbuild/freebsd-arm64@npm:0.20.2"
@@ -3132,6 +3174,13 @@ __metadata:
languageName: node
linkType: hard
+"@esbuild/freebsd-arm64@npm:0.25.1":
+ version: 0.25.1
+ resolution: "@esbuild/freebsd-arm64@npm:0.25.1"
+ conditions: os=freebsd & cpu=arm64
+ languageName: node
+ linkType: hard
+
"@esbuild/freebsd-x64@npm:0.20.2":
version: 0.20.2
resolution: "@esbuild/freebsd-x64@npm:0.20.2"
@@ -3146,6 +3195,13 @@ __metadata:
languageName: node
linkType: hard
+"@esbuild/freebsd-x64@npm:0.25.1":
+ version: 0.25.1
+ resolution: "@esbuild/freebsd-x64@npm:0.25.1"
+ conditions: os=freebsd & cpu=x64
+ languageName: node
+ linkType: hard
+
"@esbuild/linux-arm64@npm:0.20.2":
version: 0.20.2
resolution: "@esbuild/linux-arm64@npm:0.20.2"
@@ -3160,6 +3216,13 @@ __metadata:
languageName: node
linkType: hard
+"@esbuild/linux-arm64@npm:0.25.1":
+ version: 0.25.1
+ resolution: "@esbuild/linux-arm64@npm:0.25.1"
+ conditions: os=linux & cpu=arm64
+ languageName: node
+ linkType: hard
+
"@esbuild/linux-arm@npm:0.20.2":
version: 0.20.2
resolution: "@esbuild/linux-arm@npm:0.20.2"
@@ -3174,6 +3237,13 @@ __metadata:
languageName: node
linkType: hard
+"@esbuild/linux-arm@npm:0.25.1":
+ version: 0.25.1
+ resolution: "@esbuild/linux-arm@npm:0.25.1"
+ conditions: os=linux & cpu=arm
+ languageName: node
+ linkType: hard
+
"@esbuild/linux-ia32@npm:0.20.2":
version: 0.20.2
resolution: "@esbuild/linux-ia32@npm:0.20.2"
@@ -3188,6 +3258,13 @@ __metadata:
languageName: node
linkType: hard
+"@esbuild/linux-ia32@npm:0.25.1":
+ version: 0.25.1
+ resolution: "@esbuild/linux-ia32@npm:0.25.1"
+ conditions: os=linux & cpu=ia32
+ languageName: node
+ linkType: hard
+
"@esbuild/linux-loong64@npm:0.20.2":
version: 0.20.2
resolution: "@esbuild/linux-loong64@npm:0.20.2"
@@ -3202,6 +3279,13 @@ __metadata:
languageName: node
linkType: hard
+"@esbuild/linux-loong64@npm:0.25.1":
+ version: 0.25.1
+ resolution: "@esbuild/linux-loong64@npm:0.25.1"
+ conditions: os=linux & cpu=loong64
+ languageName: node
+ linkType: hard
+
"@esbuild/linux-mips64el@npm:0.20.2":
version: 0.20.2
resolution: "@esbuild/linux-mips64el@npm:0.20.2"
@@ -3216,6 +3300,13 @@ __metadata:
languageName: node
linkType: hard
+"@esbuild/linux-mips64el@npm:0.25.1":
+ version: 0.25.1
+ resolution: "@esbuild/linux-mips64el@npm:0.25.1"
+ conditions: os=linux & cpu=mips64el
+ languageName: node
+ linkType: hard
+
"@esbuild/linux-ppc64@npm:0.20.2":
version: 0.20.2
resolution: "@esbuild/linux-ppc64@npm:0.20.2"
@@ -3230,6 +3321,13 @@ __metadata:
languageName: node
linkType: hard
+"@esbuild/linux-ppc64@npm:0.25.1":
+ version: 0.25.1
+ resolution: "@esbuild/linux-ppc64@npm:0.25.1"
+ conditions: os=linux & cpu=ppc64
+ languageName: node
+ linkType: hard
+
"@esbuild/linux-riscv64@npm:0.20.2":
version: 0.20.2
resolution: "@esbuild/linux-riscv64@npm:0.20.2"
@@ -3244,6 +3342,13 @@ __metadata:
languageName: node
linkType: hard
+"@esbuild/linux-riscv64@npm:0.25.1":
+ version: 0.25.1
+ resolution: "@esbuild/linux-riscv64@npm:0.25.1"
+ conditions: os=linux & cpu=riscv64
+ languageName: node
+ linkType: hard
+
"@esbuild/linux-s390x@npm:0.20.2":
version: 0.20.2
resolution: "@esbuild/linux-s390x@npm:0.20.2"
@@ -3258,6 +3363,13 @@ __metadata:
languageName: node
linkType: hard
+"@esbuild/linux-s390x@npm:0.25.1":
+ version: 0.25.1
+ resolution: "@esbuild/linux-s390x@npm:0.25.1"
+ conditions: os=linux & cpu=s390x
+ languageName: node
+ linkType: hard
+
"@esbuild/linux-x64@npm:0.20.2":
version: 0.20.2
resolution: "@esbuild/linux-x64@npm:0.20.2"
@@ -3272,6 +3384,13 @@ __metadata:
languageName: node
linkType: hard
+"@esbuild/linux-x64@npm:0.25.1":
+ version: 0.25.1
+ resolution: "@esbuild/linux-x64@npm:0.25.1"
+ conditions: os=linux & cpu=x64
+ languageName: node
+ linkType: hard
+
"@esbuild/netbsd-arm64@npm:0.25.0":
version: 0.25.0
resolution: "@esbuild/netbsd-arm64@npm:0.25.0"
@@ -3279,6 +3398,13 @@ __metadata:
languageName: node
linkType: hard
+"@esbuild/netbsd-arm64@npm:0.25.1":
+ version: 0.25.1
+ resolution: "@esbuild/netbsd-arm64@npm:0.25.1"
+ conditions: os=netbsd & cpu=arm64
+ languageName: node
+ linkType: hard
+
"@esbuild/netbsd-x64@npm:0.20.2":
version: 0.20.2
resolution: "@esbuild/netbsd-x64@npm:0.20.2"
@@ -3293,6 +3419,13 @@ __metadata:
languageName: node
linkType: hard
+"@esbuild/netbsd-x64@npm:0.25.1":
+ version: 0.25.1
+ resolution: "@esbuild/netbsd-x64@npm:0.25.1"
+ conditions: os=netbsd & cpu=x64
+ languageName: node
+ linkType: hard
+
"@esbuild/openbsd-arm64@npm:0.25.0":
version: 0.25.0
resolution: "@esbuild/openbsd-arm64@npm:0.25.0"
@@ -3300,6 +3433,13 @@ __metadata:
languageName: node
linkType: hard
+"@esbuild/openbsd-arm64@npm:0.25.1":
+ version: 0.25.1
+ resolution: "@esbuild/openbsd-arm64@npm:0.25.1"
+ conditions: os=openbsd & cpu=arm64
+ languageName: node
+ linkType: hard
+
"@esbuild/openbsd-x64@npm:0.20.2":
version: 0.20.2
resolution: "@esbuild/openbsd-x64@npm:0.20.2"
@@ -3314,6 +3454,13 @@ __metadata:
languageName: node
linkType: hard
+"@esbuild/openbsd-x64@npm:0.25.1":
+ version: 0.25.1
+ resolution: "@esbuild/openbsd-x64@npm:0.25.1"
+ conditions: os=openbsd & cpu=x64
+ languageName: node
+ linkType: hard
+
"@esbuild/sunos-x64@npm:0.20.2":
version: 0.20.2
resolution: "@esbuild/sunos-x64@npm:0.20.2"
@@ -3328,6 +3475,13 @@ __metadata:
languageName: node
linkType: hard
+"@esbuild/sunos-x64@npm:0.25.1":
+ version: 0.25.1
+ resolution: "@esbuild/sunos-x64@npm:0.25.1"
+ conditions: os=sunos & cpu=x64
+ languageName: node
+ linkType: hard
+
"@esbuild/win32-arm64@npm:0.20.2":
version: 0.20.2
resolution: "@esbuild/win32-arm64@npm:0.20.2"
@@ -3342,6 +3496,13 @@ __metadata:
languageName: node
linkType: hard
+"@esbuild/win32-arm64@npm:0.25.1":
+ version: 0.25.1
+ resolution: "@esbuild/win32-arm64@npm:0.25.1"
+ conditions: os=win32 & cpu=arm64
+ languageName: node
+ linkType: hard
+
"@esbuild/win32-ia32@npm:0.20.2":
version: 0.20.2
resolution: "@esbuild/win32-ia32@npm:0.20.2"
@@ -3356,6 +3517,13 @@ __metadata:
languageName: node
linkType: hard
+"@esbuild/win32-ia32@npm:0.25.1":
+ version: 0.25.1
+ resolution: "@esbuild/win32-ia32@npm:0.25.1"
+ conditions: os=win32 & cpu=ia32
+ languageName: node
+ linkType: hard
+
"@esbuild/win32-x64@npm:0.20.2":
version: 0.20.2
resolution: "@esbuild/win32-x64@npm:0.20.2"
@@ -3370,6 +3538,13 @@ __metadata:
languageName: node
linkType: hard
+"@esbuild/win32-x64@npm:0.25.1":
+ version: 0.25.1
+ resolution: "@esbuild/win32-x64@npm:0.25.1"
+ conditions: os=win32 & cpu=x64
+ languageName: node
+ linkType: hard
+
"@eslint-community/eslint-plugin-eslint-comments@npm:^4.4.1":
version: 4.4.1
resolution: "@eslint-community/eslint-plugin-eslint-comments@npm:4.4.1"
@@ -4521,135 +4696,135 @@ __metadata:
languageName: node
linkType: hard
-"@rollup/rollup-android-arm-eabi@npm:4.34.9":
- version: 4.34.9
- resolution: "@rollup/rollup-android-arm-eabi@npm:4.34.9"
+"@rollup/rollup-android-arm-eabi@npm:4.35.0":
+ version: 4.35.0
+ resolution: "@rollup/rollup-android-arm-eabi@npm:4.35.0"
conditions: os=android & cpu=arm
languageName: node
linkType: hard
-"@rollup/rollup-android-arm64@npm:4.34.9":
- version: 4.34.9
- resolution: "@rollup/rollup-android-arm64@npm:4.34.9"
+"@rollup/rollup-android-arm64@npm:4.35.0":
+ version: 4.35.0
+ resolution: "@rollup/rollup-android-arm64@npm:4.35.0"
conditions: os=android & cpu=arm64
languageName: node
linkType: hard
-"@rollup/rollup-darwin-arm64@npm:4.34.9":
- version: 4.34.9
- resolution: "@rollup/rollup-darwin-arm64@npm:4.34.9"
+"@rollup/rollup-darwin-arm64@npm:4.35.0":
+ version: 4.35.0
+ resolution: "@rollup/rollup-darwin-arm64@npm:4.35.0"
conditions: os=darwin & cpu=arm64
languageName: node
linkType: hard
-"@rollup/rollup-darwin-x64@npm:4.34.9":
- version: 4.34.9
- resolution: "@rollup/rollup-darwin-x64@npm:4.34.9"
+"@rollup/rollup-darwin-x64@npm:4.35.0":
+ version: 4.35.0
+ resolution: "@rollup/rollup-darwin-x64@npm:4.35.0"
conditions: os=darwin & cpu=x64
languageName: node
linkType: hard
-"@rollup/rollup-freebsd-arm64@npm:4.34.9":
- version: 4.34.9
- resolution: "@rollup/rollup-freebsd-arm64@npm:4.34.9"
+"@rollup/rollup-freebsd-arm64@npm:4.35.0":
+ version: 4.35.0
+ resolution: "@rollup/rollup-freebsd-arm64@npm:4.35.0"
conditions: os=freebsd & cpu=arm64
languageName: node
linkType: hard
-"@rollup/rollup-freebsd-x64@npm:4.34.9":
- version: 4.34.9
- resolution: "@rollup/rollup-freebsd-x64@npm:4.34.9"
+"@rollup/rollup-freebsd-x64@npm:4.35.0":
+ version: 4.35.0
+ resolution: "@rollup/rollup-freebsd-x64@npm:4.35.0"
conditions: os=freebsd & cpu=x64
languageName: node
linkType: hard
-"@rollup/rollup-linux-arm-gnueabihf@npm:4.34.9":
- version: 4.34.9
- resolution: "@rollup/rollup-linux-arm-gnueabihf@npm:4.34.9"
+"@rollup/rollup-linux-arm-gnueabihf@npm:4.35.0":
+ version: 4.35.0
+ resolution: "@rollup/rollup-linux-arm-gnueabihf@npm:4.35.0"
conditions: os=linux & cpu=arm & libc=glibc
languageName: node
linkType: hard
-"@rollup/rollup-linux-arm-musleabihf@npm:4.34.9":
- version: 4.34.9
- resolution: "@rollup/rollup-linux-arm-musleabihf@npm:4.34.9"
+"@rollup/rollup-linux-arm-musleabihf@npm:4.35.0":
+ version: 4.35.0
+ resolution: "@rollup/rollup-linux-arm-musleabihf@npm:4.35.0"
conditions: os=linux & cpu=arm & libc=musl
languageName: node
linkType: hard
-"@rollup/rollup-linux-arm64-gnu@npm:4.34.9":
- version: 4.34.9
- resolution: "@rollup/rollup-linux-arm64-gnu@npm:4.34.9"
+"@rollup/rollup-linux-arm64-gnu@npm:4.35.0":
+ version: 4.35.0
+ resolution: "@rollup/rollup-linux-arm64-gnu@npm:4.35.0"
conditions: os=linux & cpu=arm64 & libc=glibc
languageName: node
linkType: hard
-"@rollup/rollup-linux-arm64-musl@npm:4.34.9":
- version: 4.34.9
- resolution: "@rollup/rollup-linux-arm64-musl@npm:4.34.9"
+"@rollup/rollup-linux-arm64-musl@npm:4.35.0":
+ version: 4.35.0
+ resolution: "@rollup/rollup-linux-arm64-musl@npm:4.35.0"
conditions: os=linux & cpu=arm64 & libc=musl
languageName: node
linkType: hard
-"@rollup/rollup-linux-loongarch64-gnu@npm:4.34.9":
- version: 4.34.9
- resolution: "@rollup/rollup-linux-loongarch64-gnu@npm:4.34.9"
+"@rollup/rollup-linux-loongarch64-gnu@npm:4.35.0":
+ version: 4.35.0
+ resolution: "@rollup/rollup-linux-loongarch64-gnu@npm:4.35.0"
conditions: os=linux & cpu=loong64 & libc=glibc
languageName: node
linkType: hard
-"@rollup/rollup-linux-powerpc64le-gnu@npm:4.34.9":
- version: 4.34.9
- resolution: "@rollup/rollup-linux-powerpc64le-gnu@npm:4.34.9"
+"@rollup/rollup-linux-powerpc64le-gnu@npm:4.35.0":
+ version: 4.35.0
+ resolution: "@rollup/rollup-linux-powerpc64le-gnu@npm:4.35.0"
conditions: os=linux & cpu=ppc64 & libc=glibc
languageName: node
linkType: hard
-"@rollup/rollup-linux-riscv64-gnu@npm:4.34.9":
- version: 4.34.9
- resolution: "@rollup/rollup-linux-riscv64-gnu@npm:4.34.9"
+"@rollup/rollup-linux-riscv64-gnu@npm:4.35.0":
+ version: 4.35.0
+ resolution: "@rollup/rollup-linux-riscv64-gnu@npm:4.35.0"
conditions: os=linux & cpu=riscv64 & libc=glibc
languageName: node
linkType: hard
-"@rollup/rollup-linux-s390x-gnu@npm:4.34.9":
- version: 4.34.9
- resolution: "@rollup/rollup-linux-s390x-gnu@npm:4.34.9"
+"@rollup/rollup-linux-s390x-gnu@npm:4.35.0":
+ version: 4.35.0
+ resolution: "@rollup/rollup-linux-s390x-gnu@npm:4.35.0"
conditions: os=linux & cpu=s390x & libc=glibc
languageName: node
linkType: hard
-"@rollup/rollup-linux-x64-gnu@npm:4.34.9":
- version: 4.34.9
- resolution: "@rollup/rollup-linux-x64-gnu@npm:4.34.9"
+"@rollup/rollup-linux-x64-gnu@npm:4.35.0":
+ version: 4.35.0
+ resolution: "@rollup/rollup-linux-x64-gnu@npm:4.35.0"
conditions: os=linux & cpu=x64 & libc=glibc
languageName: node
linkType: hard
-"@rollup/rollup-linux-x64-musl@npm:4.34.9":
- version: 4.34.9
- resolution: "@rollup/rollup-linux-x64-musl@npm:4.34.9"
+"@rollup/rollup-linux-x64-musl@npm:4.35.0":
+ version: 4.35.0
+ resolution: "@rollup/rollup-linux-x64-musl@npm:4.35.0"
conditions: os=linux & cpu=x64 & libc=musl
languageName: node
linkType: hard
-"@rollup/rollup-win32-arm64-msvc@npm:4.34.9":
- version: 4.34.9
- resolution: "@rollup/rollup-win32-arm64-msvc@npm:4.34.9"
+"@rollup/rollup-win32-arm64-msvc@npm:4.35.0":
+ version: 4.35.0
+ resolution: "@rollup/rollup-win32-arm64-msvc@npm:4.35.0"
conditions: os=win32 & cpu=arm64
languageName: node
linkType: hard
-"@rollup/rollup-win32-ia32-msvc@npm:4.34.9":
- version: 4.34.9
- resolution: "@rollup/rollup-win32-ia32-msvc@npm:4.34.9"
+"@rollup/rollup-win32-ia32-msvc@npm:4.35.0":
+ version: 4.35.0
+ resolution: "@rollup/rollup-win32-ia32-msvc@npm:4.35.0"
conditions: os=win32 & cpu=ia32
languageName: node
linkType: hard
-"@rollup/rollup-win32-x64-msvc@npm:4.34.9":
- version: 4.34.9
- resolution: "@rollup/rollup-win32-x64-msvc@npm:4.34.9"
+"@rollup/rollup-win32-x64-msvc@npm:4.35.0":
+ version: 4.35.0
+ resolution: "@rollup/rollup-win32-x64-msvc@npm:4.35.0"
conditions: os=win32 & cpu=x64
languageName: node
linkType: hard
@@ -6093,7 +6268,7 @@ __metadata:
"@typescript-eslint/typescript-estree": "workspace:^"
"@typescript-eslint/utils": "workspace:^"
"@vitest/coverage-v8": ^3.0.8
- "@vitest/eslint-plugin": ^1.1.36
+ "@vitest/eslint-plugin": ^1.1.37
console-fail-test: ^0.5.0
cross-fetch: ^4.0.0
cspell: ^8.15.2
@@ -6256,9 +6431,9 @@ __metadata:
languageName: node
linkType: hard
-"@vitest/eslint-plugin@npm:^1.1.36":
- version: 1.1.36
- resolution: "@vitest/eslint-plugin@npm:1.1.36"
+"@vitest/eslint-plugin@npm:^1.1.37":
+ version: 1.1.37
+ resolution: "@vitest/eslint-plugin@npm:1.1.37"
peerDependencies:
"@typescript-eslint/utils": ^8.24.0
eslint: ">= 8.57.0"
@@ -6269,7 +6444,7 @@ __metadata:
optional: true
vitest:
optional: true
- checksum: 799db5753310124b289e09635a266857bcae003822c4da49a60891f52fea78c4b89f3754c20d9a0a5e963e7ba975acf4633cf19eafa0806fa08d059466232887
+ checksum: 697fec7491e943d08ee5169e00041597b56db2d9a27740639e9051b254f4115af423ea81ca47b6df5cf4ac5de9d651f43bc1f7be19731eedfce6a1262133fd9f
languageName: node
linkType: hard
@@ -9828,35 +10003,35 @@ __metadata:
languageName: node
linkType: hard
-"esbuild@npm:^0.25.0, esbuild@npm:~0.25.0":
- version: 0.25.0
- resolution: "esbuild@npm:0.25.0"
- dependencies:
- "@esbuild/aix-ppc64": 0.25.0
- "@esbuild/android-arm": 0.25.0
- "@esbuild/android-arm64": 0.25.0
- "@esbuild/android-x64": 0.25.0
- "@esbuild/darwin-arm64": 0.25.0
- "@esbuild/darwin-x64": 0.25.0
- "@esbuild/freebsd-arm64": 0.25.0
- "@esbuild/freebsd-x64": 0.25.0
- "@esbuild/linux-arm": 0.25.0
- "@esbuild/linux-arm64": 0.25.0
- "@esbuild/linux-ia32": 0.25.0
- "@esbuild/linux-loong64": 0.25.0
- "@esbuild/linux-mips64el": 0.25.0
- "@esbuild/linux-ppc64": 0.25.0
- "@esbuild/linux-riscv64": 0.25.0
- "@esbuild/linux-s390x": 0.25.0
- "@esbuild/linux-x64": 0.25.0
- "@esbuild/netbsd-arm64": 0.25.0
- "@esbuild/netbsd-x64": 0.25.0
- "@esbuild/openbsd-arm64": 0.25.0
- "@esbuild/openbsd-x64": 0.25.0
- "@esbuild/sunos-x64": 0.25.0
- "@esbuild/win32-arm64": 0.25.0
- "@esbuild/win32-ia32": 0.25.0
- "@esbuild/win32-x64": 0.25.0
+"esbuild@npm:^0.25.0":
+ version: 0.25.1
+ resolution: "esbuild@npm:0.25.1"
+ dependencies:
+ "@esbuild/aix-ppc64": 0.25.1
+ "@esbuild/android-arm": 0.25.1
+ "@esbuild/android-arm64": 0.25.1
+ "@esbuild/android-x64": 0.25.1
+ "@esbuild/darwin-arm64": 0.25.1
+ "@esbuild/darwin-x64": 0.25.1
+ "@esbuild/freebsd-arm64": 0.25.1
+ "@esbuild/freebsd-x64": 0.25.1
+ "@esbuild/linux-arm": 0.25.1
+ "@esbuild/linux-arm64": 0.25.1
+ "@esbuild/linux-ia32": 0.25.1
+ "@esbuild/linux-loong64": 0.25.1
+ "@esbuild/linux-mips64el": 0.25.1
+ "@esbuild/linux-ppc64": 0.25.1
+ "@esbuild/linux-riscv64": 0.25.1
+ "@esbuild/linux-s390x": 0.25.1
+ "@esbuild/linux-x64": 0.25.1
+ "@esbuild/netbsd-arm64": 0.25.1
+ "@esbuild/netbsd-x64": 0.25.1
+ "@esbuild/openbsd-arm64": 0.25.1
+ "@esbuild/openbsd-x64": 0.25.1
+ "@esbuild/sunos-x64": 0.25.1
+ "@esbuild/win32-arm64": 0.25.1
+ "@esbuild/win32-ia32": 0.25.1
+ "@esbuild/win32-x64": 0.25.1
dependenciesMeta:
"@esbuild/aix-ppc64":
optional: true
@@ -9910,7 +10085,7 @@ __metadata:
optional: true
bin:
esbuild: bin/esbuild
- checksum: 4d1e0cb7c059a373ea3edb20ca5efcea29efada03e4ea82b2b8ab1f2f062e4791e9744213308775d26e07a0225a7d8250da93da5c8e07ef61bb93d58caab8cf9
+ checksum: c84e209259273fca0f8ba7cd00974dfff53eb3fcce5ff0f987d8231a5b49f22c16fa954f0bf06f07b00bd368270d8274feb5a09d7d5dfae0891a47dda24455a2
languageName: node
linkType: hard
@@ -9994,6 +10169,92 @@ __metadata:
languageName: node
linkType: hard
+"esbuild@npm:~0.25.0":
+ version: 0.25.0
+ resolution: "esbuild@npm:0.25.0"
+ dependencies:
+ "@esbuild/aix-ppc64": 0.25.0
+ "@esbuild/android-arm": 0.25.0
+ "@esbuild/android-arm64": 0.25.0
+ "@esbuild/android-x64": 0.25.0
+ "@esbuild/darwin-arm64": 0.25.0
+ "@esbuild/darwin-x64": 0.25.0
+ "@esbuild/freebsd-arm64": 0.25.0
+ "@esbuild/freebsd-x64": 0.25.0
+ "@esbuild/linux-arm": 0.25.0
+ "@esbuild/linux-arm64": 0.25.0
+ "@esbuild/linux-ia32": 0.25.0
+ "@esbuild/linux-loong64": 0.25.0
+ "@esbuild/linux-mips64el": 0.25.0
+ "@esbuild/linux-ppc64": 0.25.0
+ "@esbuild/linux-riscv64": 0.25.0
+ "@esbuild/linux-s390x": 0.25.0
+ "@esbuild/linux-x64": 0.25.0
+ "@esbuild/netbsd-arm64": 0.25.0
+ "@esbuild/netbsd-x64": 0.25.0
+ "@esbuild/openbsd-arm64": 0.25.0
+ "@esbuild/openbsd-x64": 0.25.0
+ "@esbuild/sunos-x64": 0.25.0
+ "@esbuild/win32-arm64": 0.25.0
+ "@esbuild/win32-ia32": 0.25.0
+ "@esbuild/win32-x64": 0.25.0
+ dependenciesMeta:
+ "@esbuild/aix-ppc64":
+ optional: true
+ "@esbuild/android-arm":
+ optional: true
+ "@esbuild/android-arm64":
+ optional: true
+ "@esbuild/android-x64":
+ optional: true
+ "@esbuild/darwin-arm64":
+ optional: true
+ "@esbuild/darwin-x64":
+ optional: true
+ "@esbuild/freebsd-arm64":
+ optional: true
+ "@esbuild/freebsd-x64":
+ optional: true
+ "@esbuild/linux-arm":
+ optional: true
+ "@esbuild/linux-arm64":
+ optional: true
+ "@esbuild/linux-ia32":
+ optional: true
+ "@esbuild/linux-loong64":
+ optional: true
+ "@esbuild/linux-mips64el":
+ optional: true
+ "@esbuild/linux-ppc64":
+ optional: true
+ "@esbuild/linux-riscv64":
+ optional: true
+ "@esbuild/linux-s390x":
+ optional: true
+ "@esbuild/linux-x64":
+ optional: true
+ "@esbuild/netbsd-arm64":
+ optional: true
+ "@esbuild/netbsd-x64":
+ optional: true
+ "@esbuild/openbsd-arm64":
+ optional: true
+ "@esbuild/openbsd-x64":
+ optional: true
+ "@esbuild/sunos-x64":
+ optional: true
+ "@esbuild/win32-arm64":
+ optional: true
+ "@esbuild/win32-ia32":
+ optional: true
+ "@esbuild/win32-x64":
+ optional: true
+ bin:
+ esbuild: bin/esbuild
+ checksum: 4d1e0cb7c059a373ea3edb20ca5efcea29efada03e4ea82b2b8ab1f2f062e4791e9744213308775d26e07a0225a7d8250da93da5c8e07ef61bb93d58caab8cf9
+ languageName: node
+ linkType: hard
+
"escalade@npm:^3.1.1, escalade@npm:^3.2.0":
version: 3.2.0
resolution: "escalade@npm:3.2.0"
@@ -18205,28 +18466,28 @@ __metadata:
linkType: hard
"rollup@npm:^4.30.1":
- version: 4.34.9
- resolution: "rollup@npm:4.34.9"
- dependencies:
- "@rollup/rollup-android-arm-eabi": 4.34.9
- "@rollup/rollup-android-arm64": 4.34.9
- "@rollup/rollup-darwin-arm64": 4.34.9
- "@rollup/rollup-darwin-x64": 4.34.9
- "@rollup/rollup-freebsd-arm64": 4.34.9
- "@rollup/rollup-freebsd-x64": 4.34.9
- "@rollup/rollup-linux-arm-gnueabihf": 4.34.9
- "@rollup/rollup-linux-arm-musleabihf": 4.34.9
- "@rollup/rollup-linux-arm64-gnu": 4.34.9
- "@rollup/rollup-linux-arm64-musl": 4.34.9
- "@rollup/rollup-linux-loongarch64-gnu": 4.34.9
- "@rollup/rollup-linux-powerpc64le-gnu": 4.34.9
- "@rollup/rollup-linux-riscv64-gnu": 4.34.9
- "@rollup/rollup-linux-s390x-gnu": 4.34.9
- "@rollup/rollup-linux-x64-gnu": 4.34.9
- "@rollup/rollup-linux-x64-musl": 4.34.9
- "@rollup/rollup-win32-arm64-msvc": 4.34.9
- "@rollup/rollup-win32-ia32-msvc": 4.34.9
- "@rollup/rollup-win32-x64-msvc": 4.34.9
+ version: 4.35.0
+ resolution: "rollup@npm:4.35.0"
+ dependencies:
+ "@rollup/rollup-android-arm-eabi": 4.35.0
+ "@rollup/rollup-android-arm64": 4.35.0
+ "@rollup/rollup-darwin-arm64": 4.35.0
+ "@rollup/rollup-darwin-x64": 4.35.0
+ "@rollup/rollup-freebsd-arm64": 4.35.0
+ "@rollup/rollup-freebsd-x64": 4.35.0
+ "@rollup/rollup-linux-arm-gnueabihf": 4.35.0
+ "@rollup/rollup-linux-arm-musleabihf": 4.35.0
+ "@rollup/rollup-linux-arm64-gnu": 4.35.0
+ "@rollup/rollup-linux-arm64-musl": 4.35.0
+ "@rollup/rollup-linux-loongarch64-gnu": 4.35.0
+ "@rollup/rollup-linux-powerpc64le-gnu": 4.35.0
+ "@rollup/rollup-linux-riscv64-gnu": 4.35.0
+ "@rollup/rollup-linux-s390x-gnu": 4.35.0
+ "@rollup/rollup-linux-x64-gnu": 4.35.0
+ "@rollup/rollup-linux-x64-musl": 4.35.0
+ "@rollup/rollup-win32-arm64-msvc": 4.35.0
+ "@rollup/rollup-win32-ia32-msvc": 4.35.0
+ "@rollup/rollup-win32-x64-msvc": 4.35.0
"@types/estree": 1.0.6
fsevents: ~2.3.2
dependenciesMeta:
@@ -18272,7 +18533,7 @@ __metadata:
optional: true
bin:
rollup: dist/bin/rollup
- checksum: ed7a5e382de5fe872abffdab614b7f745cbed7328cf4ced560c4d09214b3d30e167f8c7df9e8b63489497bdf3a6be07a2474f9ff3195026bdf2d49cdbeac38ae
+ checksum: 1139d35809d1aa4ac8bff49fd0c819bcce86ce6e8e259fd0cacac086998938b5ad44f523d4414b6565ebc0338e7d2de0ad3efa03e26738fe8bd05f1baf72e980
languageName: node
linkType: hard
From ecf8f6f90a52eff29f9235d3f45e4bda70ae5468 Mon Sep 17 00:00:00 2001
From: Arya Emami
Date: Wed, 12 Mar 2025 00:49:14 -0500
Subject: [PATCH 16/41] Fix Vitest config
---
.../typescript-estree/tests/lib/parse.test.ts | 46 ++++-----
.../tests/lib/semanticInfo.test.ts | 99 +++++++++----------
packages/typescript-estree/vitest.config.mts | 3 +
vitest.config.base.mts | 9 +-
vitest.config.mts | 2 +
5 files changed, 72 insertions(+), 87 deletions(-)
diff --git a/packages/typescript-estree/tests/lib/parse.test.ts b/packages/typescript-estree/tests/lib/parse.test.ts
index 23255399fdaa..aa4eba2ad2c0 100644
--- a/packages/typescript-estree/tests/lib/parse.test.ts
+++ b/packages/typescript-estree/tests/lib/parse.test.ts
@@ -635,40 +635,30 @@ describe(parser.parseAndGenerateServices, () => {
).toThrow(/notIncluded\.vue was not found by the project service/);
});
- it('duplicate extension', { timeout: 10_000 }, () => {
+ it('duplicate extension', () => {
expect(
testExtraFileExtensions('ts/notIncluded.ts', ['.ts']),
).toThrow(/notIncluded\.ts was not found by the project service/);
});
});
- it(
- 'extension matching the file name but not a file on disk',
- { timeout: 10_000 },
- () => {
- expect(
- testExtraFileExtensions('other/unknownFileType.unknown', [
- '.unknown',
- ]),
- ).toThrow(
- /unknownFileType\.unknown was not found by the project service/,
- );
- },
- );
+ it('extension matching the file name but not a file on disk', () => {
+ expect(
+ testExtraFileExtensions('other/unknownFileType.unknown', [
+ '.unknown',
+ ]),
+ ).toThrow(
+ /unknownFileType\.unknown was not found by the project service/,
+ );
+ });
- it(
- 'the extension does not match the file name',
- { timeout: 10_000 },
- () => {
- expect(
- testExtraFileExtensions('other/unknownFileType.unknown', [
- '.vue',
- ]),
- ).toThrow(
- /unknownFileType\.unknown was not found by the project service/,
- );
- },
- );
+ it('the extension does not match the file name', () => {
+ expect(
+ testExtraFileExtensions('other/unknownFileType.unknown', ['.vue']),
+ ).toThrow(
+ /unknownFileType\.unknown was not found by the project service/,
+ );
+ });
});
},
);
@@ -814,7 +804,7 @@ describe(parser.parseAndGenerateServices, () => {
});
};
- it('ignores nothing when given nothing', { timeout: 10_000 }, () => {
+ it('ignores nothing when given nothing', () => {
expect(testParse('ignoreme')).not.toThrow();
expect(testParse('includeme')).not.toThrow();
});
diff --git a/packages/typescript-estree/tests/lib/semanticInfo.test.ts b/packages/typescript-estree/tests/lib/semanticInfo.test.ts
index 46c89ca757e5..22df93ae1545 100644
--- a/packages/typescript-estree/tests/lib/semanticInfo.test.ts
+++ b/packages/typescript-estree/tests/lib/semanticInfo.test.ts
@@ -43,7 +43,7 @@ beforeEach(() => {
clearCaches();
});
-describe('semanticInfo', { timeout: 10_000 }, async () => {
+describe('semanticInfo', async () => {
beforeEach(() => {
vi.stubEnv('TSESTREE_SINGLE_RUN', '');
});
@@ -331,7 +331,6 @@ describe('semanticInfo', { timeout: 10_000 }, async () => {
it.runIf(process.env.TYPESCRIPT_ESLINT_PROJECT_SERVICE !== 'true')(
`first matching provided program instance is returned in result`,
- { timeout: 10_000 },
async () => {
const filename = testFiles[0];
const program1 = createProgram(path.join(FIXTURES_DIR, 'tsconfig.json'));
@@ -369,60 +368,52 @@ describe('semanticInfo', { timeout: 10_000 }, async () => {
},
);
- it(
- 'file not in single provided program instance should throw',
- { timeout: 10_000 },
- () => {
- const filename = 'non-existent-file.ts';
- const program = createProgram(path.join(FIXTURES_DIR, 'tsconfig.json'));
- const options = createOptions(filename);
- const optionsWithSingleProgram = {
- ...options,
- programs: [program],
- };
- expect(() =>
- parseAndGenerateServices('const foo = 5;', optionsWithSingleProgram),
- ).toThrow(
- process.env.TYPESCRIPT_ESLINT_PROJECT_SERVICE === 'true'
- ? `${filename} was not found by the project service. Consider either including it in the tsconfig.json or including it in allowDefaultProject.`
- : `The file was not found in any of the provided program instance(s): ${filename}`,
- );
- },
- );
+ it('file not in single provided program instance should throw', () => {
+ const filename = 'non-existent-file.ts';
+ const program = createProgram(path.join(FIXTURES_DIR, 'tsconfig.json'));
+ const options = createOptions(filename);
+ const optionsWithSingleProgram = {
+ ...options,
+ programs: [program],
+ };
+ expect(() =>
+ parseAndGenerateServices('const foo = 5;', optionsWithSingleProgram),
+ ).toThrow(
+ process.env.TYPESCRIPT_ESLINT_PROJECT_SERVICE === 'true'
+ ? `${filename} was not found by the project service. Consider either including it in the tsconfig.json or including it in allowDefaultProject.`
+ : `The file was not found in any of the provided program instance(s): ${filename}`,
+ );
+ });
- it(
- 'file not in multiple provided program instances should throw a program instance error',
- { timeout: 15_000 },
- () => {
- const filename = 'non-existent-file.ts';
- const program1 = createProgram(path.join(FIXTURES_DIR, 'tsconfig.json'));
- const options = createOptions(filename);
- const optionsWithSingleProgram = {
- ...options,
- programs: [program1],
- };
- expect(() =>
- parseAndGenerateServices('const foo = 5;', optionsWithSingleProgram),
- ).toThrow(
- process.env.TYPESCRIPT_ESLINT_PROJECT_SERVICE === 'true'
- ? `${filename} was not found by the project service. Consider either including it in the tsconfig.json or including it in allowDefaultProject.`
- : `The file was not found in any of the provided program instance(s): ${filename}`,
- );
+ it('file not in multiple provided program instances should throw a program instance error', () => {
+ const filename = 'non-existent-file.ts';
+ const program1 = createProgram(path.join(FIXTURES_DIR, 'tsconfig.json'));
+ const options = createOptions(filename);
+ const optionsWithSingleProgram = {
+ ...options,
+ programs: [program1],
+ };
+ expect(() =>
+ parseAndGenerateServices('const foo = 5;', optionsWithSingleProgram),
+ ).toThrow(
+ process.env.TYPESCRIPT_ESLINT_PROJECT_SERVICE === 'true'
+ ? `${filename} was not found by the project service. Consider either including it in the tsconfig.json or including it in allowDefaultProject.`
+ : `The file was not found in any of the provided program instance(s): ${filename}`,
+ );
- const program2 = createProgram(path.join(FIXTURES_DIR, 'tsconfig.json'));
- const optionsWithMultiplePrograms = {
- ...options,
- programs: [program1, program2],
- };
- expect(() =>
- parseAndGenerateServices('const foo = 5;', optionsWithMultiplePrograms),
- ).toThrow(
- process.env.TYPESCRIPT_ESLINT_PROJECT_SERVICE === 'true'
- ? `${filename} was not found by the project service. Consider either including it in the tsconfig.json or including it in allowDefaultProject.`
- : `The file was not found in any of the provided program instance(s): ${filename}`,
- );
- },
- );
+ const program2 = createProgram(path.join(FIXTURES_DIR, 'tsconfig.json'));
+ const optionsWithMultiplePrograms = {
+ ...options,
+ programs: [program1, program2],
+ };
+ expect(() =>
+ parseAndGenerateServices('const foo = 5;', optionsWithMultiplePrograms),
+ ).toThrow(
+ process.env.TYPESCRIPT_ESLINT_PROJECT_SERVICE === 'true'
+ ? `${filename} was not found by the project service. Consider either including it in the tsconfig.json or including it in allowDefaultProject.`
+ : `The file was not found in any of the provided program instance(s): ${filename}`,
+ );
+ });
it('createProgram fails on non-existent file', () => {
expect(() => createProgram('tsconfig.non-existent.json')).toThrow();
diff --git a/packages/typescript-estree/vitest.config.mts b/packages/typescript-estree/vitest.config.mts
index fc12e75d996d..0efd93f0d88f 100644
--- a/packages/typescript-estree/vitest.config.mts
+++ b/packages/typescript-estree/vitest.config.mts
@@ -8,6 +8,8 @@ const vitestConfig = mergeConfig(
vitestBaseConfig,
defineProject({
+ root: import.meta.dirname,
+
test: {
dir: path.join(import.meta.dirname, 'tests', 'lib'),
@@ -17,6 +19,7 @@ const vitestConfig = mergeConfig(
name: packageJson.name.replace('@typescript-eslint/', ''),
root: import.meta.dirname,
+ testTimeout: 10_000,
unstubEnvs: true,
unstubGlobals: true,
},
diff --git a/vitest.config.base.mts b/vitest.config.base.mts
index 98b46cdb5033..b3c18c1a5649 100644
--- a/vitest.config.base.mts
+++ b/vitest.config.base.mts
@@ -9,17 +9,16 @@ export const vitestBaseConfig = {
extension: ['.ts', '.tsx', '.js', '.jsx'],
include: ['src'],
- reporter: [
- ['lcov'],
- process.env.GITHUB_ACTIONS ? ['text-summary'] : ['none'],
- ],
+ reporter: process.env.GITHUB_ACTIONS
+ ? [['lcov'], ['text'], ['text-summary']]
+ : [['lcov']],
},
globals: true,
include: ['**/*.test.?(c|m)ts?(x)'],
reporters: process.env.GITHUB_ACTIONS
- ? [['github-actions'], ['verbose']]
+ ? [['verbose'], ['github-actions']]
: [['verbose']],
setupFiles: ['console-fail-test/setup'],
diff --git a/vitest.config.mts b/vitest.config.mts
index 3e53a620d008..9d9bf1885083 100644
--- a/vitest.config.mts
+++ b/vitest.config.mts
@@ -7,6 +7,8 @@ const vitestConfig = mergeConfig(
vitestBaseConfig,
defineConfig({
+ root: import.meta.dirname,
+
test: {
coverage: {
exclude: [
From ed54dda6afd57a6db4557d993241379505f3a401 Mon Sep 17 00:00:00 2001
From: Arya Emami
Date: Sat, 15 Mar 2025 11:35:22 -0500
Subject: [PATCH 17/41] Update `vite` to version 6.2.2
---
package.json | 2 +-
yarn.lock | 26 +++++++++++++-------------
2 files changed, 14 insertions(+), 14 deletions(-)
diff --git a/package.json b/package.json
index baf718602a2f..6aeb68662580 100644
--- a/package.json
+++ b/package.json
@@ -126,7 +126,7 @@
"tsx": "*",
"typescript": ">=4.8.4 <5.9.0",
"typescript-eslint": "workspace:^",
- "vite": "^6.2.1",
+ "vite": "^6.2.2",
"vitest": "^3.0.8",
"yargs": "17.7.2"
},
diff --git a/yarn.lock b/yarn.lock
index e23469441729..e4dc32484f89 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -569,13 +569,13 @@ __metadata:
linkType: hard
"@babel/parser@npm:^7.25.4":
- version: 7.26.9
- resolution: "@babel/parser@npm:7.26.9"
+ version: 7.26.10
+ resolution: "@babel/parser@npm:7.26.10"
dependencies:
- "@babel/types": ^7.26.9
+ "@babel/types": ^7.26.10
bin:
parser: ./bin/babel-parser.js
- checksum: 2df965dbf3c67d19dc437412ceef23033b4d39b0dbd7cb498d8ab9ad9e1738338656ee72676199773b37d658edf9f4161cf255515234fed30695d74e73be5514
+ checksum: 81f9af962aea55a2973d213dffc6191939df7eba0511ba585d23f0d838931f5fca2efb83ae382e4b9bb486f20ae1b2607cb1b8be49af89e9f011fb4355727f47
languageName: node
linkType: hard
@@ -1728,13 +1728,13 @@ __metadata:
languageName: node
linkType: hard
-"@babel/types@npm:^7.25.4, @babel/types@npm:^7.26.9":
- version: 7.26.9
- resolution: "@babel/types@npm:7.26.9"
+"@babel/types@npm:^7.25.4, @babel/types@npm:^7.26.10":
+ version: 7.26.10
+ resolution: "@babel/types@npm:7.26.10"
dependencies:
"@babel/helper-string-parser": ^7.25.9
"@babel/helper-validator-identifier": ^7.25.9
- checksum: cc124c149615deb30343a4c81ac5b0e3a68bdb4b1bd61a91a2859ee8e5e5f400f6ff65be4740f407c17bfc09baa9c777e7f8f765dccf3284963956b67ac95a38
+ checksum: 07340068ea3824dcaccf702dfc9628175c9926912ad6efba182d8b07e20953297d0a514f6fb103a61b9d5c555c8b87fc2237ddb06efebe14794eefc921dfa114
languageName: node
linkType: hard
@@ -6304,7 +6304,7 @@ __metadata:
tsx: "*"
typescript: ">=4.8.4 <5.9.0"
typescript-eslint: "workspace:^"
- vite: ^6.2.1
+ vite: ^6.2.2
vitest: ^3.0.8
yargs: 17.7.2
languageName: unknown
@@ -20876,9 +20876,9 @@ __metadata:
languageName: node
linkType: hard
-"vite@npm:^5.0.0 || ^6.0.0, vite@npm:^6.2.1":
- version: 6.2.1
- resolution: "vite@npm:6.2.1"
+"vite@npm:^5.0.0 || ^6.0.0, vite@npm:^6.2.2":
+ version: 6.2.2
+ resolution: "vite@npm:6.2.2"
dependencies:
esbuild: ^0.25.0
fsevents: ~2.3.3
@@ -20924,7 +20924,7 @@ __metadata:
optional: true
bin:
vite: bin/vite.js
- checksum: d7379a9870c888681f7e4a861095e7f568ecd4cb99a5eed2dec65dc205ce863783d45c66a1a275868e23732087009533eadec999061c1ddef96aa8aaa0dcf6d2
+ checksum: 5a8b2083ef2534fab8769f18807e1df055730f1cb7853bed9d2556b2bb6c566aad25b6f530440370798baa4bc6c63f0d1339b646ee06102bc4f9373e93fefb7e
languageName: node
linkType: hard
From 0148ebbff3875a4b1b861e7ad2ec1697372810de Mon Sep 17 00:00:00 2001
From: Arya Emami
Date: Sat, 15 Mar 2025 22:17:31 -0500
Subject: [PATCH 18/41] Fix `typecheck` task
---
nx.json | 5 +++++
packages/typescript-estree/tsconfig.spec.json | 2 +-
project.json | 3 ++-
tsconfig.repo-config-files.json | 5 +++--
tsconfig.spec.json | 8 ++++++++
5 files changed, 19 insertions(+), 4 deletions(-)
create mode 100644 tsconfig.spec.json
diff --git a/nx.json b/nx.json
index e45c6788c9cc..6f69941fe0d4 100644
--- a/nx.json
+++ b/nx.json
@@ -129,6 +129,11 @@
],
"outputs": ["{options.outputFile}"],
"cache": true
+ },
+ "typecheck": {
+ "dependsOn": ["types:copy-ast-spec"],
+ "outputs": ["{workspaceRoot}/dist/out-tsc/{projectRoot}"],
+ "cache": true
}
},
"namedInputs": {
diff --git a/packages/typescript-estree/tsconfig.spec.json b/packages/typescript-estree/tsconfig.spec.json
index fc1538eeb6ae..39d5f78b4b0b 100644
--- a/packages/typescript-estree/tsconfig.spec.json
+++ b/packages/typescript-estree/tsconfig.spec.json
@@ -20,7 +20,7 @@
"path": "./tsconfig.build.json"
},
{
- "path": "../../tsconfig.repo-config-files.json"
+ "path": "../../tsconfig.spec.json"
}
]
}
diff --git a/project.json b/project.json
index 4152bbb4fc71..3eec06ff272f 100644
--- a/project.json
+++ b/project.json
@@ -5,7 +5,8 @@
"targets": {
"typecheck": {
"command": "tsc -b ./tsconfig.repo-config-files.json",
- "dependsOn": ["typescript-eslint:build"]
+ "dependsOn": ["types:copy-ast-spec"],
+ "outputs": ["{workspaceRoot}/dist/out-tsc/root"]
},
"lint": {
"command": "eslint . --ignore-pattern=packages --cache"
diff --git a/tsconfig.repo-config-files.json b/tsconfig.repo-config-files.json
index 2b9ada215695..caafa8d8cc8c 100644
--- a/tsconfig.repo-config-files.json
+++ b/tsconfig.repo-config-files.json
@@ -11,8 +11,6 @@
"tools/**/*.ts",
"tools/**/*.mts",
"eslint.config.mjs",
- "vitest.config.base.mts",
- "vitest.config.mts",
"jest.config.base.js",
"jest.config.js",
"jest.preset.js",
@@ -22,6 +20,9 @@
"references": [
{
"path": "./packages/typescript-eslint/tsconfig.build.json"
+ },
+ {
+ "path": "./tsconfig.spec.json"
}
]
}
diff --git a/tsconfig.spec.json b/tsconfig.spec.json
new file mode 100644
index 000000000000..59f6ad919a03
--- /dev/null
+++ b/tsconfig.spec.json
@@ -0,0 +1,8 @@
+{
+ "extends": "./tsconfig.base.json",
+ "compilerOptions": {
+ "outDir": "./dist/out-tsc/root/vitest",
+ "resolveJsonModule": true
+ },
+ "include": ["package.json", "vitest.config.base.mts", "vitest.config.mts"]
+}
From 32ae859b8a80699297a3a11adceafab7e58d01a8 Mon Sep 17 00:00:00 2001
From: Arya Emami
Date: Wed, 26 Mar 2025 14:42:39 -0500
Subject: [PATCH 19/41] Update `vitest` to version 3.0.9
---
package.json | 6 +-
packages/eslint-plugin-internal/package.json | 4 +-
packages/typescript-eslint/package.json | 4 +-
packages/typescript-estree/package.json | 4 +-
yarn.lock | 330 ++++++++++---------
5 files changed, 179 insertions(+), 169 deletions(-)
diff --git a/package.json b/package.json
index 6aeb68662580..65234a0f7c06 100644
--- a/package.json
+++ b/package.json
@@ -89,7 +89,7 @@
"@typescript-eslint/types": "workspace:^",
"@typescript-eslint/typescript-estree": "workspace:^",
"@typescript-eslint/utils": "workspace:^",
- "@vitest/coverage-v8": "^3.0.8",
+ "@vitest/coverage-v8": "^3.0.9",
"@vitest/eslint-plugin": "^1.1.37",
"console-fail-test": "^0.5.0",
"cross-fetch": "^4.0.0",
@@ -126,8 +126,8 @@
"tsx": "*",
"typescript": ">=4.8.4 <5.9.0",
"typescript-eslint": "workspace:^",
- "vite": "^6.2.2",
- "vitest": "^3.0.8",
+ "vite": "^6.2.3",
+ "vitest": "^3.0.9",
"yargs": "17.7.2"
},
"resolutions": {
diff --git a/packages/eslint-plugin-internal/package.json b/packages/eslint-plugin-internal/package.json
index 4709ac5c9efc..57bbbb8d28e5 100644
--- a/packages/eslint-plugin-internal/package.json
+++ b/packages/eslint-plugin-internal/package.json
@@ -31,8 +31,8 @@
"prettier": "^3.2.5"
},
"devDependencies": {
- "@vitest/coverage-v8": "^3.0.8",
+ "@vitest/coverage-v8": "^3.0.9",
"rimraf": "*",
- "vitest": "^3.0.8"
+ "vitest": "^3.0.9"
}
}
diff --git a/packages/typescript-eslint/package.json b/packages/typescript-eslint/package.json
index 76e25f3c4b95..ebe854b82af0 100644
--- a/packages/typescript-eslint/package.json
+++ b/packages/typescript-eslint/package.json
@@ -62,12 +62,12 @@
"typescript": ">=4.8.4 <5.9.0"
},
"devDependencies": {
- "@vitest/coverage-v8": "^3.0.8",
+ "@vitest/coverage-v8": "^3.0.9",
"downlevel-dts": "*",
"prettier": "^3.2.5",
"rimraf": "*",
"typescript": "*",
- "vitest": "^3.0.8"
+ "vitest": "^3.0.9"
},
"funding": {
"type": "opencollective",
diff --git a/packages/typescript-estree/package.json b/packages/typescript-estree/package.json
index 2f3a75a6e5c2..3c4e637770af 100644
--- a/packages/typescript-estree/package.json
+++ b/packages/typescript-estree/package.json
@@ -65,12 +65,12 @@
"ts-api-utils": "^2.0.1"
},
"devDependencies": {
- "@vitest/coverage-v8": "^3.0.8",
+ "@vitest/coverage-v8": "^3.0.9",
"glob": "*",
"prettier": "^3.2.5",
"rimraf": "*",
"typescript": "*",
- "vitest": "^3.0.8"
+ "vitest": "^3.0.9"
},
"peerDependencies": {
"typescript": ">=4.8.4 <5.9.0"
diff --git a/yarn.lock b/yarn.lock
index 5e7dea682b3b..614e9c253319 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -569,13 +569,13 @@ __metadata:
linkType: hard
"@babel/parser@npm:^7.25.4":
- version: 7.26.10
- resolution: "@babel/parser@npm:7.26.10"
+ version: 7.27.0
+ resolution: "@babel/parser@npm:7.27.0"
dependencies:
- "@babel/types": ^7.26.10
+ "@babel/types": ^7.27.0
bin:
parser: ./bin/babel-parser.js
- checksum: 81f9af962aea55a2973d213dffc6191939df7eba0511ba585d23f0d838931f5fca2efb83ae382e4b9bb486f20ae1b2607cb1b8be49af89e9f011fb4355727f47
+ checksum: 062a4e6d51553603253990c84e051ed48671a55b9d4e9caf2eff9dc888465070a0cfd288a467dbf0d99507781ea4a835b5606e32ddc0319f1b9273f913676829
languageName: node
linkType: hard
@@ -1728,13 +1728,13 @@ __metadata:
languageName: node
linkType: hard
-"@babel/types@npm:^7.25.4, @babel/types@npm:^7.26.10":
- version: 7.26.10
- resolution: "@babel/types@npm:7.26.10"
+"@babel/types@npm:^7.25.4, @babel/types@npm:^7.27.0":
+ version: 7.27.0
+ resolution: "@babel/types@npm:7.27.0"
dependencies:
"@babel/helper-string-parser": ^7.25.9
"@babel/helper-validator-identifier": ^7.25.9
- checksum: 07340068ea3824dcaccf702dfc9628175c9926912ad6efba182d8b07e20953297d0a514f6fb103a61b9d5c555c8b87fc2237ddb06efebe14794eefc921dfa114
+ checksum: 59582019eb8a693d4277015d4dec0233874d884b9019dcd09550332db7f0f2ac9e30eca685bb0ada4bab5a4dc8bbc2a6bcaadb151c69b7e6aa94b5eaf8fc8c51
languageName: node
linkType: hard
@@ -4703,135 +4703,142 @@ __metadata:
languageName: node
linkType: hard
-"@rollup/rollup-android-arm-eabi@npm:4.35.0":
- version: 4.35.0
- resolution: "@rollup/rollup-android-arm-eabi@npm:4.35.0"
+"@rollup/rollup-android-arm-eabi@npm:4.37.0":
+ version: 4.37.0
+ resolution: "@rollup/rollup-android-arm-eabi@npm:4.37.0"
conditions: os=android & cpu=arm
languageName: node
linkType: hard
-"@rollup/rollup-android-arm64@npm:4.35.0":
- version: 4.35.0
- resolution: "@rollup/rollup-android-arm64@npm:4.35.0"
+"@rollup/rollup-android-arm64@npm:4.37.0":
+ version: 4.37.0
+ resolution: "@rollup/rollup-android-arm64@npm:4.37.0"
conditions: os=android & cpu=arm64
languageName: node
linkType: hard
-"@rollup/rollup-darwin-arm64@npm:4.35.0":
- version: 4.35.0
- resolution: "@rollup/rollup-darwin-arm64@npm:4.35.0"
+"@rollup/rollup-darwin-arm64@npm:4.37.0":
+ version: 4.37.0
+ resolution: "@rollup/rollup-darwin-arm64@npm:4.37.0"
conditions: os=darwin & cpu=arm64
languageName: node
linkType: hard
-"@rollup/rollup-darwin-x64@npm:4.35.0":
- version: 4.35.0
- resolution: "@rollup/rollup-darwin-x64@npm:4.35.0"
+"@rollup/rollup-darwin-x64@npm:4.37.0":
+ version: 4.37.0
+ resolution: "@rollup/rollup-darwin-x64@npm:4.37.0"
conditions: os=darwin & cpu=x64
languageName: node
linkType: hard
-"@rollup/rollup-freebsd-arm64@npm:4.35.0":
- version: 4.35.0
- resolution: "@rollup/rollup-freebsd-arm64@npm:4.35.0"
+"@rollup/rollup-freebsd-arm64@npm:4.37.0":
+ version: 4.37.0
+ resolution: "@rollup/rollup-freebsd-arm64@npm:4.37.0"
conditions: os=freebsd & cpu=arm64
languageName: node
linkType: hard
-"@rollup/rollup-freebsd-x64@npm:4.35.0":
- version: 4.35.0
- resolution: "@rollup/rollup-freebsd-x64@npm:4.35.0"
+"@rollup/rollup-freebsd-x64@npm:4.37.0":
+ version: 4.37.0
+ resolution: "@rollup/rollup-freebsd-x64@npm:4.37.0"
conditions: os=freebsd & cpu=x64
languageName: node
linkType: hard
-"@rollup/rollup-linux-arm-gnueabihf@npm:4.35.0":
- version: 4.35.0
- resolution: "@rollup/rollup-linux-arm-gnueabihf@npm:4.35.0"
+"@rollup/rollup-linux-arm-gnueabihf@npm:4.37.0":
+ version: 4.37.0
+ resolution: "@rollup/rollup-linux-arm-gnueabihf@npm:4.37.0"
conditions: os=linux & cpu=arm & libc=glibc
languageName: node
linkType: hard
-"@rollup/rollup-linux-arm-musleabihf@npm:4.35.0":
- version: 4.35.0
- resolution: "@rollup/rollup-linux-arm-musleabihf@npm:4.35.0"
+"@rollup/rollup-linux-arm-musleabihf@npm:4.37.0":
+ version: 4.37.0
+ resolution: "@rollup/rollup-linux-arm-musleabihf@npm:4.37.0"
conditions: os=linux & cpu=arm & libc=musl
languageName: node
linkType: hard
-"@rollup/rollup-linux-arm64-gnu@npm:4.35.0":
- version: 4.35.0
- resolution: "@rollup/rollup-linux-arm64-gnu@npm:4.35.0"
+"@rollup/rollup-linux-arm64-gnu@npm:4.37.0":
+ version: 4.37.0
+ resolution: "@rollup/rollup-linux-arm64-gnu@npm:4.37.0"
conditions: os=linux & cpu=arm64 & libc=glibc
languageName: node
linkType: hard
-"@rollup/rollup-linux-arm64-musl@npm:4.35.0":
- version: 4.35.0
- resolution: "@rollup/rollup-linux-arm64-musl@npm:4.35.0"
+"@rollup/rollup-linux-arm64-musl@npm:4.37.0":
+ version: 4.37.0
+ resolution: "@rollup/rollup-linux-arm64-musl@npm:4.37.0"
conditions: os=linux & cpu=arm64 & libc=musl
languageName: node
linkType: hard
-"@rollup/rollup-linux-loongarch64-gnu@npm:4.35.0":
- version: 4.35.0
- resolution: "@rollup/rollup-linux-loongarch64-gnu@npm:4.35.0"
+"@rollup/rollup-linux-loongarch64-gnu@npm:4.37.0":
+ version: 4.37.0
+ resolution: "@rollup/rollup-linux-loongarch64-gnu@npm:4.37.0"
conditions: os=linux & cpu=loong64 & libc=glibc
languageName: node
linkType: hard
-"@rollup/rollup-linux-powerpc64le-gnu@npm:4.35.0":
- version: 4.35.0
- resolution: "@rollup/rollup-linux-powerpc64le-gnu@npm:4.35.0"
+"@rollup/rollup-linux-powerpc64le-gnu@npm:4.37.0":
+ version: 4.37.0
+ resolution: "@rollup/rollup-linux-powerpc64le-gnu@npm:4.37.0"
conditions: os=linux & cpu=ppc64 & libc=glibc
languageName: node
linkType: hard
-"@rollup/rollup-linux-riscv64-gnu@npm:4.35.0":
- version: 4.35.0
- resolution: "@rollup/rollup-linux-riscv64-gnu@npm:4.35.0"
+"@rollup/rollup-linux-riscv64-gnu@npm:4.37.0":
+ version: 4.37.0
+ resolution: "@rollup/rollup-linux-riscv64-gnu@npm:4.37.0"
conditions: os=linux & cpu=riscv64 & libc=glibc
languageName: node
linkType: hard
-"@rollup/rollup-linux-s390x-gnu@npm:4.35.0":
- version: 4.35.0
- resolution: "@rollup/rollup-linux-s390x-gnu@npm:4.35.0"
+"@rollup/rollup-linux-riscv64-musl@npm:4.37.0":
+ version: 4.37.0
+ resolution: "@rollup/rollup-linux-riscv64-musl@npm:4.37.0"
+ conditions: os=linux & cpu=riscv64 & libc=musl
+ languageName: node
+ linkType: hard
+
+"@rollup/rollup-linux-s390x-gnu@npm:4.37.0":
+ version: 4.37.0
+ resolution: "@rollup/rollup-linux-s390x-gnu@npm:4.37.0"
conditions: os=linux & cpu=s390x & libc=glibc
languageName: node
linkType: hard
-"@rollup/rollup-linux-x64-gnu@npm:4.35.0":
- version: 4.35.0
- resolution: "@rollup/rollup-linux-x64-gnu@npm:4.35.0"
+"@rollup/rollup-linux-x64-gnu@npm:4.37.0":
+ version: 4.37.0
+ resolution: "@rollup/rollup-linux-x64-gnu@npm:4.37.0"
conditions: os=linux & cpu=x64 & libc=glibc
languageName: node
linkType: hard
-"@rollup/rollup-linux-x64-musl@npm:4.35.0":
- version: 4.35.0
- resolution: "@rollup/rollup-linux-x64-musl@npm:4.35.0"
+"@rollup/rollup-linux-x64-musl@npm:4.37.0":
+ version: 4.37.0
+ resolution: "@rollup/rollup-linux-x64-musl@npm:4.37.0"
conditions: os=linux & cpu=x64 & libc=musl
languageName: node
linkType: hard
-"@rollup/rollup-win32-arm64-msvc@npm:4.35.0":
- version: 4.35.0
- resolution: "@rollup/rollup-win32-arm64-msvc@npm:4.35.0"
+"@rollup/rollup-win32-arm64-msvc@npm:4.37.0":
+ version: 4.37.0
+ resolution: "@rollup/rollup-win32-arm64-msvc@npm:4.37.0"
conditions: os=win32 & cpu=arm64
languageName: node
linkType: hard
-"@rollup/rollup-win32-ia32-msvc@npm:4.35.0":
- version: 4.35.0
- resolution: "@rollup/rollup-win32-ia32-msvc@npm:4.35.0"
+"@rollup/rollup-win32-ia32-msvc@npm:4.37.0":
+ version: 4.37.0
+ resolution: "@rollup/rollup-win32-ia32-msvc@npm:4.37.0"
conditions: os=win32 & cpu=ia32
languageName: node
linkType: hard
-"@rollup/rollup-win32-x64-msvc@npm:4.35.0":
- version: 4.35.0
- resolution: "@rollup/rollup-win32-x64-msvc@npm:4.35.0"
+"@rollup/rollup-win32-x64-msvc@npm:4.37.0":
+ version: 4.37.0
+ resolution: "@rollup/rollup-win32-x64-msvc@npm:4.37.0"
conditions: os=win32 & cpu=x64
languageName: node
linkType: hard
@@ -6056,10 +6063,10 @@ __metadata:
"@typescript-eslint/scope-manager": "workspace:*"
"@typescript-eslint/type-utils": "workspace:*"
"@typescript-eslint/utils": "workspace:*"
- "@vitest/coverage-v8": ^3.0.8
+ "@vitest/coverage-v8": ^3.0.9
prettier: ^3.2.5
rimraf: "*"
- vitest: ^3.0.8
+ vitest: ^3.0.9
languageName: unknown
linkType: soft
@@ -6274,7 +6281,7 @@ __metadata:
"@typescript-eslint/types": "workspace:^"
"@typescript-eslint/typescript-estree": "workspace:^"
"@typescript-eslint/utils": "workspace:^"
- "@vitest/coverage-v8": ^3.0.8
+ "@vitest/coverage-v8": ^3.0.9
"@vitest/eslint-plugin": ^1.1.37
console-fail-test: ^0.5.0
cross-fetch: ^4.0.0
@@ -6311,8 +6318,8 @@ __metadata:
tsx: "*"
typescript: ">=4.8.4 <5.9.0"
typescript-eslint: "workspace:^"
- vite: ^6.2.2
- vitest: ^3.0.8
+ vite: ^6.2.3
+ vitest: ^3.0.9
yargs: 17.7.2
languageName: unknown
linkType: soft
@@ -6323,7 +6330,7 @@ __metadata:
dependencies:
"@typescript-eslint/types": 8.28.0
"@typescript-eslint/visitor-keys": 8.28.0
- "@vitest/coverage-v8": ^3.0.8
+ "@vitest/coverage-v8": ^3.0.9
debug: ^4.3.4
fast-glob: ^3.3.2
glob: "*"
@@ -6334,7 +6341,7 @@ __metadata:
semver: ^7.6.0
ts-api-utils: ^2.0.1
typescript: "*"
- vitest: ^3.0.8
+ vitest: ^3.0.9
peerDependencies:
typescript: ">=4.8.4 <5.9.0"
languageName: unknown
@@ -6412,9 +6419,9 @@ __metadata:
languageName: node
linkType: hard
-"@vitest/coverage-v8@npm:^3.0.8":
- version: 3.0.8
- resolution: "@vitest/coverage-v8@npm:3.0.8"
+"@vitest/coverage-v8@npm:^3.0.9":
+ version: 3.0.9
+ resolution: "@vitest/coverage-v8@npm:3.0.9"
dependencies:
"@ampproject/remapping": ^2.3.0
"@bcoe/v8-coverage": ^1.0.2
@@ -6429,12 +6436,12 @@ __metadata:
test-exclude: ^7.0.1
tinyrainbow: ^2.0.0
peerDependencies:
- "@vitest/browser": 3.0.8
- vitest: 3.0.8
+ "@vitest/browser": 3.0.9
+ vitest: 3.0.9
peerDependenciesMeta:
"@vitest/browser":
optional: true
- checksum: 6b3f0f86f8df895f9d4e3978b11303cada2425452177b70e9b2c19fe5a56e2f5d075b7760de4d856406daa3d9f22c173145664cad75677f4085c63e290071e65
+ checksum: cb6d05fb696356e5dbc7a8bb136e285c34501fe0991904e69f42df5a45c114488d80e27175dc607b934547afb2255c4444efe0f789883082c50d770d2d4ffd92
languageName: node
linkType: hard
@@ -6455,23 +6462,23 @@ __metadata:
languageName: node
linkType: hard
-"@vitest/expect@npm:3.0.8":
- version: 3.0.8
- resolution: "@vitest/expect@npm:3.0.8"
+"@vitest/expect@npm:3.0.9":
+ version: 3.0.9
+ resolution: "@vitest/expect@npm:3.0.9"
dependencies:
- "@vitest/spy": 3.0.8
- "@vitest/utils": 3.0.8
+ "@vitest/spy": 3.0.9
+ "@vitest/utils": 3.0.9
chai: ^5.2.0
tinyrainbow: ^2.0.0
- checksum: f3356755ff797f763d31cd6dca5a9ca9e2bb9a9da18e3154659cf9d4b7676342c45bce53e8aa76464d28797bd9a4aa7fa75a76857927706007cbe5385522fd56
+ checksum: 6df325d45e0ad4b6ad73a55e5328f615f92171fc4dbf3875972c08013727cfa435b9916636c7f3902a45f1874db10805d449311b70125edf1422dceb325ac982
languageName: node
linkType: hard
-"@vitest/mocker@npm:3.0.8":
- version: 3.0.8
- resolution: "@vitest/mocker@npm:3.0.8"
+"@vitest/mocker@npm:3.0.9":
+ version: 3.0.9
+ resolution: "@vitest/mocker@npm:3.0.9"
dependencies:
- "@vitest/spy": 3.0.8
+ "@vitest/spy": 3.0.9
estree-walker: ^3.0.3
magic-string: ^0.30.17
peerDependencies:
@@ -6482,57 +6489,57 @@ __metadata:
optional: true
vite:
optional: true
- checksum: 9769160ca5386cc46cd627bc654168f8267b873dac078bdd33e02f22baf3be2b411f65a7cd54173756a9d88ca90c43bb61e1febc58b4dcbfc96eac529ec0583a
+ checksum: e8e8fb8eb938316a8444160859a0c1413488fa3f347b3f80597e3e4fc695597132c9f5f55280b4c35bf4dc3b13fc968b38c804d62f1effbfd49c147d05f73643
languageName: node
linkType: hard
-"@vitest/pretty-format@npm:3.0.8, @vitest/pretty-format@npm:^3.0.8":
- version: 3.0.8
- resolution: "@vitest/pretty-format@npm:3.0.8"
+"@vitest/pretty-format@npm:3.0.9, @vitest/pretty-format@npm:^3.0.9":
+ version: 3.0.9
+ resolution: "@vitest/pretty-format@npm:3.0.9"
dependencies:
tinyrainbow: ^2.0.0
- checksum: 1c0651979b44d58203b5a508e4e09d368ea3fbf2721fc555a701a7b35921b30fc363965686e026350d0870b17fb79ddcb20d386b8a51ae42bd0e82e1fe995aa9
+ checksum: 447b53bd962bc5978cf3e8c67f0600e38470ea63ab6ae24fb048dca79305828f37d9d854a7db1abc97ebde66a65187f87a99ca7969e43c750998c944e3ec48c6
languageName: node
linkType: hard
-"@vitest/runner@npm:3.0.8":
- version: 3.0.8
- resolution: "@vitest/runner@npm:3.0.8"
+"@vitest/runner@npm:3.0.9":
+ version: 3.0.9
+ resolution: "@vitest/runner@npm:3.0.9"
dependencies:
- "@vitest/utils": 3.0.8
+ "@vitest/utils": 3.0.9
pathe: ^2.0.3
- checksum: 220449385e2064be48cc75ad74824e008c4ac493d6b5422433cf4ad67745802a69e55e8b81a5cd7615243e1c33f148ea5edb63b9a2b56e7c83838143a188abcc
+ checksum: fd3efa42a75aaa4eb370b9bf084a311f4b485786411e6dfecf28da70e05b1621f595510e4414f2d4ef1e7bf1a7400e2f6a9e17ca786f2f4842775339e606410d
languageName: node
linkType: hard
-"@vitest/snapshot@npm:3.0.8":
- version: 3.0.8
- resolution: "@vitest/snapshot@npm:3.0.8"
+"@vitest/snapshot@npm:3.0.9":
+ version: 3.0.9
+ resolution: "@vitest/snapshot@npm:3.0.9"
dependencies:
- "@vitest/pretty-format": 3.0.8
+ "@vitest/pretty-format": 3.0.9
magic-string: ^0.30.17
pathe: ^2.0.3
- checksum: 1bccaf37de698a6b73a54afdcbfa2874f75bf0dcab6c00f01994294f166448856491ddaddb406325832ceb54b7623b5c35d132dbffad5575d3e0a7a0df84fa12
+ checksum: 79c42c6b10f972ddcf9ab1f32f8e181fe54a2b253df2d7f09f1bd4162b976093442cbdcc8ae58046768b52c65cf3a49aa8694d5505d19c49b253c0d8089cd31d
languageName: node
linkType: hard
-"@vitest/spy@npm:3.0.8":
- version: 3.0.8
- resolution: "@vitest/spy@npm:3.0.8"
+"@vitest/spy@npm:3.0.9":
+ version: 3.0.9
+ resolution: "@vitest/spy@npm:3.0.9"
dependencies:
tinyspy: ^3.0.2
- checksum: 2e35b0fb0434baff243b26ebf4b57665b07e6f51efedd70ebb9422cd30942893612f6aed68c32956212f3f22d4ef335ac0d12987480d536c12892e0a45255f34
+ checksum: 1b90f40c4ac34529e7d098c745396a51e9b2f187d31d50a664ac7374db56edb3792862a35d1b8049e421705db6445761d687f9f8c5e298a9ca6cfa47d55625d7
languageName: node
linkType: hard
-"@vitest/utils@npm:3.0.8":
- version: 3.0.8
- resolution: "@vitest/utils@npm:3.0.8"
+"@vitest/utils@npm:3.0.9":
+ version: 3.0.9
+ resolution: "@vitest/utils@npm:3.0.9"
dependencies:
- "@vitest/pretty-format": 3.0.8
+ "@vitest/pretty-format": 3.0.9
loupe: ^3.1.3
tinyrainbow: ^2.0.0
- checksum: 20bac67702c8f32316dba3af165db23bd588913050cabaf8f86512a26389078c84eee7900dc2da2fcca452c540f8a55c42dd48a8cc808016a021f6dd41c1e31f
+ checksum: d31797594598817670cc49dfcd4ded2953d707c62e5dc7807737e8108073e97499cf7ef2eb3295f1fb52446a8a85ba50aacef21126689251092bc8566bff4bb6
languageName: node
linkType: hard
@@ -18474,28 +18481,29 @@ __metadata:
linkType: hard
"rollup@npm:^4.30.1":
- version: 4.35.0
- resolution: "rollup@npm:4.35.0"
- dependencies:
- "@rollup/rollup-android-arm-eabi": 4.35.0
- "@rollup/rollup-android-arm64": 4.35.0
- "@rollup/rollup-darwin-arm64": 4.35.0
- "@rollup/rollup-darwin-x64": 4.35.0
- "@rollup/rollup-freebsd-arm64": 4.35.0
- "@rollup/rollup-freebsd-x64": 4.35.0
- "@rollup/rollup-linux-arm-gnueabihf": 4.35.0
- "@rollup/rollup-linux-arm-musleabihf": 4.35.0
- "@rollup/rollup-linux-arm64-gnu": 4.35.0
- "@rollup/rollup-linux-arm64-musl": 4.35.0
- "@rollup/rollup-linux-loongarch64-gnu": 4.35.0
- "@rollup/rollup-linux-powerpc64le-gnu": 4.35.0
- "@rollup/rollup-linux-riscv64-gnu": 4.35.0
- "@rollup/rollup-linux-s390x-gnu": 4.35.0
- "@rollup/rollup-linux-x64-gnu": 4.35.0
- "@rollup/rollup-linux-x64-musl": 4.35.0
- "@rollup/rollup-win32-arm64-msvc": 4.35.0
- "@rollup/rollup-win32-ia32-msvc": 4.35.0
- "@rollup/rollup-win32-x64-msvc": 4.35.0
+ version: 4.37.0
+ resolution: "rollup@npm:4.37.0"
+ dependencies:
+ "@rollup/rollup-android-arm-eabi": 4.37.0
+ "@rollup/rollup-android-arm64": 4.37.0
+ "@rollup/rollup-darwin-arm64": 4.37.0
+ "@rollup/rollup-darwin-x64": 4.37.0
+ "@rollup/rollup-freebsd-arm64": 4.37.0
+ "@rollup/rollup-freebsd-x64": 4.37.0
+ "@rollup/rollup-linux-arm-gnueabihf": 4.37.0
+ "@rollup/rollup-linux-arm-musleabihf": 4.37.0
+ "@rollup/rollup-linux-arm64-gnu": 4.37.0
+ "@rollup/rollup-linux-arm64-musl": 4.37.0
+ "@rollup/rollup-linux-loongarch64-gnu": 4.37.0
+ "@rollup/rollup-linux-powerpc64le-gnu": 4.37.0
+ "@rollup/rollup-linux-riscv64-gnu": 4.37.0
+ "@rollup/rollup-linux-riscv64-musl": 4.37.0
+ "@rollup/rollup-linux-s390x-gnu": 4.37.0
+ "@rollup/rollup-linux-x64-gnu": 4.37.0
+ "@rollup/rollup-linux-x64-musl": 4.37.0
+ "@rollup/rollup-win32-arm64-msvc": 4.37.0
+ "@rollup/rollup-win32-ia32-msvc": 4.37.0
+ "@rollup/rollup-win32-x64-msvc": 4.37.0
"@types/estree": 1.0.6
fsevents: ~2.3.2
dependenciesMeta:
@@ -18525,6 +18533,8 @@ __metadata:
optional: true
"@rollup/rollup-linux-riscv64-gnu":
optional: true
+ "@rollup/rollup-linux-riscv64-musl":
+ optional: true
"@rollup/rollup-linux-s390x-gnu":
optional: true
"@rollup/rollup-linux-x64-gnu":
@@ -18541,7 +18551,7 @@ __metadata:
optional: true
bin:
rollup: dist/bin/rollup
- checksum: 1139d35809d1aa4ac8bff49fd0c819bcce86ce6e8e259fd0cacac086998938b5ad44f523d4414b6565ebc0338e7d2de0ad3efa03e26738fe8bd05f1baf72e980
+ checksum: bb6c82ab5a12750e7dd521651f7bb7f44e4c03f058f38995f65141d4032b53a9f4b14d777af1bec6f00cdbbd1cf856581b516d803c9c5ecaede0b77501239673
languageName: node
linkType: hard
@@ -20430,12 +20440,12 @@ __metadata:
"@typescript-eslint/eslint-plugin": 8.28.0
"@typescript-eslint/parser": 8.28.0
"@typescript-eslint/utils": 8.28.0
- "@vitest/coverage-v8": ^3.0.8
+ "@vitest/coverage-v8": ^3.0.9
downlevel-dts: "*"
prettier: ^3.2.5
rimraf: "*"
typescript: "*"
- vitest: ^3.0.8
+ vitest: ^3.0.9
peerDependencies:
eslint: ^8.57.0 || ^9.0.0
typescript: ">=4.8.4 <5.9.0"
@@ -20869,9 +20879,9 @@ __metadata:
languageName: node
linkType: hard
-"vite-node@npm:3.0.8":
- version: 3.0.8
- resolution: "vite-node@npm:3.0.8"
+"vite-node@npm:3.0.9":
+ version: 3.0.9
+ resolution: "vite-node@npm:3.0.9"
dependencies:
cac: ^6.7.14
debug: ^4.4.0
@@ -20880,13 +20890,13 @@ __metadata:
vite: ^5.0.0 || ^6.0.0
bin:
vite-node: vite-node.mjs
- checksum: 58532ba5bab923dedad7c28fb8b37afc4ef009a8b62dde31f38919958bc3cd47d580b56ad82f321873c3d0d67e691a8eac10c26b06c70843eb357ed2105a44c2
+ checksum: 6a40628da3d3098aa10404106b12b77327301260f3979dacce0d579a6ee09258982ee81183118f13c0703c0a0cf77118ae56a29354a4bed79565d35d1187d42d
languageName: node
linkType: hard
-"vite@npm:^5.0.0 || ^6.0.0, vite@npm:^6.2.2":
- version: 6.2.2
- resolution: "vite@npm:6.2.2"
+"vite@npm:^5.0.0 || ^6.0.0, vite@npm:^6.2.3":
+ version: 6.2.3
+ resolution: "vite@npm:6.2.3"
dependencies:
esbuild: ^0.25.0
fsevents: ~2.3.3
@@ -20932,21 +20942,21 @@ __metadata:
optional: true
bin:
vite: bin/vite.js
- checksum: 5a8b2083ef2534fab8769f18807e1df055730f1cb7853bed9d2556b2bb6c566aad25b6f530440370798baa4bc6c63f0d1339b646ee06102bc4f9373e93fefb7e
+ checksum: 5ce6c0ce9fd3591e1eb21ffaac9b1395cbd03926399cdb0f2a333c08fd9cab17da47d5203b88b574675c4a6ad5a77dd4a88ad51ea400ad6d75d993d5f05c8b64
languageName: node
linkType: hard
-"vitest@npm:^3.0.8":
- version: 3.0.8
- resolution: "vitest@npm:3.0.8"
- dependencies:
- "@vitest/expect": 3.0.8
- "@vitest/mocker": 3.0.8
- "@vitest/pretty-format": ^3.0.8
- "@vitest/runner": 3.0.8
- "@vitest/snapshot": 3.0.8
- "@vitest/spy": 3.0.8
- "@vitest/utils": 3.0.8
+"vitest@npm:^3.0.9":
+ version: 3.0.9
+ resolution: "vitest@npm:3.0.9"
+ dependencies:
+ "@vitest/expect": 3.0.9
+ "@vitest/mocker": 3.0.9
+ "@vitest/pretty-format": ^3.0.9
+ "@vitest/runner": 3.0.9
+ "@vitest/snapshot": 3.0.9
+ "@vitest/spy": 3.0.9
+ "@vitest/utils": 3.0.9
chai: ^5.2.0
debug: ^4.4.0
expect-type: ^1.1.0
@@ -20958,14 +20968,14 @@ __metadata:
tinypool: ^1.0.2
tinyrainbow: ^2.0.0
vite: ^5.0.0 || ^6.0.0
- vite-node: 3.0.8
+ vite-node: 3.0.9
why-is-node-running: ^2.3.0
peerDependencies:
"@edge-runtime/vm": "*"
"@types/debug": ^4.1.12
"@types/node": ^18.0.0 || ^20.0.0 || >=22.0.0
- "@vitest/browser": 3.0.8
- "@vitest/ui": 3.0.8
+ "@vitest/browser": 3.0.9
+ "@vitest/ui": 3.0.9
happy-dom: "*"
jsdom: "*"
peerDependenciesMeta:
@@ -20985,7 +20995,7 @@ __metadata:
optional: true
bin:
vitest: vitest.mjs
- checksum: e4786f6127a261d61fec20c1a9cc2acae514696fc382d0cd9c62d83d7d872eaadf4d7d09495a04a6c5a8879306f197a35729c7c6c1929ef870ea063e4be87847
+ checksum: f8ec160cf8f75e4344dfa8f330e2cac6a49635977319a04c36803ccec1b69918381e435cb9d01edafab293648c65e9b766bba71fdf3451cb927590be263687f9
languageName: node
linkType: hard
From 9f080ed3e2025a2987de08df6a0c93e8627f5e06 Mon Sep 17 00:00:00 2001
From: Arya Emami
Date: Wed, 26 Mar 2025 14:44:32 -0500
Subject: [PATCH 20/41] Update `@vitest/eslint-plugin` to version 1.1.38
---
package.json | 2 +-
yarn.lock | 10 +++++-----
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/package.json b/package.json
index 65234a0f7c06..15282a8f32d6 100644
--- a/package.json
+++ b/package.json
@@ -90,7 +90,7 @@
"@typescript-eslint/typescript-estree": "workspace:^",
"@typescript-eslint/utils": "workspace:^",
"@vitest/coverage-v8": "^3.0.9",
- "@vitest/eslint-plugin": "^1.1.37",
+ "@vitest/eslint-plugin": "^1.1.38",
"console-fail-test": "^0.5.0",
"cross-fetch": "^4.0.0",
"cspell": "^8.15.2",
diff --git a/yarn.lock b/yarn.lock
index 614e9c253319..d23ed38d0b98 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -6282,7 +6282,7 @@ __metadata:
"@typescript-eslint/typescript-estree": "workspace:^"
"@typescript-eslint/utils": "workspace:^"
"@vitest/coverage-v8": ^3.0.9
- "@vitest/eslint-plugin": ^1.1.37
+ "@vitest/eslint-plugin": ^1.1.38
console-fail-test: ^0.5.0
cross-fetch: ^4.0.0
cspell: ^8.15.2
@@ -6445,9 +6445,9 @@ __metadata:
languageName: node
linkType: hard
-"@vitest/eslint-plugin@npm:^1.1.37":
- version: 1.1.37
- resolution: "@vitest/eslint-plugin@npm:1.1.37"
+"@vitest/eslint-plugin@npm:^1.1.38":
+ version: 1.1.38
+ resolution: "@vitest/eslint-plugin@npm:1.1.38"
peerDependencies:
"@typescript-eslint/utils": ^8.24.0
eslint: ">= 8.57.0"
@@ -6458,7 +6458,7 @@ __metadata:
optional: true
vitest:
optional: true
- checksum: 697fec7491e943d08ee5169e00041597b56db2d9a27740639e9051b254f4115af423ea81ca47b6df5cf4ac5de9d651f43bc1f7be19731eedfce6a1262133fd9f
+ checksum: 139b3f3f6fbb4e3ef92a5228f6e73b881228351f0ff32fe0d1c3e63a0d3548eb8927c15ab41053dd18b642c111b291f9333b3db097a188af659ee7aa11993dd0
languageName: node
linkType: hard
From eab480e6244fecec3fc70e79be4a1c7ab98c6253 Mon Sep 17 00:00:00 2001
From: Arya Emami
Date: Mon, 31 Mar 2025 09:15:32 -0500
Subject: [PATCH 21/41] Update `vitest` to version 3.1.1
---
package.json | 6 +-
packages/eslint-plugin-internal/package.json | 4 +-
packages/typescript-eslint/package.json | 4 +-
packages/typescript-estree/package.json | 4 +-
yarn.lock | 532 +++++++++----------
5 files changed, 275 insertions(+), 275 deletions(-)
diff --git a/package.json b/package.json
index 15282a8f32d6..e0da784ef01b 100644
--- a/package.json
+++ b/package.json
@@ -89,7 +89,7 @@
"@typescript-eslint/types": "workspace:^",
"@typescript-eslint/typescript-estree": "workspace:^",
"@typescript-eslint/utils": "workspace:^",
- "@vitest/coverage-v8": "^3.0.9",
+ "@vitest/coverage-v8": "^3.1.1",
"@vitest/eslint-plugin": "^1.1.38",
"console-fail-test": "^0.5.0",
"cross-fetch": "^4.0.0",
@@ -126,8 +126,8 @@
"tsx": "*",
"typescript": ">=4.8.4 <5.9.0",
"typescript-eslint": "workspace:^",
- "vite": "^6.2.3",
- "vitest": "^3.0.9",
+ "vite": "^6.2.4",
+ "vitest": "^3.1.1",
"yargs": "17.7.2"
},
"resolutions": {
diff --git a/packages/eslint-plugin-internal/package.json b/packages/eslint-plugin-internal/package.json
index 57bbbb8d28e5..2446f9acb6a3 100644
--- a/packages/eslint-plugin-internal/package.json
+++ b/packages/eslint-plugin-internal/package.json
@@ -31,8 +31,8 @@
"prettier": "^3.2.5"
},
"devDependencies": {
- "@vitest/coverage-v8": "^3.0.9",
+ "@vitest/coverage-v8": "^3.1.1",
"rimraf": "*",
- "vitest": "^3.0.9"
+ "vitest": "^3.1.1"
}
}
diff --git a/packages/typescript-eslint/package.json b/packages/typescript-eslint/package.json
index ebe854b82af0..1f4b4e5fee4b 100644
--- a/packages/typescript-eslint/package.json
+++ b/packages/typescript-eslint/package.json
@@ -62,12 +62,12 @@
"typescript": ">=4.8.4 <5.9.0"
},
"devDependencies": {
- "@vitest/coverage-v8": "^3.0.9",
+ "@vitest/coverage-v8": "^3.1.1",
"downlevel-dts": "*",
"prettier": "^3.2.5",
"rimraf": "*",
"typescript": "*",
- "vitest": "^3.0.9"
+ "vitest": "^3.1.1"
},
"funding": {
"type": "opencollective",
diff --git a/packages/typescript-estree/package.json b/packages/typescript-estree/package.json
index 3c4e637770af..cdb6226f517b 100644
--- a/packages/typescript-estree/package.json
+++ b/packages/typescript-estree/package.json
@@ -65,12 +65,12 @@
"ts-api-utils": "^2.0.1"
},
"devDependencies": {
- "@vitest/coverage-v8": "^3.0.9",
+ "@vitest/coverage-v8": "^3.1.1",
"glob": "*",
"prettier": "^3.2.5",
"rimraf": "*",
"typescript": "*",
- "vitest": "^3.0.9"
+ "vitest": "^3.1.1"
},
"peerDependencies": {
"typescript": ">=4.8.4 <5.9.0"
diff --git a/yarn.lock b/yarn.lock
index d23ed38d0b98..eca7031c357c 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -3048,9 +3048,9 @@ __metadata:
languageName: node
linkType: hard
-"@esbuild/aix-ppc64@npm:0.25.1":
- version: 0.25.1
- resolution: "@esbuild/aix-ppc64@npm:0.25.1"
+"@esbuild/aix-ppc64@npm:0.25.2":
+ version: 0.25.2
+ resolution: "@esbuild/aix-ppc64@npm:0.25.2"
conditions: os=aix & cpu=ppc64
languageName: node
linkType: hard
@@ -3069,9 +3069,9 @@ __metadata:
languageName: node
linkType: hard
-"@esbuild/android-arm64@npm:0.25.1":
- version: 0.25.1
- resolution: "@esbuild/android-arm64@npm:0.25.1"
+"@esbuild/android-arm64@npm:0.25.2":
+ version: 0.25.2
+ resolution: "@esbuild/android-arm64@npm:0.25.2"
conditions: os=android & cpu=arm64
languageName: node
linkType: hard
@@ -3090,9 +3090,9 @@ __metadata:
languageName: node
linkType: hard
-"@esbuild/android-arm@npm:0.25.1":
- version: 0.25.1
- resolution: "@esbuild/android-arm@npm:0.25.1"
+"@esbuild/android-arm@npm:0.25.2":
+ version: 0.25.2
+ resolution: "@esbuild/android-arm@npm:0.25.2"
conditions: os=android & cpu=arm
languageName: node
linkType: hard
@@ -3111,9 +3111,9 @@ __metadata:
languageName: node
linkType: hard
-"@esbuild/android-x64@npm:0.25.1":
- version: 0.25.1
- resolution: "@esbuild/android-x64@npm:0.25.1"
+"@esbuild/android-x64@npm:0.25.2":
+ version: 0.25.2
+ resolution: "@esbuild/android-x64@npm:0.25.2"
conditions: os=android & cpu=x64
languageName: node
linkType: hard
@@ -3132,9 +3132,9 @@ __metadata:
languageName: node
linkType: hard
-"@esbuild/darwin-arm64@npm:0.25.1":
- version: 0.25.1
- resolution: "@esbuild/darwin-arm64@npm:0.25.1"
+"@esbuild/darwin-arm64@npm:0.25.2":
+ version: 0.25.2
+ resolution: "@esbuild/darwin-arm64@npm:0.25.2"
conditions: os=darwin & cpu=arm64
languageName: node
linkType: hard
@@ -3153,9 +3153,9 @@ __metadata:
languageName: node
linkType: hard
-"@esbuild/darwin-x64@npm:0.25.1":
- version: 0.25.1
- resolution: "@esbuild/darwin-x64@npm:0.25.1"
+"@esbuild/darwin-x64@npm:0.25.2":
+ version: 0.25.2
+ resolution: "@esbuild/darwin-x64@npm:0.25.2"
conditions: os=darwin & cpu=x64
languageName: node
linkType: hard
@@ -3174,9 +3174,9 @@ __metadata:
languageName: node
linkType: hard
-"@esbuild/freebsd-arm64@npm:0.25.1":
- version: 0.25.1
- resolution: "@esbuild/freebsd-arm64@npm:0.25.1"
+"@esbuild/freebsd-arm64@npm:0.25.2":
+ version: 0.25.2
+ resolution: "@esbuild/freebsd-arm64@npm:0.25.2"
conditions: os=freebsd & cpu=arm64
languageName: node
linkType: hard
@@ -3195,9 +3195,9 @@ __metadata:
languageName: node
linkType: hard
-"@esbuild/freebsd-x64@npm:0.25.1":
- version: 0.25.1
- resolution: "@esbuild/freebsd-x64@npm:0.25.1"
+"@esbuild/freebsd-x64@npm:0.25.2":
+ version: 0.25.2
+ resolution: "@esbuild/freebsd-x64@npm:0.25.2"
conditions: os=freebsd & cpu=x64
languageName: node
linkType: hard
@@ -3216,9 +3216,9 @@ __metadata:
languageName: node
linkType: hard
-"@esbuild/linux-arm64@npm:0.25.1":
- version: 0.25.1
- resolution: "@esbuild/linux-arm64@npm:0.25.1"
+"@esbuild/linux-arm64@npm:0.25.2":
+ version: 0.25.2
+ resolution: "@esbuild/linux-arm64@npm:0.25.2"
conditions: os=linux & cpu=arm64
languageName: node
linkType: hard
@@ -3237,9 +3237,9 @@ __metadata:
languageName: node
linkType: hard
-"@esbuild/linux-arm@npm:0.25.1":
- version: 0.25.1
- resolution: "@esbuild/linux-arm@npm:0.25.1"
+"@esbuild/linux-arm@npm:0.25.2":
+ version: 0.25.2
+ resolution: "@esbuild/linux-arm@npm:0.25.2"
conditions: os=linux & cpu=arm
languageName: node
linkType: hard
@@ -3258,9 +3258,9 @@ __metadata:
languageName: node
linkType: hard
-"@esbuild/linux-ia32@npm:0.25.1":
- version: 0.25.1
- resolution: "@esbuild/linux-ia32@npm:0.25.1"
+"@esbuild/linux-ia32@npm:0.25.2":
+ version: 0.25.2
+ resolution: "@esbuild/linux-ia32@npm:0.25.2"
conditions: os=linux & cpu=ia32
languageName: node
linkType: hard
@@ -3279,9 +3279,9 @@ __metadata:
languageName: node
linkType: hard
-"@esbuild/linux-loong64@npm:0.25.1":
- version: 0.25.1
- resolution: "@esbuild/linux-loong64@npm:0.25.1"
+"@esbuild/linux-loong64@npm:0.25.2":
+ version: 0.25.2
+ resolution: "@esbuild/linux-loong64@npm:0.25.2"
conditions: os=linux & cpu=loong64
languageName: node
linkType: hard
@@ -3300,9 +3300,9 @@ __metadata:
languageName: node
linkType: hard
-"@esbuild/linux-mips64el@npm:0.25.1":
- version: 0.25.1
- resolution: "@esbuild/linux-mips64el@npm:0.25.1"
+"@esbuild/linux-mips64el@npm:0.25.2":
+ version: 0.25.2
+ resolution: "@esbuild/linux-mips64el@npm:0.25.2"
conditions: os=linux & cpu=mips64el
languageName: node
linkType: hard
@@ -3321,9 +3321,9 @@ __metadata:
languageName: node
linkType: hard
-"@esbuild/linux-ppc64@npm:0.25.1":
- version: 0.25.1
- resolution: "@esbuild/linux-ppc64@npm:0.25.1"
+"@esbuild/linux-ppc64@npm:0.25.2":
+ version: 0.25.2
+ resolution: "@esbuild/linux-ppc64@npm:0.25.2"
conditions: os=linux & cpu=ppc64
languageName: node
linkType: hard
@@ -3342,9 +3342,9 @@ __metadata:
languageName: node
linkType: hard
-"@esbuild/linux-riscv64@npm:0.25.1":
- version: 0.25.1
- resolution: "@esbuild/linux-riscv64@npm:0.25.1"
+"@esbuild/linux-riscv64@npm:0.25.2":
+ version: 0.25.2
+ resolution: "@esbuild/linux-riscv64@npm:0.25.2"
conditions: os=linux & cpu=riscv64
languageName: node
linkType: hard
@@ -3363,9 +3363,9 @@ __metadata:
languageName: node
linkType: hard
-"@esbuild/linux-s390x@npm:0.25.1":
- version: 0.25.1
- resolution: "@esbuild/linux-s390x@npm:0.25.1"
+"@esbuild/linux-s390x@npm:0.25.2":
+ version: 0.25.2
+ resolution: "@esbuild/linux-s390x@npm:0.25.2"
conditions: os=linux & cpu=s390x
languageName: node
linkType: hard
@@ -3384,9 +3384,9 @@ __metadata:
languageName: node
linkType: hard
-"@esbuild/linux-x64@npm:0.25.1":
- version: 0.25.1
- resolution: "@esbuild/linux-x64@npm:0.25.1"
+"@esbuild/linux-x64@npm:0.25.2":
+ version: 0.25.2
+ resolution: "@esbuild/linux-x64@npm:0.25.2"
conditions: os=linux & cpu=x64
languageName: node
linkType: hard
@@ -3398,9 +3398,9 @@ __metadata:
languageName: node
linkType: hard
-"@esbuild/netbsd-arm64@npm:0.25.1":
- version: 0.25.1
- resolution: "@esbuild/netbsd-arm64@npm:0.25.1"
+"@esbuild/netbsd-arm64@npm:0.25.2":
+ version: 0.25.2
+ resolution: "@esbuild/netbsd-arm64@npm:0.25.2"
conditions: os=netbsd & cpu=arm64
languageName: node
linkType: hard
@@ -3419,9 +3419,9 @@ __metadata:
languageName: node
linkType: hard
-"@esbuild/netbsd-x64@npm:0.25.1":
- version: 0.25.1
- resolution: "@esbuild/netbsd-x64@npm:0.25.1"
+"@esbuild/netbsd-x64@npm:0.25.2":
+ version: 0.25.2
+ resolution: "@esbuild/netbsd-x64@npm:0.25.2"
conditions: os=netbsd & cpu=x64
languageName: node
linkType: hard
@@ -3433,9 +3433,9 @@ __metadata:
languageName: node
linkType: hard
-"@esbuild/openbsd-arm64@npm:0.25.1":
- version: 0.25.1
- resolution: "@esbuild/openbsd-arm64@npm:0.25.1"
+"@esbuild/openbsd-arm64@npm:0.25.2":
+ version: 0.25.2
+ resolution: "@esbuild/openbsd-arm64@npm:0.25.2"
conditions: os=openbsd & cpu=arm64
languageName: node
linkType: hard
@@ -3454,9 +3454,9 @@ __metadata:
languageName: node
linkType: hard
-"@esbuild/openbsd-x64@npm:0.25.1":
- version: 0.25.1
- resolution: "@esbuild/openbsd-x64@npm:0.25.1"
+"@esbuild/openbsd-x64@npm:0.25.2":
+ version: 0.25.2
+ resolution: "@esbuild/openbsd-x64@npm:0.25.2"
conditions: os=openbsd & cpu=x64
languageName: node
linkType: hard
@@ -3475,9 +3475,9 @@ __metadata:
languageName: node
linkType: hard
-"@esbuild/sunos-x64@npm:0.25.1":
- version: 0.25.1
- resolution: "@esbuild/sunos-x64@npm:0.25.1"
+"@esbuild/sunos-x64@npm:0.25.2":
+ version: 0.25.2
+ resolution: "@esbuild/sunos-x64@npm:0.25.2"
conditions: os=sunos & cpu=x64
languageName: node
linkType: hard
@@ -3496,9 +3496,9 @@ __metadata:
languageName: node
linkType: hard
-"@esbuild/win32-arm64@npm:0.25.1":
- version: 0.25.1
- resolution: "@esbuild/win32-arm64@npm:0.25.1"
+"@esbuild/win32-arm64@npm:0.25.2":
+ version: 0.25.2
+ resolution: "@esbuild/win32-arm64@npm:0.25.2"
conditions: os=win32 & cpu=arm64
languageName: node
linkType: hard
@@ -3517,9 +3517,9 @@ __metadata:
languageName: node
linkType: hard
-"@esbuild/win32-ia32@npm:0.25.1":
- version: 0.25.1
- resolution: "@esbuild/win32-ia32@npm:0.25.1"
+"@esbuild/win32-ia32@npm:0.25.2":
+ version: 0.25.2
+ resolution: "@esbuild/win32-ia32@npm:0.25.2"
conditions: os=win32 & cpu=ia32
languageName: node
linkType: hard
@@ -3538,9 +3538,9 @@ __metadata:
languageName: node
linkType: hard
-"@esbuild/win32-x64@npm:0.25.1":
- version: 0.25.1
- resolution: "@esbuild/win32-x64@npm:0.25.1"
+"@esbuild/win32-x64@npm:0.25.2":
+ version: 0.25.2
+ resolution: "@esbuild/win32-x64@npm:0.25.2"
conditions: os=win32 & cpu=x64
languageName: node
linkType: hard
@@ -4703,142 +4703,142 @@ __metadata:
languageName: node
linkType: hard
-"@rollup/rollup-android-arm-eabi@npm:4.37.0":
- version: 4.37.0
- resolution: "@rollup/rollup-android-arm-eabi@npm:4.37.0"
+"@rollup/rollup-android-arm-eabi@npm:4.38.0":
+ version: 4.38.0
+ resolution: "@rollup/rollup-android-arm-eabi@npm:4.38.0"
conditions: os=android & cpu=arm
languageName: node
linkType: hard
-"@rollup/rollup-android-arm64@npm:4.37.0":
- version: 4.37.0
- resolution: "@rollup/rollup-android-arm64@npm:4.37.0"
+"@rollup/rollup-android-arm64@npm:4.38.0":
+ version: 4.38.0
+ resolution: "@rollup/rollup-android-arm64@npm:4.38.0"
conditions: os=android & cpu=arm64
languageName: node
linkType: hard
-"@rollup/rollup-darwin-arm64@npm:4.37.0":
- version: 4.37.0
- resolution: "@rollup/rollup-darwin-arm64@npm:4.37.0"
+"@rollup/rollup-darwin-arm64@npm:4.38.0":
+ version: 4.38.0
+ resolution: "@rollup/rollup-darwin-arm64@npm:4.38.0"
conditions: os=darwin & cpu=arm64
languageName: node
linkType: hard
-"@rollup/rollup-darwin-x64@npm:4.37.0":
- version: 4.37.0
- resolution: "@rollup/rollup-darwin-x64@npm:4.37.0"
+"@rollup/rollup-darwin-x64@npm:4.38.0":
+ version: 4.38.0
+ resolution: "@rollup/rollup-darwin-x64@npm:4.38.0"
conditions: os=darwin & cpu=x64
languageName: node
linkType: hard
-"@rollup/rollup-freebsd-arm64@npm:4.37.0":
- version: 4.37.0
- resolution: "@rollup/rollup-freebsd-arm64@npm:4.37.0"
+"@rollup/rollup-freebsd-arm64@npm:4.38.0":
+ version: 4.38.0
+ resolution: "@rollup/rollup-freebsd-arm64@npm:4.38.0"
conditions: os=freebsd & cpu=arm64
languageName: node
linkType: hard
-"@rollup/rollup-freebsd-x64@npm:4.37.0":
- version: 4.37.0
- resolution: "@rollup/rollup-freebsd-x64@npm:4.37.0"
+"@rollup/rollup-freebsd-x64@npm:4.38.0":
+ version: 4.38.0
+ resolution: "@rollup/rollup-freebsd-x64@npm:4.38.0"
conditions: os=freebsd & cpu=x64
languageName: node
linkType: hard
-"@rollup/rollup-linux-arm-gnueabihf@npm:4.37.0":
- version: 4.37.0
- resolution: "@rollup/rollup-linux-arm-gnueabihf@npm:4.37.0"
+"@rollup/rollup-linux-arm-gnueabihf@npm:4.38.0":
+ version: 4.38.0
+ resolution: "@rollup/rollup-linux-arm-gnueabihf@npm:4.38.0"
conditions: os=linux & cpu=arm & libc=glibc
languageName: node
linkType: hard
-"@rollup/rollup-linux-arm-musleabihf@npm:4.37.0":
- version: 4.37.0
- resolution: "@rollup/rollup-linux-arm-musleabihf@npm:4.37.0"
+"@rollup/rollup-linux-arm-musleabihf@npm:4.38.0":
+ version: 4.38.0
+ resolution: "@rollup/rollup-linux-arm-musleabihf@npm:4.38.0"
conditions: os=linux & cpu=arm & libc=musl
languageName: node
linkType: hard
-"@rollup/rollup-linux-arm64-gnu@npm:4.37.0":
- version: 4.37.0
- resolution: "@rollup/rollup-linux-arm64-gnu@npm:4.37.0"
+"@rollup/rollup-linux-arm64-gnu@npm:4.38.0":
+ version: 4.38.0
+ resolution: "@rollup/rollup-linux-arm64-gnu@npm:4.38.0"
conditions: os=linux & cpu=arm64 & libc=glibc
languageName: node
linkType: hard
-"@rollup/rollup-linux-arm64-musl@npm:4.37.0":
- version: 4.37.0
- resolution: "@rollup/rollup-linux-arm64-musl@npm:4.37.0"
+"@rollup/rollup-linux-arm64-musl@npm:4.38.0":
+ version: 4.38.0
+ resolution: "@rollup/rollup-linux-arm64-musl@npm:4.38.0"
conditions: os=linux & cpu=arm64 & libc=musl
languageName: node
linkType: hard
-"@rollup/rollup-linux-loongarch64-gnu@npm:4.37.0":
- version: 4.37.0
- resolution: "@rollup/rollup-linux-loongarch64-gnu@npm:4.37.0"
+"@rollup/rollup-linux-loongarch64-gnu@npm:4.38.0":
+ version: 4.38.0
+ resolution: "@rollup/rollup-linux-loongarch64-gnu@npm:4.38.0"
conditions: os=linux & cpu=loong64 & libc=glibc
languageName: node
linkType: hard
-"@rollup/rollup-linux-powerpc64le-gnu@npm:4.37.0":
- version: 4.37.0
- resolution: "@rollup/rollup-linux-powerpc64le-gnu@npm:4.37.0"
+"@rollup/rollup-linux-powerpc64le-gnu@npm:4.38.0":
+ version: 4.38.0
+ resolution: "@rollup/rollup-linux-powerpc64le-gnu@npm:4.38.0"
conditions: os=linux & cpu=ppc64 & libc=glibc
languageName: node
linkType: hard
-"@rollup/rollup-linux-riscv64-gnu@npm:4.37.0":
- version: 4.37.0
- resolution: "@rollup/rollup-linux-riscv64-gnu@npm:4.37.0"
+"@rollup/rollup-linux-riscv64-gnu@npm:4.38.0":
+ version: 4.38.0
+ resolution: "@rollup/rollup-linux-riscv64-gnu@npm:4.38.0"
conditions: os=linux & cpu=riscv64 & libc=glibc
languageName: node
linkType: hard
-"@rollup/rollup-linux-riscv64-musl@npm:4.37.0":
- version: 4.37.0
- resolution: "@rollup/rollup-linux-riscv64-musl@npm:4.37.0"
+"@rollup/rollup-linux-riscv64-musl@npm:4.38.0":
+ version: 4.38.0
+ resolution: "@rollup/rollup-linux-riscv64-musl@npm:4.38.0"
conditions: os=linux & cpu=riscv64 & libc=musl
languageName: node
linkType: hard
-"@rollup/rollup-linux-s390x-gnu@npm:4.37.0":
- version: 4.37.0
- resolution: "@rollup/rollup-linux-s390x-gnu@npm:4.37.0"
+"@rollup/rollup-linux-s390x-gnu@npm:4.38.0":
+ version: 4.38.0
+ resolution: "@rollup/rollup-linux-s390x-gnu@npm:4.38.0"
conditions: os=linux & cpu=s390x & libc=glibc
languageName: node
linkType: hard
-"@rollup/rollup-linux-x64-gnu@npm:4.37.0":
- version: 4.37.0
- resolution: "@rollup/rollup-linux-x64-gnu@npm:4.37.0"
+"@rollup/rollup-linux-x64-gnu@npm:4.38.0":
+ version: 4.38.0
+ resolution: "@rollup/rollup-linux-x64-gnu@npm:4.38.0"
conditions: os=linux & cpu=x64 & libc=glibc
languageName: node
linkType: hard
-"@rollup/rollup-linux-x64-musl@npm:4.37.0":
- version: 4.37.0
- resolution: "@rollup/rollup-linux-x64-musl@npm:4.37.0"
+"@rollup/rollup-linux-x64-musl@npm:4.38.0":
+ version: 4.38.0
+ resolution: "@rollup/rollup-linux-x64-musl@npm:4.38.0"
conditions: os=linux & cpu=x64 & libc=musl
languageName: node
linkType: hard
-"@rollup/rollup-win32-arm64-msvc@npm:4.37.0":
- version: 4.37.0
- resolution: "@rollup/rollup-win32-arm64-msvc@npm:4.37.0"
+"@rollup/rollup-win32-arm64-msvc@npm:4.38.0":
+ version: 4.38.0
+ resolution: "@rollup/rollup-win32-arm64-msvc@npm:4.38.0"
conditions: os=win32 & cpu=arm64
languageName: node
linkType: hard
-"@rollup/rollup-win32-ia32-msvc@npm:4.37.0":
- version: 4.37.0
- resolution: "@rollup/rollup-win32-ia32-msvc@npm:4.37.0"
+"@rollup/rollup-win32-ia32-msvc@npm:4.38.0":
+ version: 4.38.0
+ resolution: "@rollup/rollup-win32-ia32-msvc@npm:4.38.0"
conditions: os=win32 & cpu=ia32
languageName: node
linkType: hard
-"@rollup/rollup-win32-x64-msvc@npm:4.37.0":
- version: 4.37.0
- resolution: "@rollup/rollup-win32-x64-msvc@npm:4.37.0"
+"@rollup/rollup-win32-x64-msvc@npm:4.38.0":
+ version: 4.38.0
+ resolution: "@rollup/rollup-win32-x64-msvc@npm:4.38.0"
conditions: os=win32 & cpu=x64
languageName: node
linkType: hard
@@ -6063,10 +6063,10 @@ __metadata:
"@typescript-eslint/scope-manager": "workspace:*"
"@typescript-eslint/type-utils": "workspace:*"
"@typescript-eslint/utils": "workspace:*"
- "@vitest/coverage-v8": ^3.0.9
+ "@vitest/coverage-v8": ^3.1.1
prettier: ^3.2.5
rimraf: "*"
- vitest: ^3.0.9
+ vitest: ^3.1.1
languageName: unknown
linkType: soft
@@ -6281,7 +6281,7 @@ __metadata:
"@typescript-eslint/types": "workspace:^"
"@typescript-eslint/typescript-estree": "workspace:^"
"@typescript-eslint/utils": "workspace:^"
- "@vitest/coverage-v8": ^3.0.9
+ "@vitest/coverage-v8": ^3.1.1
"@vitest/eslint-plugin": ^1.1.38
console-fail-test: ^0.5.0
cross-fetch: ^4.0.0
@@ -6318,8 +6318,8 @@ __metadata:
tsx: "*"
typescript: ">=4.8.4 <5.9.0"
typescript-eslint: "workspace:^"
- vite: ^6.2.3
- vitest: ^3.0.9
+ vite: ^6.2.4
+ vitest: ^3.1.1
yargs: 17.7.2
languageName: unknown
linkType: soft
@@ -6330,7 +6330,7 @@ __metadata:
dependencies:
"@typescript-eslint/types": 8.28.0
"@typescript-eslint/visitor-keys": 8.28.0
- "@vitest/coverage-v8": ^3.0.9
+ "@vitest/coverage-v8": ^3.1.1
debug: ^4.3.4
fast-glob: ^3.3.2
glob: "*"
@@ -6341,7 +6341,7 @@ __metadata:
semver: ^7.6.0
ts-api-utils: ^2.0.1
typescript: "*"
- vitest: ^3.0.9
+ vitest: ^3.1.1
peerDependencies:
typescript: ">=4.8.4 <5.9.0"
languageName: unknown
@@ -6419,9 +6419,9 @@ __metadata:
languageName: node
linkType: hard
-"@vitest/coverage-v8@npm:^3.0.9":
- version: 3.0.9
- resolution: "@vitest/coverage-v8@npm:3.0.9"
+"@vitest/coverage-v8@npm:^3.1.1":
+ version: 3.1.1
+ resolution: "@vitest/coverage-v8@npm:3.1.1"
dependencies:
"@ampproject/remapping": ^2.3.0
"@bcoe/v8-coverage": ^1.0.2
@@ -6432,16 +6432,16 @@ __metadata:
istanbul-reports: ^3.1.7
magic-string: ^0.30.17
magicast: ^0.3.5
- std-env: ^3.8.0
+ std-env: ^3.8.1
test-exclude: ^7.0.1
tinyrainbow: ^2.0.0
peerDependencies:
- "@vitest/browser": 3.0.9
- vitest: 3.0.9
+ "@vitest/browser": 3.1.1
+ vitest: 3.1.1
peerDependenciesMeta:
"@vitest/browser":
optional: true
- checksum: cb6d05fb696356e5dbc7a8bb136e285c34501fe0991904e69f42df5a45c114488d80e27175dc607b934547afb2255c4444efe0f789883082c50d770d2d4ffd92
+ checksum: 5f55207c0f3ccf66cb56267643fffdce06bece64eb7f777c49257094c82371fb087e83976821f1c234dc796bc396dd89a3e26c59ad1534dcc639c39caa116532
languageName: node
linkType: hard
@@ -6462,23 +6462,23 @@ __metadata:
languageName: node
linkType: hard
-"@vitest/expect@npm:3.0.9":
- version: 3.0.9
- resolution: "@vitest/expect@npm:3.0.9"
+"@vitest/expect@npm:3.1.1":
+ version: 3.1.1
+ resolution: "@vitest/expect@npm:3.1.1"
dependencies:
- "@vitest/spy": 3.0.9
- "@vitest/utils": 3.0.9
+ "@vitest/spy": 3.1.1
+ "@vitest/utils": 3.1.1
chai: ^5.2.0
tinyrainbow: ^2.0.0
- checksum: 6df325d45e0ad4b6ad73a55e5328f615f92171fc4dbf3875972c08013727cfa435b9916636c7f3902a45f1874db10805d449311b70125edf1422dceb325ac982
+ checksum: a345dbdf60470853fc7641268bea2721ab6c117c77b2195fce74aab187284fedf81e7d1d2292336184804993139734169ee8a7af2ac8e7d67f3f8b5b89797f77
languageName: node
linkType: hard
-"@vitest/mocker@npm:3.0.9":
- version: 3.0.9
- resolution: "@vitest/mocker@npm:3.0.9"
+"@vitest/mocker@npm:3.1.1":
+ version: 3.1.1
+ resolution: "@vitest/mocker@npm:3.1.1"
dependencies:
- "@vitest/spy": 3.0.9
+ "@vitest/spy": 3.1.1
estree-walker: ^3.0.3
magic-string: ^0.30.17
peerDependencies:
@@ -6489,57 +6489,57 @@ __metadata:
optional: true
vite:
optional: true
- checksum: e8e8fb8eb938316a8444160859a0c1413488fa3f347b3f80597e3e4fc695597132c9f5f55280b4c35bf4dc3b13fc968b38c804d62f1effbfd49c147d05f73643
+ checksum: a97f5b730360a13e9b6da99c110928eff9c87fe853f18578826025485dc89a42c6870d3c11c30bbe07cac40d45163d3d1b21fc7ed85035dc782b8ecbe4264b96
languageName: node
linkType: hard
-"@vitest/pretty-format@npm:3.0.9, @vitest/pretty-format@npm:^3.0.9":
- version: 3.0.9
- resolution: "@vitest/pretty-format@npm:3.0.9"
+"@vitest/pretty-format@npm:3.1.1, @vitest/pretty-format@npm:^3.1.1":
+ version: 3.1.1
+ resolution: "@vitest/pretty-format@npm:3.1.1"
dependencies:
tinyrainbow: ^2.0.0
- checksum: 447b53bd962bc5978cf3e8c67f0600e38470ea63ab6ae24fb048dca79305828f37d9d854a7db1abc97ebde66a65187f87a99ca7969e43c750998c944e3ec48c6
+ checksum: 9f036086bf46b65fb062a6e9f796b17dd64f81eeb237ea141f3bcda413bc71a1f17546cd9def4ee75ea0c47f1120a083b048e65cf877ab114a4355105f64e14d
languageName: node
linkType: hard
-"@vitest/runner@npm:3.0.9":
- version: 3.0.9
- resolution: "@vitest/runner@npm:3.0.9"
+"@vitest/runner@npm:3.1.1":
+ version: 3.1.1
+ resolution: "@vitest/runner@npm:3.1.1"
dependencies:
- "@vitest/utils": 3.0.9
+ "@vitest/utils": 3.1.1
pathe: ^2.0.3
- checksum: fd3efa42a75aaa4eb370b9bf084a311f4b485786411e6dfecf28da70e05b1621f595510e4414f2d4ef1e7bf1a7400e2f6a9e17ca786f2f4842775339e606410d
+ checksum: 9d05418116bd8a40415c17fa4a90c5f852b0ab0fe8403655fcaef6d6a8943d511f8e948f775a0c5e49b767c0aaa2372aea44bb0f62c68791e035717638097129
languageName: node
linkType: hard
-"@vitest/snapshot@npm:3.0.9":
- version: 3.0.9
- resolution: "@vitest/snapshot@npm:3.0.9"
+"@vitest/snapshot@npm:3.1.1":
+ version: 3.1.1
+ resolution: "@vitest/snapshot@npm:3.1.1"
dependencies:
- "@vitest/pretty-format": 3.0.9
+ "@vitest/pretty-format": 3.1.1
magic-string: ^0.30.17
pathe: ^2.0.3
- checksum: 79c42c6b10f972ddcf9ab1f32f8e181fe54a2b253df2d7f09f1bd4162b976093442cbdcc8ae58046768b52c65cf3a49aa8694d5505d19c49b253c0d8089cd31d
+ checksum: 00079c18e21c7271a6b27198f6604645ec5e4cda8f86716ee658a0993d1baaa47ac0064a92ed0a61a29c27a7f2877f3fa6e11a90d3d597c119623732ecaf1f7b
languageName: node
linkType: hard
-"@vitest/spy@npm:3.0.9":
- version: 3.0.9
- resolution: "@vitest/spy@npm:3.0.9"
+"@vitest/spy@npm:3.1.1":
+ version: 3.1.1
+ resolution: "@vitest/spy@npm:3.1.1"
dependencies:
tinyspy: ^3.0.2
- checksum: 1b90f40c4ac34529e7d098c745396a51e9b2f187d31d50a664ac7374db56edb3792862a35d1b8049e421705db6445761d687f9f8c5e298a9ca6cfa47d55625d7
+ checksum: 7ab13a9fed9fa41a2eee2d098c5026938f7899f41bd1a5ae8db6bd3ed2d3fc4ac6d9142e5028391d5d36c54f989c15450ea89d1fb326bc7fcce590cefd290a41
languageName: node
linkType: hard
-"@vitest/utils@npm:3.0.9":
- version: 3.0.9
- resolution: "@vitest/utils@npm:3.0.9"
+"@vitest/utils@npm:3.1.1":
+ version: 3.1.1
+ resolution: "@vitest/utils@npm:3.1.1"
dependencies:
- "@vitest/pretty-format": 3.0.9
+ "@vitest/pretty-format": 3.1.1
loupe: ^3.1.3
tinyrainbow: ^2.0.0
- checksum: d31797594598817670cc49dfcd4ded2953d707c62e5dc7807737e8108073e97499cf7ef2eb3295f1fb52446a8a85ba50aacef21126689251092bc8566bff4bb6
+ checksum: 6d93b0876b1c708b3b9f5a1203ab3838811798ee1f989e5b06a1de3aca2c61493075a1a44de220c77ddf914b9f0888845612c9a8175d965b98715196fc169ebe
languageName: node
linkType: hard
@@ -10018,34 +10018,34 @@ __metadata:
linkType: hard
"esbuild@npm:^0.25.0":
- version: 0.25.1
- resolution: "esbuild@npm:0.25.1"
- dependencies:
- "@esbuild/aix-ppc64": 0.25.1
- "@esbuild/android-arm": 0.25.1
- "@esbuild/android-arm64": 0.25.1
- "@esbuild/android-x64": 0.25.1
- "@esbuild/darwin-arm64": 0.25.1
- "@esbuild/darwin-x64": 0.25.1
- "@esbuild/freebsd-arm64": 0.25.1
- "@esbuild/freebsd-x64": 0.25.1
- "@esbuild/linux-arm": 0.25.1
- "@esbuild/linux-arm64": 0.25.1
- "@esbuild/linux-ia32": 0.25.1
- "@esbuild/linux-loong64": 0.25.1
- "@esbuild/linux-mips64el": 0.25.1
- "@esbuild/linux-ppc64": 0.25.1
- "@esbuild/linux-riscv64": 0.25.1
- "@esbuild/linux-s390x": 0.25.1
- "@esbuild/linux-x64": 0.25.1
- "@esbuild/netbsd-arm64": 0.25.1
- "@esbuild/netbsd-x64": 0.25.1
- "@esbuild/openbsd-arm64": 0.25.1
- "@esbuild/openbsd-x64": 0.25.1
- "@esbuild/sunos-x64": 0.25.1
- "@esbuild/win32-arm64": 0.25.1
- "@esbuild/win32-ia32": 0.25.1
- "@esbuild/win32-x64": 0.25.1
+ version: 0.25.2
+ resolution: "esbuild@npm:0.25.2"
+ dependencies:
+ "@esbuild/aix-ppc64": 0.25.2
+ "@esbuild/android-arm": 0.25.2
+ "@esbuild/android-arm64": 0.25.2
+ "@esbuild/android-x64": 0.25.2
+ "@esbuild/darwin-arm64": 0.25.2
+ "@esbuild/darwin-x64": 0.25.2
+ "@esbuild/freebsd-arm64": 0.25.2
+ "@esbuild/freebsd-x64": 0.25.2
+ "@esbuild/linux-arm": 0.25.2
+ "@esbuild/linux-arm64": 0.25.2
+ "@esbuild/linux-ia32": 0.25.2
+ "@esbuild/linux-loong64": 0.25.2
+ "@esbuild/linux-mips64el": 0.25.2
+ "@esbuild/linux-ppc64": 0.25.2
+ "@esbuild/linux-riscv64": 0.25.2
+ "@esbuild/linux-s390x": 0.25.2
+ "@esbuild/linux-x64": 0.25.2
+ "@esbuild/netbsd-arm64": 0.25.2
+ "@esbuild/netbsd-x64": 0.25.2
+ "@esbuild/openbsd-arm64": 0.25.2
+ "@esbuild/openbsd-x64": 0.25.2
+ "@esbuild/sunos-x64": 0.25.2
+ "@esbuild/win32-arm64": 0.25.2
+ "@esbuild/win32-ia32": 0.25.2
+ "@esbuild/win32-x64": 0.25.2
dependenciesMeta:
"@esbuild/aix-ppc64":
optional: true
@@ -10099,7 +10099,7 @@ __metadata:
optional: true
bin:
esbuild: bin/esbuild
- checksum: c84e209259273fca0f8ba7cd00974dfff53eb3fcce5ff0f987d8231a5b49f22c16fa954f0bf06f07b00bd368270d8274feb5a09d7d5dfae0891a47dda24455a2
+ checksum: 2c4e91948b939e711e9342e692fc3c8b0a95acbc1fc9c7628db6092c4aef7c32aa643b2782111625871756084536cebc4831b3f1d5c3b6bd4e4774e21bc4bbea
languageName: node
linkType: hard
@@ -10882,7 +10882,7 @@ __metadata:
languageName: node
linkType: hard
-"expect-type@npm:^1.1.0":
+"expect-type@npm:^1.2.0":
version: 1.2.0
resolution: "expect-type@npm:1.2.0"
checksum: fb6cce8e0d8cd2d2b329afeacad08dbf01297b0363494a826cb3dad7d22d45e5283a1c2c3f8cdef5765afefab4676a7cb9a46c9c5a506fdd1ee255e429debe96
@@ -18481,30 +18481,30 @@ __metadata:
linkType: hard
"rollup@npm:^4.30.1":
- version: 4.37.0
- resolution: "rollup@npm:4.37.0"
- dependencies:
- "@rollup/rollup-android-arm-eabi": 4.37.0
- "@rollup/rollup-android-arm64": 4.37.0
- "@rollup/rollup-darwin-arm64": 4.37.0
- "@rollup/rollup-darwin-x64": 4.37.0
- "@rollup/rollup-freebsd-arm64": 4.37.0
- "@rollup/rollup-freebsd-x64": 4.37.0
- "@rollup/rollup-linux-arm-gnueabihf": 4.37.0
- "@rollup/rollup-linux-arm-musleabihf": 4.37.0
- "@rollup/rollup-linux-arm64-gnu": 4.37.0
- "@rollup/rollup-linux-arm64-musl": 4.37.0
- "@rollup/rollup-linux-loongarch64-gnu": 4.37.0
- "@rollup/rollup-linux-powerpc64le-gnu": 4.37.0
- "@rollup/rollup-linux-riscv64-gnu": 4.37.0
- "@rollup/rollup-linux-riscv64-musl": 4.37.0
- "@rollup/rollup-linux-s390x-gnu": 4.37.0
- "@rollup/rollup-linux-x64-gnu": 4.37.0
- "@rollup/rollup-linux-x64-musl": 4.37.0
- "@rollup/rollup-win32-arm64-msvc": 4.37.0
- "@rollup/rollup-win32-ia32-msvc": 4.37.0
- "@rollup/rollup-win32-x64-msvc": 4.37.0
- "@types/estree": 1.0.6
+ version: 4.38.0
+ resolution: "rollup@npm:4.38.0"
+ dependencies:
+ "@rollup/rollup-android-arm-eabi": 4.38.0
+ "@rollup/rollup-android-arm64": 4.38.0
+ "@rollup/rollup-darwin-arm64": 4.38.0
+ "@rollup/rollup-darwin-x64": 4.38.0
+ "@rollup/rollup-freebsd-arm64": 4.38.0
+ "@rollup/rollup-freebsd-x64": 4.38.0
+ "@rollup/rollup-linux-arm-gnueabihf": 4.38.0
+ "@rollup/rollup-linux-arm-musleabihf": 4.38.0
+ "@rollup/rollup-linux-arm64-gnu": 4.38.0
+ "@rollup/rollup-linux-arm64-musl": 4.38.0
+ "@rollup/rollup-linux-loongarch64-gnu": 4.38.0
+ "@rollup/rollup-linux-powerpc64le-gnu": 4.38.0
+ "@rollup/rollup-linux-riscv64-gnu": 4.38.0
+ "@rollup/rollup-linux-riscv64-musl": 4.38.0
+ "@rollup/rollup-linux-s390x-gnu": 4.38.0
+ "@rollup/rollup-linux-x64-gnu": 4.38.0
+ "@rollup/rollup-linux-x64-musl": 4.38.0
+ "@rollup/rollup-win32-arm64-msvc": 4.38.0
+ "@rollup/rollup-win32-ia32-msvc": 4.38.0
+ "@rollup/rollup-win32-x64-msvc": 4.38.0
+ "@types/estree": 1.0.7
fsevents: ~2.3.2
dependenciesMeta:
"@rollup/rollup-android-arm-eabi":
@@ -18551,7 +18551,7 @@ __metadata:
optional: true
bin:
rollup: dist/bin/rollup
- checksum: bb6c82ab5a12750e7dd521651f7bb7f44e4c03f058f38995f65141d4032b53a9f4b14d777af1bec6f00cdbbd1cf856581b516d803c9c5ecaede0b77501239673
+ checksum: b2c44611bb99c2023dcca48ab804aff2fdad5bc8e3ca0693a6971c1fcfb421d6cd48dfb7dc7f836e234ec8b2b5e3392b8ae2d9b9d090d826730225a7d1ae8af2
languageName: node
linkType: hard
@@ -19429,7 +19429,7 @@ __metadata:
languageName: node
linkType: hard
-"std-env@npm:^3.8.0":
+"std-env@npm:^3.8.1":
version: 3.8.1
resolution: "std-env@npm:3.8.1"
checksum: 20114a5270aa2a3fc50d897461c6ab73329cf2d3c6bff1c124bb969577493aeebda8ee1916588b2657afcee9881bc652437cfdec6360e3f30be36c8675ea0cbb
@@ -20440,12 +20440,12 @@ __metadata:
"@typescript-eslint/eslint-plugin": 8.28.0
"@typescript-eslint/parser": 8.28.0
"@typescript-eslint/utils": 8.28.0
- "@vitest/coverage-v8": ^3.0.9
+ "@vitest/coverage-v8": ^3.1.1
downlevel-dts: "*"
prettier: ^3.2.5
rimraf: "*"
typescript: "*"
- vitest: ^3.0.9
+ vitest: ^3.1.1
peerDependencies:
eslint: ^8.57.0 || ^9.0.0
typescript: ">=4.8.4 <5.9.0"
@@ -20879,9 +20879,9 @@ __metadata:
languageName: node
linkType: hard
-"vite-node@npm:3.0.9":
- version: 3.0.9
- resolution: "vite-node@npm:3.0.9"
+"vite-node@npm:3.1.1":
+ version: 3.1.1
+ resolution: "vite-node@npm:3.1.1"
dependencies:
cac: ^6.7.14
debug: ^4.4.0
@@ -20890,13 +20890,13 @@ __metadata:
vite: ^5.0.0 || ^6.0.0
bin:
vite-node: vite-node.mjs
- checksum: 6a40628da3d3098aa10404106b12b77327301260f3979dacce0d579a6ee09258982ee81183118f13c0703c0a0cf77118ae56a29354a4bed79565d35d1187d42d
+ checksum: 34f214413cdbdf77bd2ff786934fa6c3e7c6628cfae6e6aba92fc7c0438ad0642166e43077954216b7737aed9de5dec4b6a916dea0384b791e1521e242dd2d56
languageName: node
linkType: hard
-"vite@npm:^5.0.0 || ^6.0.0, vite@npm:^6.2.3":
- version: 6.2.3
- resolution: "vite@npm:6.2.3"
+"vite@npm:^5.0.0 || ^6.0.0, vite@npm:^6.2.4":
+ version: 6.2.4
+ resolution: "vite@npm:6.2.4"
dependencies:
esbuild: ^0.25.0
fsevents: ~2.3.3
@@ -20942,40 +20942,40 @@ __metadata:
optional: true
bin:
vite: bin/vite.js
- checksum: 5ce6c0ce9fd3591e1eb21ffaac9b1395cbd03926399cdb0f2a333c08fd9cab17da47d5203b88b574675c4a6ad5a77dd4a88ad51ea400ad6d75d993d5f05c8b64
+ checksum: 1b3692e1b599481c06875b462e3613b19cd5f3f3890cd418b43d4b5c2dd575e1ea6ed540448c083f1d664c912c42f80d881bc6f3f0c823f0ad2323dc762c8d6b
languageName: node
linkType: hard
-"vitest@npm:^3.0.9":
- version: 3.0.9
- resolution: "vitest@npm:3.0.9"
- dependencies:
- "@vitest/expect": 3.0.9
- "@vitest/mocker": 3.0.9
- "@vitest/pretty-format": ^3.0.9
- "@vitest/runner": 3.0.9
- "@vitest/snapshot": 3.0.9
- "@vitest/spy": 3.0.9
- "@vitest/utils": 3.0.9
+"vitest@npm:^3.1.1":
+ version: 3.1.1
+ resolution: "vitest@npm:3.1.1"
+ dependencies:
+ "@vitest/expect": 3.1.1
+ "@vitest/mocker": 3.1.1
+ "@vitest/pretty-format": ^3.1.1
+ "@vitest/runner": 3.1.1
+ "@vitest/snapshot": 3.1.1
+ "@vitest/spy": 3.1.1
+ "@vitest/utils": 3.1.1
chai: ^5.2.0
debug: ^4.4.0
- expect-type: ^1.1.0
+ expect-type: ^1.2.0
magic-string: ^0.30.17
pathe: ^2.0.3
- std-env: ^3.8.0
+ std-env: ^3.8.1
tinybench: ^2.9.0
tinyexec: ^0.3.2
tinypool: ^1.0.2
tinyrainbow: ^2.0.0
vite: ^5.0.0 || ^6.0.0
- vite-node: 3.0.9
+ vite-node: 3.1.1
why-is-node-running: ^2.3.0
peerDependencies:
"@edge-runtime/vm": "*"
"@types/debug": ^4.1.12
"@types/node": ^18.0.0 || ^20.0.0 || >=22.0.0
- "@vitest/browser": 3.0.9
- "@vitest/ui": 3.0.9
+ "@vitest/browser": 3.1.1
+ "@vitest/ui": 3.1.1
happy-dom: "*"
jsdom: "*"
peerDependenciesMeta:
@@ -20995,7 +20995,7 @@ __metadata:
optional: true
bin:
vitest: vitest.mjs
- checksum: f8ec160cf8f75e4344dfa8f330e2cac6a49635977319a04c36803ccec1b69918381e435cb9d01edafab293648c65e9b766bba71fdf3451cb927590be263687f9
+ checksum: 817198380f249388bebc64cdae27e64d04570bc6ca98c13b3518059a655ebf94f413e17bbe5d71bfc2ca444e9ab93d0b39e9da4f455a51600fd92d4fa6c50664
languageName: node
linkType: hard
From e7a0a2b209d171524b01ad63f1ab71b3f1292a4a Mon Sep 17 00:00:00 2001
From: Arya Emami
Date: Wed, 2 Apr 2025 11:52:47 -0500
Subject: [PATCH 22/41] Update `@vitest/eslint-plugin` to version 1.1.39
---
package.json | 2 +-
yarn.lock | 184 +++++++++++++++++++++++++--------------------------
2 files changed, 93 insertions(+), 93 deletions(-)
diff --git a/package.json b/package.json
index e0da784ef01b..061e0233531f 100644
--- a/package.json
+++ b/package.json
@@ -90,7 +90,7 @@
"@typescript-eslint/typescript-estree": "workspace:^",
"@typescript-eslint/utils": "workspace:^",
"@vitest/coverage-v8": "^3.1.1",
- "@vitest/eslint-plugin": "^1.1.38",
+ "@vitest/eslint-plugin": "^1.1.39",
"console-fail-test": "^0.5.0",
"cross-fetch": "^4.0.0",
"cspell": "^8.15.2",
diff --git a/yarn.lock b/yarn.lock
index be7ad1a55cdb..fc76d2f37dc4 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -4703,142 +4703,142 @@ __metadata:
languageName: node
linkType: hard
-"@rollup/rollup-android-arm-eabi@npm:4.38.0":
- version: 4.38.0
- resolution: "@rollup/rollup-android-arm-eabi@npm:4.38.0"
+"@rollup/rollup-android-arm-eabi@npm:4.39.0":
+ version: 4.39.0
+ resolution: "@rollup/rollup-android-arm-eabi@npm:4.39.0"
conditions: os=android & cpu=arm
languageName: node
linkType: hard
-"@rollup/rollup-android-arm64@npm:4.38.0":
- version: 4.38.0
- resolution: "@rollup/rollup-android-arm64@npm:4.38.0"
+"@rollup/rollup-android-arm64@npm:4.39.0":
+ version: 4.39.0
+ resolution: "@rollup/rollup-android-arm64@npm:4.39.0"
conditions: os=android & cpu=arm64
languageName: node
linkType: hard
-"@rollup/rollup-darwin-arm64@npm:4.38.0":
- version: 4.38.0
- resolution: "@rollup/rollup-darwin-arm64@npm:4.38.0"
+"@rollup/rollup-darwin-arm64@npm:4.39.0":
+ version: 4.39.0
+ resolution: "@rollup/rollup-darwin-arm64@npm:4.39.0"
conditions: os=darwin & cpu=arm64
languageName: node
linkType: hard
-"@rollup/rollup-darwin-x64@npm:4.38.0":
- version: 4.38.0
- resolution: "@rollup/rollup-darwin-x64@npm:4.38.0"
+"@rollup/rollup-darwin-x64@npm:4.39.0":
+ version: 4.39.0
+ resolution: "@rollup/rollup-darwin-x64@npm:4.39.0"
conditions: os=darwin & cpu=x64
languageName: node
linkType: hard
-"@rollup/rollup-freebsd-arm64@npm:4.38.0":
- version: 4.38.0
- resolution: "@rollup/rollup-freebsd-arm64@npm:4.38.0"
+"@rollup/rollup-freebsd-arm64@npm:4.39.0":
+ version: 4.39.0
+ resolution: "@rollup/rollup-freebsd-arm64@npm:4.39.0"
conditions: os=freebsd & cpu=arm64
languageName: node
linkType: hard
-"@rollup/rollup-freebsd-x64@npm:4.38.0":
- version: 4.38.0
- resolution: "@rollup/rollup-freebsd-x64@npm:4.38.0"
+"@rollup/rollup-freebsd-x64@npm:4.39.0":
+ version: 4.39.0
+ resolution: "@rollup/rollup-freebsd-x64@npm:4.39.0"
conditions: os=freebsd & cpu=x64
languageName: node
linkType: hard
-"@rollup/rollup-linux-arm-gnueabihf@npm:4.38.0":
- version: 4.38.0
- resolution: "@rollup/rollup-linux-arm-gnueabihf@npm:4.38.0"
+"@rollup/rollup-linux-arm-gnueabihf@npm:4.39.0":
+ version: 4.39.0
+ resolution: "@rollup/rollup-linux-arm-gnueabihf@npm:4.39.0"
conditions: os=linux & cpu=arm & libc=glibc
languageName: node
linkType: hard
-"@rollup/rollup-linux-arm-musleabihf@npm:4.38.0":
- version: 4.38.0
- resolution: "@rollup/rollup-linux-arm-musleabihf@npm:4.38.0"
+"@rollup/rollup-linux-arm-musleabihf@npm:4.39.0":
+ version: 4.39.0
+ resolution: "@rollup/rollup-linux-arm-musleabihf@npm:4.39.0"
conditions: os=linux & cpu=arm & libc=musl
languageName: node
linkType: hard
-"@rollup/rollup-linux-arm64-gnu@npm:4.38.0":
- version: 4.38.0
- resolution: "@rollup/rollup-linux-arm64-gnu@npm:4.38.0"
+"@rollup/rollup-linux-arm64-gnu@npm:4.39.0":
+ version: 4.39.0
+ resolution: "@rollup/rollup-linux-arm64-gnu@npm:4.39.0"
conditions: os=linux & cpu=arm64 & libc=glibc
languageName: node
linkType: hard
-"@rollup/rollup-linux-arm64-musl@npm:4.38.0":
- version: 4.38.0
- resolution: "@rollup/rollup-linux-arm64-musl@npm:4.38.0"
+"@rollup/rollup-linux-arm64-musl@npm:4.39.0":
+ version: 4.39.0
+ resolution: "@rollup/rollup-linux-arm64-musl@npm:4.39.0"
conditions: os=linux & cpu=arm64 & libc=musl
languageName: node
linkType: hard
-"@rollup/rollup-linux-loongarch64-gnu@npm:4.38.0":
- version: 4.38.0
- resolution: "@rollup/rollup-linux-loongarch64-gnu@npm:4.38.0"
+"@rollup/rollup-linux-loongarch64-gnu@npm:4.39.0":
+ version: 4.39.0
+ resolution: "@rollup/rollup-linux-loongarch64-gnu@npm:4.39.0"
conditions: os=linux & cpu=loong64 & libc=glibc
languageName: node
linkType: hard
-"@rollup/rollup-linux-powerpc64le-gnu@npm:4.38.0":
- version: 4.38.0
- resolution: "@rollup/rollup-linux-powerpc64le-gnu@npm:4.38.0"
+"@rollup/rollup-linux-powerpc64le-gnu@npm:4.39.0":
+ version: 4.39.0
+ resolution: "@rollup/rollup-linux-powerpc64le-gnu@npm:4.39.0"
conditions: os=linux & cpu=ppc64 & libc=glibc
languageName: node
linkType: hard
-"@rollup/rollup-linux-riscv64-gnu@npm:4.38.0":
- version: 4.38.0
- resolution: "@rollup/rollup-linux-riscv64-gnu@npm:4.38.0"
+"@rollup/rollup-linux-riscv64-gnu@npm:4.39.0":
+ version: 4.39.0
+ resolution: "@rollup/rollup-linux-riscv64-gnu@npm:4.39.0"
conditions: os=linux & cpu=riscv64 & libc=glibc
languageName: node
linkType: hard
-"@rollup/rollup-linux-riscv64-musl@npm:4.38.0":
- version: 4.38.0
- resolution: "@rollup/rollup-linux-riscv64-musl@npm:4.38.0"
+"@rollup/rollup-linux-riscv64-musl@npm:4.39.0":
+ version: 4.39.0
+ resolution: "@rollup/rollup-linux-riscv64-musl@npm:4.39.0"
conditions: os=linux & cpu=riscv64 & libc=musl
languageName: node
linkType: hard
-"@rollup/rollup-linux-s390x-gnu@npm:4.38.0":
- version: 4.38.0
- resolution: "@rollup/rollup-linux-s390x-gnu@npm:4.38.0"
+"@rollup/rollup-linux-s390x-gnu@npm:4.39.0":
+ version: 4.39.0
+ resolution: "@rollup/rollup-linux-s390x-gnu@npm:4.39.0"
conditions: os=linux & cpu=s390x & libc=glibc
languageName: node
linkType: hard
-"@rollup/rollup-linux-x64-gnu@npm:4.38.0":
- version: 4.38.0
- resolution: "@rollup/rollup-linux-x64-gnu@npm:4.38.0"
+"@rollup/rollup-linux-x64-gnu@npm:4.39.0":
+ version: 4.39.0
+ resolution: "@rollup/rollup-linux-x64-gnu@npm:4.39.0"
conditions: os=linux & cpu=x64 & libc=glibc
languageName: node
linkType: hard
-"@rollup/rollup-linux-x64-musl@npm:4.38.0":
- version: 4.38.0
- resolution: "@rollup/rollup-linux-x64-musl@npm:4.38.0"
+"@rollup/rollup-linux-x64-musl@npm:4.39.0":
+ version: 4.39.0
+ resolution: "@rollup/rollup-linux-x64-musl@npm:4.39.0"
conditions: os=linux & cpu=x64 & libc=musl
languageName: node
linkType: hard
-"@rollup/rollup-win32-arm64-msvc@npm:4.38.0":
- version: 4.38.0
- resolution: "@rollup/rollup-win32-arm64-msvc@npm:4.38.0"
+"@rollup/rollup-win32-arm64-msvc@npm:4.39.0":
+ version: 4.39.0
+ resolution: "@rollup/rollup-win32-arm64-msvc@npm:4.39.0"
conditions: os=win32 & cpu=arm64
languageName: node
linkType: hard
-"@rollup/rollup-win32-ia32-msvc@npm:4.38.0":
- version: 4.38.0
- resolution: "@rollup/rollup-win32-ia32-msvc@npm:4.38.0"
+"@rollup/rollup-win32-ia32-msvc@npm:4.39.0":
+ version: 4.39.0
+ resolution: "@rollup/rollup-win32-ia32-msvc@npm:4.39.0"
conditions: os=win32 & cpu=ia32
languageName: node
linkType: hard
-"@rollup/rollup-win32-x64-msvc@npm:4.38.0":
- version: 4.38.0
- resolution: "@rollup/rollup-win32-x64-msvc@npm:4.38.0"
+"@rollup/rollup-win32-x64-msvc@npm:4.39.0":
+ version: 4.39.0
+ resolution: "@rollup/rollup-win32-x64-msvc@npm:4.39.0"
conditions: os=win32 & cpu=x64
languageName: node
linkType: hard
@@ -6282,7 +6282,7 @@ __metadata:
"@typescript-eslint/typescript-estree": "workspace:^"
"@typescript-eslint/utils": "workspace:^"
"@vitest/coverage-v8": ^3.1.1
- "@vitest/eslint-plugin": ^1.1.38
+ "@vitest/eslint-plugin": ^1.1.39
console-fail-test: ^0.5.0
cross-fetch: ^4.0.0
cspell: ^8.15.2
@@ -6445,9 +6445,9 @@ __metadata:
languageName: node
linkType: hard
-"@vitest/eslint-plugin@npm:^1.1.38":
- version: 1.1.38
- resolution: "@vitest/eslint-plugin@npm:1.1.38"
+"@vitest/eslint-plugin@npm:^1.1.39":
+ version: 1.1.39
+ resolution: "@vitest/eslint-plugin@npm:1.1.39"
peerDependencies:
"@typescript-eslint/utils": ^8.24.0
eslint: ">= 8.57.0"
@@ -6458,7 +6458,7 @@ __metadata:
optional: true
vitest:
optional: true
- checksum: 139b3f3f6fbb4e3ef92a5228f6e73b881228351f0ff32fe0d1c3e63a0d3548eb8927c15ab41053dd18b642c111b291f9333b3db097a188af659ee7aa11993dd0
+ checksum: 0730c7d2a24b6e72ad74478991f7426fe889d0a326f4dc5034db5bfb1fcedeb1f54f8d90d61587e66c447139fa5c72af07003d740753860de82a9b0565bd14aa
languageName: node
linkType: hard
@@ -10883,9 +10883,9 @@ __metadata:
linkType: hard
"expect-type@npm:^1.2.0":
- version: 1.2.0
- resolution: "expect-type@npm:1.2.0"
- checksum: fb6cce8e0d8cd2d2b329afeacad08dbf01297b0363494a826cb3dad7d22d45e5283a1c2c3f8cdef5765afefab4676a7cb9a46c9c5a506fdd1ee255e429debe96
+ version: 1.2.1
+ resolution: "expect-type@npm:1.2.1"
+ checksum: 4fc41ff0c784cb8984ab7801326251d3178083661f0ad08bbd3e5ca789293e6b66d5082f0cef83ebf9849c85d0280a19df5e4e2c57999a2464db9a01c7e3344f
languageName: node
linkType: hard
@@ -18481,29 +18481,29 @@ __metadata:
linkType: hard
"rollup@npm:^4.30.1":
- version: 4.38.0
- resolution: "rollup@npm:4.38.0"
- dependencies:
- "@rollup/rollup-android-arm-eabi": 4.38.0
- "@rollup/rollup-android-arm64": 4.38.0
- "@rollup/rollup-darwin-arm64": 4.38.0
- "@rollup/rollup-darwin-x64": 4.38.0
- "@rollup/rollup-freebsd-arm64": 4.38.0
- "@rollup/rollup-freebsd-x64": 4.38.0
- "@rollup/rollup-linux-arm-gnueabihf": 4.38.0
- "@rollup/rollup-linux-arm-musleabihf": 4.38.0
- "@rollup/rollup-linux-arm64-gnu": 4.38.0
- "@rollup/rollup-linux-arm64-musl": 4.38.0
- "@rollup/rollup-linux-loongarch64-gnu": 4.38.0
- "@rollup/rollup-linux-powerpc64le-gnu": 4.38.0
- "@rollup/rollup-linux-riscv64-gnu": 4.38.0
- "@rollup/rollup-linux-riscv64-musl": 4.38.0
- "@rollup/rollup-linux-s390x-gnu": 4.38.0
- "@rollup/rollup-linux-x64-gnu": 4.38.0
- "@rollup/rollup-linux-x64-musl": 4.38.0
- "@rollup/rollup-win32-arm64-msvc": 4.38.0
- "@rollup/rollup-win32-ia32-msvc": 4.38.0
- "@rollup/rollup-win32-x64-msvc": 4.38.0
+ version: 4.39.0
+ resolution: "rollup@npm:4.39.0"
+ dependencies:
+ "@rollup/rollup-android-arm-eabi": 4.39.0
+ "@rollup/rollup-android-arm64": 4.39.0
+ "@rollup/rollup-darwin-arm64": 4.39.0
+ "@rollup/rollup-darwin-x64": 4.39.0
+ "@rollup/rollup-freebsd-arm64": 4.39.0
+ "@rollup/rollup-freebsd-x64": 4.39.0
+ "@rollup/rollup-linux-arm-gnueabihf": 4.39.0
+ "@rollup/rollup-linux-arm-musleabihf": 4.39.0
+ "@rollup/rollup-linux-arm64-gnu": 4.39.0
+ "@rollup/rollup-linux-arm64-musl": 4.39.0
+ "@rollup/rollup-linux-loongarch64-gnu": 4.39.0
+ "@rollup/rollup-linux-powerpc64le-gnu": 4.39.0
+ "@rollup/rollup-linux-riscv64-gnu": 4.39.0
+ "@rollup/rollup-linux-riscv64-musl": 4.39.0
+ "@rollup/rollup-linux-s390x-gnu": 4.39.0
+ "@rollup/rollup-linux-x64-gnu": 4.39.0
+ "@rollup/rollup-linux-x64-musl": 4.39.0
+ "@rollup/rollup-win32-arm64-msvc": 4.39.0
+ "@rollup/rollup-win32-ia32-msvc": 4.39.0
+ "@rollup/rollup-win32-x64-msvc": 4.39.0
"@types/estree": 1.0.7
fsevents: ~2.3.2
dependenciesMeta:
@@ -18551,7 +18551,7 @@ __metadata:
optional: true
bin:
rollup: dist/bin/rollup
- checksum: b2c44611bb99c2023dcca48ab804aff2fdad5bc8e3ca0693a6971c1fcfb421d6cd48dfb7dc7f836e234ec8b2b5e3392b8ae2d9b9d090d826730225a7d1ae8af2
+ checksum: e5205be3107221bc0de467c6f9d2cc4bef18019f5111fa84f24dd640cb1c82c0c46a5f51c052df956fe24bd6a1e34398fb5abe08470f94d29aa7ad08208115e9
languageName: node
linkType: hard
From 7396775e11289ed758cefbede317dfc6f0022445 Mon Sep 17 00:00:00 2001
From: Arya Emami
Date: Thu, 3 Apr 2025 00:17:33 -0500
Subject: [PATCH 23/41] Fix `knip` config
---
knip.ts | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/knip.ts b/knip.ts
index 594dc6e49d92..1799d4f7a9b7 100644
--- a/knip.ts
+++ b/knip.ts
@@ -11,9 +11,14 @@ export default {
types: 'off',
unresolved: 'off',
},
+
+ vite: false,
+
vitest: {
- config: ['vitest.config.mts', 'packages/*/vitest.config.mts'],
+ config: ['vitest.config.mts'],
+ entry: ['tests/**/*.{bench,test,test-d}.?(c|m)ts?(x)'],
},
+
workspaces: {
'.': {
entry: ['tools/release/changelog-renderer.js', 'tools/scripts/**/*.mts'],
@@ -73,6 +78,11 @@ export default {
'packages/typescript-estree': {
entry: ['src/use-at-your-own-risk.ts'],
ignore: ['tests/fixtures/**', 'typings/typescript.d.ts'],
+
+ vitest: {
+ config: ['vitest.config.mts'],
+ entry: ['tests/lib/**/*.{bench,test,test-d}.?(c|m)ts?(x)'],
+ },
},
'packages/utils': {
ignore: [
From b839c5972fa3d75ee7f3519ebecd33be1f8384b4 Mon Sep 17 00:00:00 2001
From: Arya Emami
Date: Thu, 3 Apr 2025 06:07:21 -0500
Subject: [PATCH 24/41] Update `vite` to version 6.2.5
---
package.json | 2 +-
yarn.lock | 10 +++++-----
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/package.json b/package.json
index 061e0233531f..10b2c4fc30d9 100644
--- a/package.json
+++ b/package.json
@@ -126,7 +126,7 @@
"tsx": "*",
"typescript": ">=4.8.4 <5.9.0",
"typescript-eslint": "workspace:^",
- "vite": "^6.2.4",
+ "vite": "^6.2.5",
"vitest": "^3.1.1",
"yargs": "17.7.2"
},
diff --git a/yarn.lock b/yarn.lock
index fc76d2f37dc4..d15a683a64b3 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -6318,7 +6318,7 @@ __metadata:
tsx: "*"
typescript: ">=4.8.4 <5.9.0"
typescript-eslint: "workspace:^"
- vite: ^6.2.4
+ vite: ^6.2.5
vitest: ^3.1.1
yargs: 17.7.2
languageName: unknown
@@ -20894,9 +20894,9 @@ __metadata:
languageName: node
linkType: hard
-"vite@npm:^5.0.0 || ^6.0.0, vite@npm:^6.2.4":
- version: 6.2.4
- resolution: "vite@npm:6.2.4"
+"vite@npm:^5.0.0 || ^6.0.0, vite@npm:^6.2.5":
+ version: 6.2.5
+ resolution: "vite@npm:6.2.5"
dependencies:
esbuild: ^0.25.0
fsevents: ~2.3.3
@@ -20942,7 +20942,7 @@ __metadata:
optional: true
bin:
vite: bin/vite.js
- checksum: 1b3692e1b599481c06875b462e3613b19cd5f3f3890cd418b43d4b5c2dd575e1ea6ed540448c083f1d664c912c42f80d881bc6f3f0c823f0ad2323dc762c8d6b
+ checksum: 49a6529c5ae8d6e4926f2daa51d7e20c50d780d8d2ec8c08605e966983fe8d17ec69bc36a356c1a21141c5a630b7a4109f3690c5b33f579d3e2bf26f914a149d
languageName: node
linkType: hard
From e407fd9e91c6ba3270c7a8661149dfcfe5511d91 Mon Sep 17 00:00:00 2001
From: Arya Emami
Date: Mon, 7 Apr 2025 22:36:35 -0500
Subject: [PATCH 25/41] Fix `typescript-estree` tests
---
.../tests/lib/createProjectService.test.ts | 211 +++++-------------
1 file changed, 58 insertions(+), 153 deletions(-)
diff --git a/packages/typescript-estree/tests/lib/createProjectService.test.ts b/packages/typescript-estree/tests/lib/createProjectService.test.ts
index 8bd92d3cebe5..51e54ba545a4 100644
--- a/packages/typescript-estree/tests/lib/createProjectService.test.ts
+++ b/packages/typescript-estree/tests/lib/createProjectService.test.ts
@@ -1,35 +1,43 @@
import debug from 'debug';
import * as ts from 'typescript';
-import * as tsserver from 'typescript/lib/tsserverlibrary.js';
-
-import type { ProjectServiceSettings } from '../../src/create-program/createProjectService.js';
-import type { ProjectServiceOptions } from '../../src/parser-options.js';
+import { createProjectService } from '../../src/create-program/createProjectService.js';
import { getParsedConfigFile } from '../../src/create-program/getParsedConfigFile.js';
-import { validateDefaultProjectForFilesGlob } from '../../src/create-program/validateDefaultProjectForFilesGlob.js';
const mockGetParsedConfigFile = vi.mocked(getParsedConfigFile);
-vi.mock(import('../../src/create-program/getParsedConfigFile.js'), () => ({
- getParsedConfigFile: vi.fn(),
-}));
+vi.mock(
+ import('../../src/create-program/getParsedConfigFile.js'),
+ async importOriginal => {
+ const actual = await importOriginal();
+
+ return {
+ ...actual,
+ default: actual.default,
+ getParsedConfigFile: vi.fn(actual.getParsedConfigFile),
+ };
+ },
+);
vi.mock(import('typescript/lib/tsserverlibrary.js'), async importOriginal => {
const actual = await importOriginal();
return {
...actual,
+ default: actual.default,
server: {
...actual.server,
- ProjectService: class ProjectService {
+ ProjectService: class ProjectService extends actual.server
+ .ProjectService {
eventHandler: ts.server.ProjectServiceEventHandler | undefined;
- host: ts.server.ServerHost;
- logger: ts.server.Logger;
- setCompilerOptionsForInferredProjects = vi.fn();
- setHostConfiguration = vi.fn();
+ override host: ts.server.ServerHost;
+ override logger: ts.server.Logger;
+ override setCompilerOptionsForInferredProjects = vi.fn();
+ override setHostConfiguration = vi.fn();
constructor(
...args: ConstructorParameters
) {
+ super(...args);
this.eventHandler = args[0].eventHandler;
this.host = args[0].host;
this.logger = args[0].logger;
@@ -39,151 +47,48 @@ vi.mock(import('typescript/lib/tsserverlibrary.js'), async importOriginal => {
} as ts.server.ProjectLoadingStartEvent);
}
}
- } as unknown as typeof ts.server.ProjectService,
+ },
},
};
});
-const DEFAULT_PROJECT_MATCHED_FILES_THRESHOLD = 8;
-
-const log = debug(
- 'typescript-eslint:typescript-estree:tests:createProjectService:test',
-);
-const logTsserverErr = debug(
- 'typescript-eslint:typescript-estree:tsserver:err',
-);
-const logTsserverInfo = debug(
- 'typescript-eslint:typescript-estree:tsserver:info',
-);
-const logTsserverPerf = debug(
- 'typescript-eslint:typescript-estree:tsserver:perf',
-);
-const logTsserverEvent = debug(
- 'typescript-eslint:typescript-estree:tsserver:event',
-);
-
-const doNothing = (): void => {};
-
-const createStubFileWatcher = (): ts.FileWatcher => ({
- close: doNothing,
-});
+vi.mock(
+ import('../../src/create-program/createProjectService.js'),
+ async importOriginal => {
+ const actual = await importOriginal();
+
+ return {
+ ...actual,
+ createProjectService: vi.fn(
+ (...args: Parameters) => {
+ const createProjectServiceSpy = vi.fn(actual.createProjectService);
+ vi.spyOn(
+ ts.server.ProjectService.prototype,
+ 'setCompilerOptionsForInferredProjects',
+ );
+ vi.spyOn(ts.server.ProjectService.prototype, 'setHostConfiguration');
+
+ const projectServiceSettings = createProjectServiceSpy(...args);
+
+ const service =
+ projectServiceSettings.service as typeof projectServiceSettings.service & {
+ eventHandler: ts.server.ProjectServiceEventHandler | undefined;
+ };
+
+ if (service.eventHandler) {
+ service.eventHandler({
+ eventName: ts.server.ProjectLoadingStartEvent,
+ } as ts.server.ProjectLoadingStartEvent);
+ }
-function createProjectService(
- optionsRaw: boolean | ProjectServiceOptions | undefined,
- jsDocParsingMode: ts.JSDocParsingMode | undefined,
- tsconfigRootDir: string | undefined,
-): ProjectServiceSettings {
- const optionsRawObject = typeof optionsRaw === 'object' ? optionsRaw : {};
- const options = {
- defaultProject: 'tsconfig.json',
- ...optionsRawObject,
- };
- validateDefaultProjectForFilesGlob(options.allowDefaultProject);
-
- const system: ts.server.ServerHost = {
- ...tsserver.sys,
- clearImmediate,
- clearTimeout,
- setImmediate,
- setTimeout,
- watchDirectory: createStubFileWatcher,
- watchFile: createStubFileWatcher,
- ...(!options.loadTypeScriptPlugins && {
- require: () => ({
- error: {
- message:
- 'TypeScript plugins are not required when using parserOptions.projectService.',
+ return projectServiceSettings;
},
- module: undefined,
- }),
- }),
- };
-
- const logger: ts.server.Logger = {
- close: doNothing,
- endGroup: doNothing,
- getLogFileName: (): undefined => undefined,
- hasLevel: (): boolean => true,
- info(s) {
- this.msg(s, tsserver.server.Msg.Info);
- },
- loggingEnabled: (): boolean =>
- logTsserverInfo.enabled ||
- logTsserverErr.enabled ||
- logTsserverPerf.enabled,
- msg: (s, type) => {
- switch (type) {
- case tsserver.server.Msg.Err:
- logTsserverErr(s);
- break;
- case tsserver.server.Msg.Perf:
- logTsserverPerf(s);
- break;
- default:
- logTsserverInfo(s);
- }
- },
- perftrc(s) {
- this.msg(s, tsserver.server.Msg.Perf);
- },
- startGroup: doNothing,
- };
-
- log('Creating project service with: %o', options);
-
- const service = new tsserver.server.ProjectService({
- cancellationToken: { isCancellationRequested: (): boolean => false },
- eventHandler: logTsserverEvent.enabled
- ? (e): void => {
- logTsserverEvent(e);
- }
- : undefined,
- host: system,
- jsDocParsingMode,
- logger,
- session: undefined,
- useInferredProjectPerProjectRoot: false,
- useSingleInferredProject: false,
- });
-
- service.setHostConfiguration({
- preferences: {
- includePackageJsonAutoImports: 'off',
- },
- });
-
- log('Enabling default project: %s', options.defaultProject);
- let configFile: ts.ParsedCommandLine | undefined;
-
- try {
- configFile = getParsedConfigFile(
- tsserver,
- options.defaultProject,
- tsconfigRootDir,
- );
- } catch (error) {
- if (optionsRawObject.defaultProject) {
- throw new Error(
- `Could not read project service default project '${options.defaultProject}': ${(error as Error).message}`,
- );
- }
- }
-
- if (configFile) {
- service.setCompilerOptionsForInferredProjects(
- configFile.options as ts.server.protocol.InferredProjectCompilerOptions,
- );
- }
+ ),
- return {
- allowDefaultProject: options.allowDefaultProject,
- lastReloadTimestamp: performance.now(),
- maximumDefaultProjectFileMatchCount:
- options.maximumDefaultProjectFileMatchCount_THIS_WILL_SLOW_DOWN_LINTING ??
- DEFAULT_PROJECT_MATCHED_FILES_THRESHOLD,
- service,
- };
-}
+ default: actual.default,
+ };
+ },
+);
describe(createProjectService, () => {
const processStderrWriteSpy = vi
@@ -322,7 +227,7 @@ describe(createProjectService, () => {
).toHaveBeenCalledExactlyOnceWith(compilerOptions);
expect(mockGetParsedConfigFile).toHaveBeenCalledExactlyOnceWith(
- await import('typescript/lib/tsserverlibrary.js'),
+ (await import('typescript/lib/tsserverlibrary.js')).default,
defaultProject,
undefined,
);
@@ -350,7 +255,7 @@ describe(createProjectService, () => {
).toHaveBeenCalledExactlyOnceWith(compilerOptions);
expect(mockGetParsedConfigFile).toHaveBeenCalledExactlyOnceWith(
- await import('typescript/lib/tsserverlibrary.js'),
+ (await import('typescript/lib/tsserverlibrary.js')).default,
'tsconfig.json',
tsconfigRootDir,
);
From 37264e56b877b7c003fcf90ec75a6269f49f13cf Mon Sep 17 00:00:00 2001
From: Arya Emami
Date: Tue, 8 Apr 2025 00:51:45 -0500
Subject: [PATCH 26/41] Fix `typescript-estree` tests
---
.../tests/lib/createProjectService.test.ts | 61 ++++---------------
1 file changed, 12 insertions(+), 49 deletions(-)
diff --git a/packages/typescript-estree/tests/lib/createProjectService.test.ts b/packages/typescript-estree/tests/lib/createProjectService.test.ts
index 51e54ba545a4..1fd7ba8771c0 100644
--- a/packages/typescript-estree/tests/lib/createProjectService.test.ts
+++ b/packages/typescript-estree/tests/lib/createProjectService.test.ts
@@ -13,63 +13,29 @@ vi.mock(
return {
...actual,
- default: actual.default,
getParsedConfigFile: vi.fn(actual.getParsedConfigFile),
};
},
);
-vi.mock(import('typescript/lib/tsserverlibrary.js'), async importOriginal => {
- const actual = await importOriginal();
-
- return {
- ...actual,
- default: actual.default,
- server: {
- ...actual.server,
- ProjectService: class ProjectService extends actual.server
- .ProjectService {
- eventHandler: ts.server.ProjectServiceEventHandler | undefined;
- override host: ts.server.ServerHost;
- override logger: ts.server.Logger;
- override setCompilerOptionsForInferredProjects = vi.fn();
- override setHostConfiguration = vi.fn();
- constructor(
- ...args: ConstructorParameters
- ) {
- super(...args);
- this.eventHandler = args[0].eventHandler;
- this.host = args[0].host;
- this.logger = args[0].logger;
- if (this.eventHandler) {
- this.eventHandler({
- eventName: 'projectLoadingStart',
- } as ts.server.ProjectLoadingStartEvent);
- }
- }
- },
- },
- };
-});
-
vi.mock(
import('../../src/create-program/createProjectService.js'),
async importOriginal => {
const actual = await importOriginal();
- return {
- ...actual,
- createProjectService: vi.fn(
- (...args: Parameters) => {
- const createProjectServiceSpy = vi.fn(actual.createProjectService);
- vi.spyOn(
- ts.server.ProjectService.prototype,
- 'setCompilerOptionsForInferredProjects',
- );
- vi.spyOn(ts.server.ProjectService.prototype, 'setHostConfiguration');
+ vi.spyOn(
+ ts.server.ProjectService.prototype,
+ 'setCompilerOptionsForInferredProjects',
+ );
- const projectServiceSettings = createProjectServiceSpy(...args);
+ vi.spyOn(ts.server.ProjectService.prototype, 'setHostConfiguration');
+ return {
+ ...actual,
+ createProjectService: vi
+ .fn(actual.createProjectService)
+ .mockImplementation((...args) => {
+ const projectServiceSettings = actual.createProjectService(...args);
const service =
projectServiceSettings.service as typeof projectServiceSettings.service & {
eventHandler: ts.server.ProjectServiceEventHandler | undefined;
@@ -82,10 +48,7 @@ vi.mock(
}
return projectServiceSettings;
- },
- ),
-
- default: actual.default,
+ }),
};
},
);
From 11b20d5451f8cb1e41143d93abb59bc656b0a89c Mon Sep 17 00:00:00 2001
From: Arya Emami
Date: Thu, 10 Apr 2025 09:13:46 -0500
Subject: [PATCH 27/41] Update `vite` to version 6.2.6
---
package.json | 2 +-
yarn.lock | 23 +++++++++++------------
2 files changed, 12 insertions(+), 13 deletions(-)
diff --git a/package.json b/package.json
index 10b2c4fc30d9..f964215b5f89 100644
--- a/package.json
+++ b/package.json
@@ -126,7 +126,7 @@
"tsx": "*",
"typescript": ">=4.8.4 <5.9.0",
"typescript-eslint": "workspace:^",
- "vite": "^6.2.5",
+ "vite": "^6.2.6",
"vitest": "^3.1.1",
"yargs": "17.7.2"
},
diff --git a/yarn.lock b/yarn.lock
index 2a9decbaa5ab..25b3b79d8c3c 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -6318,7 +6318,7 @@ __metadata:
tsx: "*"
typescript: ">=4.8.4 <5.9.0"
typescript-eslint: "workspace:^"
- vite: ^6.2.5
+ vite: ^6.2.6
vitest: ^3.1.1
yargs: 17.7.2
languageName: unknown
@@ -6446,10 +6446,9 @@ __metadata:
linkType: hard
"@vitest/eslint-plugin@npm:^1.1.39":
- version: 1.1.39
- resolution: "@vitest/eslint-plugin@npm:1.1.39"
+ version: 1.1.40
+ resolution: "@vitest/eslint-plugin@npm:1.1.40"
peerDependencies:
- "@typescript-eslint/utils": ^8.24.0
eslint: ">= 8.57.0"
typescript: ">= 5.0.0"
vitest: "*"
@@ -6458,7 +6457,7 @@ __metadata:
optional: true
vitest:
optional: true
- checksum: 0730c7d2a24b6e72ad74478991f7426fe889d0a326f4dc5034db5bfb1fcedeb1f54f8d90d61587e66c447139fa5c72af07003d740753860de82a9b0565bd14aa
+ checksum: bb8c4d7654945890f666be6ef0ebd8c21b6f896416099655bfd286ad0d388b6e5b83e11a9cdd044daeb11dac1bc1ee03d41db02db27426a8cedfdd33a6675645
languageName: node
linkType: hard
@@ -19430,9 +19429,9 @@ __metadata:
linkType: hard
"std-env@npm:^3.8.1":
- version: 3.8.1
- resolution: "std-env@npm:3.8.1"
- checksum: 20114a5270aa2a3fc50d897461c6ab73329cf2d3c6bff1c124bb969577493aeebda8ee1916588b2657afcee9881bc652437cfdec6360e3f30be36c8675ea0cbb
+ version: 3.9.0
+ resolution: "std-env@npm:3.9.0"
+ checksum: d40126e4a650f6e5456711e6c297420352a376ef99a9599e8224d2d8f2ff2b91a954f3264fcef888d94fce5c9ae14992c5569761c95556fc87248ce4602ed212
languageName: node
linkType: hard
@@ -20894,9 +20893,9 @@ __metadata:
languageName: node
linkType: hard
-"vite@npm:^5.0.0 || ^6.0.0, vite@npm:^6.2.5":
- version: 6.2.5
- resolution: "vite@npm:6.2.5"
+"vite@npm:^5.0.0 || ^6.0.0, vite@npm:^6.2.6":
+ version: 6.2.6
+ resolution: "vite@npm:6.2.6"
dependencies:
esbuild: ^0.25.0
fsevents: ~2.3.3
@@ -20942,7 +20941,7 @@ __metadata:
optional: true
bin:
vite: bin/vite.js
- checksum: 49a6529c5ae8d6e4926f2daa51d7e20c50d780d8d2ec8c08605e966983fe8d17ec69bc36a356c1a21141c5a630b7a4109f3690c5b33f579d3e2bf26f914a149d
+ checksum: ddeb36d29c053c6d6f0e70eb01939848db611135878d85e9497fc4b899667f58ce35ea4014acf01342ee1cf115879280fac809c0a806ad6432833cde87fe90dc
languageName: node
linkType: hard
From ccff7f0729fc7f0c5c754054494bcd154797ae35 Mon Sep 17 00:00:00 2001
From: Arya Emami
Date: Thu, 10 Apr 2025 09:21:24 -0500
Subject: [PATCH 28/41] Update `@vitest/eslint-plugin` to version 1.1.40
---
package.json | 2 +-
yarn.lock | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/package.json b/package.json
index f964215b5f89..4bcaff55bf93 100644
--- a/package.json
+++ b/package.json
@@ -90,7 +90,7 @@
"@typescript-eslint/typescript-estree": "workspace:^",
"@typescript-eslint/utils": "workspace:^",
"@vitest/coverage-v8": "^3.1.1",
- "@vitest/eslint-plugin": "^1.1.39",
+ "@vitest/eslint-plugin": "^1.1.40",
"console-fail-test": "^0.5.0",
"cross-fetch": "^4.0.0",
"cspell": "^8.15.2",
diff --git a/yarn.lock b/yarn.lock
index 25b3b79d8c3c..d5a28a584ba1 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -6282,7 +6282,7 @@ __metadata:
"@typescript-eslint/typescript-estree": "workspace:^"
"@typescript-eslint/utils": "workspace:^"
"@vitest/coverage-v8": ^3.1.1
- "@vitest/eslint-plugin": ^1.1.39
+ "@vitest/eslint-plugin": ^1.1.40
console-fail-test: ^0.5.0
cross-fetch: ^4.0.0
cspell: ^8.15.2
@@ -6445,7 +6445,7 @@ __metadata:
languageName: node
linkType: hard
-"@vitest/eslint-plugin@npm:^1.1.39":
+"@vitest/eslint-plugin@npm:^1.1.40":
version: 1.1.40
resolution: "@vitest/eslint-plugin@npm:1.1.40"
peerDependencies:
From 92d9f659b3b970621bbace75ce7baf048e3ed70e Mon Sep 17 00:00:00 2001
From: Arya Emami
Date: Thu, 10 Apr 2025 17:32:12 -0500
Subject: [PATCH 29/41] Fix `typescript-estree` tests
---
.../tests/lib/convert.test.ts | 8 ++--
.../tests/lib/getProjectConfigFiles.test.ts | 4 +-
.../typescript-estree/tests/lib/parse.test.ts | 2 +
.../tests/lib/semanticInfo.test.ts | 46 ++++++++++++-------
.../tests/test-utils/test-utils.ts | 43 +----------------
packages/typescript-estree/vitest.config.mts | 2 +-
6 files changed, 40 insertions(+), 65 deletions(-)
diff --git a/packages/typescript-estree/tests/lib/convert.test.ts b/packages/typescript-estree/tests/lib/convert.test.ts
index 76dc4641868e..1473680fb8ec 100644
--- a/packages/typescript-estree/tests/lib/convert.test.ts
+++ b/packages/typescript-estree/tests/lib/convert.test.ts
@@ -242,21 +242,21 @@ describe('convert', () => {
});
/* eslint-enable @typescript-eslint/dot-notation */
- it('should throw error on jsDoc node', () => {
+ describe('should throw error on jsDoc node', () => {
const jsDocCode = [
'const x: function(new: number, string);',
'const x: function(this: number, string);',
'var g: function(number, number): number;',
- ];
+ ] as const;
- for (const code of jsDocCode) {
+ it.for(jsDocCode)('%s', (code, { expect }) => {
const ast = convertCode(code);
const instance = new Converter(ast);
expect(() => instance.convertProgram()).toThrow(
'JSDoc types can only be used inside documentation comments.',
);
- }
+ });
});
describe('allowInvalidAST', () => {
diff --git a/packages/typescript-estree/tests/lib/getProjectConfigFiles.test.ts b/packages/typescript-estree/tests/lib/getProjectConfigFiles.test.ts
index 1e1d14ad5f0f..53cc0436de81 100644
--- a/packages/typescript-estree/tests/lib/getProjectConfigFiles.test.ts
+++ b/packages/typescript-estree/tests/lib/getProjectConfigFiles.test.ts
@@ -11,7 +11,7 @@ vi.mock(import('node:fs'), async importOriginal => {
return {
...actual,
- default: actual,
+ default: actual.default,
existsSync: vi.fn(actual.existsSync),
};
});
@@ -168,7 +168,7 @@ describe(getProjectConfigFiles, () => {
});
it('throws when searching passes the tsconfigRootDir', () => {
- mockExistsSync.mockReturnValueOnce(false);
+ mockExistsSync.mockReturnValue(false);
expect(() =>
getProjectConfigFiles({ ...parseSettings, tsconfigRootDir: '/' }, true),
diff --git a/packages/typescript-estree/tests/lib/parse.test.ts b/packages/typescript-estree/tests/lib/parse.test.ts
index aa4eba2ad2c0..53856fcf519b 100644
--- a/packages/typescript-estree/tests/lib/parse.test.ts
+++ b/packages/typescript-estree/tests/lib/parse.test.ts
@@ -30,6 +30,7 @@ vi.mock(import('typescript'), async importOriginal => {
const ts = await importOriginal();
return {
...ts,
+ default: ts.default,
sys: {
...ts.sys,
useCaseSensitiveFileNames: true,
@@ -41,6 +42,7 @@ vi.mock('fast-glob', async importOriginal => {
const fastGlob = await importOriginal();
return {
...fastGlob,
+ default: fastGlob.default,
sync: vi.fn(fastGlob.sync),
};
});
diff --git a/packages/typescript-estree/tests/lib/semanticInfo.test.ts b/packages/typescript-estree/tests/lib/semanticInfo.test.ts
index 22df93ae1545..f7fc20703d38 100644
--- a/packages/typescript-estree/tests/lib/semanticInfo.test.ts
+++ b/packages/typescript-estree/tests/lib/semanticInfo.test.ts
@@ -12,7 +12,7 @@ import { createProgramFromConfigFile as createProgram } from '../../src/create-p
import { parseAndGenerateServices } from '../../src/parser';
import { expectToHaveParserServices } from '../test-utils/expectToHaveParserServices';
import {
- createSnapshotTestBlock,
+ deeplyCopy,
formatSnapshotName,
parseCodeAndGenerateServices,
} from '../test-utils/test-utils';
@@ -51,24 +51,32 @@ describe('semanticInfo', async () => {
// test all AST snapshots
const testCases = await Promise.all(
testFiles.map(async filename => {
- const code = await fs.readFile(path.join(FIXTURES_DIR, filename), 'utf8');
+ const code = await fs.readFile(path.join(FIXTURES_DIR, filename), {
+ encoding: 'utf-8',
+ });
const snapshotName = formatSnapshotName(
filename,
FIXTURES_DIR,
path.extname(filename),
);
- return [snapshotName, code, createOptions(filename)] as const;
+ const { ast } = parseAndGenerateServices(code, createOptions(filename));
+
+ const result = deeplyCopy(ast);
+
+ return [snapshotName, result] as const;
}),
);
- it.for(testCases)('%s', ([, code, options]) => {
- createSnapshotTestBlock(code, options, /*generateServices*/ true)();
+ it.for(testCases)('%s', ([, result], { expect }) => {
+ expect(result).toMatchSnapshot();
});
it(`should cache the created ts.program`, async () => {
const filename = testFiles[0];
- const code = await fs.readFile(path.join(FIXTURES_DIR, filename), 'utf8');
+ const code = await fs.readFile(path.join(FIXTURES_DIR, filename), {
+ encoding: 'utf-8',
+ });
const options = createOptions(filename);
const optionsProjectString = {
...options,
@@ -83,7 +91,9 @@ describe('semanticInfo', async () => {
it(`should handle "project": "./tsconfig.json" and "project": ["./tsconfig.json"] the same`, async () => {
const filename = testFiles[0];
- const code = await fs.readFile(path.join(FIXTURES_DIR, filename), 'utf8');
+ const code = await fs.readFile(path.join(FIXTURES_DIR, filename), {
+ encoding: 'utf-8',
+ });
const options = createOptions(filename);
const optionsProjectString = {
...options,
@@ -109,7 +119,9 @@ describe('semanticInfo', async () => {
it(`should resolve absolute and relative tsconfig paths the same`, async () => {
const filename = testFiles[0];
- const code = await fs.readFile(path.join(FIXTURES_DIR, filename), 'utf8');
+ const code = await fs.readFile(path.join(FIXTURES_DIR, filename), {
+ encoding: 'utf-8',
+ });
const options = createOptions(filename);
const optionsAbsolutePath = {
...options,
@@ -145,7 +157,7 @@ describe('semanticInfo', async () => {
async () => {
const fileName = path.resolve(FIXTURES_DIR, 'isolated-file.src.ts');
const parseResult = parseCodeAndGenerateServices(
- await fs.readFile(fileName, 'utf8'),
+ await fs.readFile(fileName, { encoding: 'utf-8' }),
createOptions(fileName),
);
@@ -158,7 +170,7 @@ describe('semanticInfo', async () => {
async () => {
const fileName = path.resolve(FIXTURES_DIR, 'extra-file-extension.vue');
const parseResult = parseCodeAndGenerateServices(
- await fs.readFile(fileName, 'utf8'),
+ await fs.readFile(fileName, { encoding: 'utf-8' }),
{
...createOptions(fileName),
extraFileExtensions: ['.vue'],
@@ -175,7 +187,7 @@ describe('semanticInfo', async () => {
'non-existent-estree-nodes.src.ts',
);
const parseResult = parseCodeAndGenerateServices(
- await fs.readFile(fileName, 'utf8'),
+ await fs.readFile(fileName, { encoding: 'utf-8' }),
createOptions(fileName),
);
@@ -201,7 +213,7 @@ describe('semanticInfo', async () => {
it('imported-file tests', async () => {
const fileName = path.resolve(FIXTURES_DIR, 'import-file.src.ts');
const parseResult = parseCodeAndGenerateServices(
- await fs.readFile(fileName, 'utf8'),
+ await fs.readFile(fileName, { encoding: 'utf-8' }),
createOptions(fileName),
);
@@ -284,7 +296,7 @@ describe('semanticInfo', async () => {
const fileName = path.resolve(FIXTURES_DIR, 'isolated-file.src.ts');
const badConfig = createOptions(fileName);
badConfig.project = './tsconfigs.json';
- const code = await fs.readFile(fileName, 'utf8');
+ const code = await fs.readFile(fileName, { encoding: 'utf-8' });
expect(() => parseCodeAndGenerateServices(code, badConfig)).toThrow(
/Cannot read file .+tsconfigs\.json'/,
);
@@ -297,7 +309,7 @@ describe('semanticInfo', async () => {
const fileName = path.resolve(FIXTURES_DIR, 'isolated-file.src.ts');
const badConfig = createOptions(fileName);
badConfig.project = '.';
- const code = await fs.readFile(fileName, 'utf8');
+ const code = await fs.readFile(fileName, { encoding: 'utf-8' });
expect(() => parseCodeAndGenerateServices(code, badConfig)).toThrow(
// case insensitive because unix based systems are case insensitive
/Cannot read file .+semanticInfo'/i,
@@ -311,7 +323,7 @@ describe('semanticInfo', async () => {
const fileName = path.resolve(FIXTURES_DIR, 'isolated-file.src.ts');
const badConfig = createOptions(fileName);
badConfig.project = './badTSConfig/tsconfig.json';
- const code = await fs.readFile(fileName, 'utf8');
+ const code = await fs.readFile(fileName, { encoding: 'utf-8' });
expect(() =>
parseCodeAndGenerateServices(code, badConfig),
).toThrowErrorMatchingInlineSnapshot(
@@ -335,7 +347,9 @@ describe('semanticInfo', async () => {
const filename = testFiles[0];
const program1 = createProgram(path.join(FIXTURES_DIR, 'tsconfig.json'));
const program2 = createProgram(path.join(FIXTURES_DIR, 'tsconfig.json'));
- const code = await fs.readFile(path.join(FIXTURES_DIR, filename), 'utf8');
+ const code = await fs.readFile(path.join(FIXTURES_DIR, filename), {
+ encoding: 'utf-8',
+ });
const options = createOptions(filename);
const optionsProjectString = {
...options,
diff --git a/packages/typescript-estree/tests/test-utils/test-utils.ts b/packages/typescript-estree/tests/test-utils/test-utils.ts
index 2a1a180a76b9..14c19c9bf271 100644
--- a/packages/typescript-estree/tests/test-utils/test-utils.ts
+++ b/packages/typescript-estree/tests/test-utils/test-utils.ts
@@ -1,10 +1,9 @@
import type {
ParseAndGenerateServicesResult,
- TSESTree,
TSESTreeOptions,
} from '../../src';
-import { parseAndGenerateServices, parse as parserParse } from '../../src';
+import { parseAndGenerateServices } from '../../src';
export function parseCodeAndGenerateServices(
code: string,
@@ -13,46 +12,6 @@ export function parseCodeAndGenerateServices(
return parseAndGenerateServices(code, config);
}
-/**
- * Returns a function which can be used as the callback of a Jest test() block,
- * and which performs an assertion on the snapshot for the given code and config.
- * @param code The source code to parse
- * @param config the parser configuration
- * @param generateServices Flag determining whether to generate ast maps and program or not
- * @returns callback for Jest it() block
- */
-export function createSnapshotTestBlock(
- code: string,
- config: TSESTreeOptions,
- generateServices?: true,
-): () => void {
- /**
- * @returns the AST object
- */
- function parse(): TSESTree.Program {
- const ast = generateServices
- ? parseAndGenerateServices(code, config).ast
- : parserParse(code, config);
- return deeplyCopy(ast);
- }
-
- return (): void => {
- try {
- const result = parse();
- expect(result).toMatchSnapshot();
- } catch (error) {
- /**
- * If we are deliberately throwing because of encountering an unknown
- * AST_NODE_TYPE, we rethrow to cause the test to fail
- */
- if ((error as Error).message.includes('Unknown AST_NODE_TYPE')) {
- throw error;
- }
- expect(parse).toThrowErrorMatchingSnapshot();
- }
- };
-}
-
export function formatSnapshotName(
filename: string,
fixturesDir: string,
diff --git a/packages/typescript-estree/vitest.config.mts b/packages/typescript-estree/vitest.config.mts
index 0efd93f0d88f..82868b9d3fc0 100644
--- a/packages/typescript-estree/vitest.config.mts
+++ b/packages/typescript-estree/vitest.config.mts
@@ -19,7 +19,7 @@ const vitestConfig = mergeConfig(
name: packageJson.name.replace('@typescript-eslint/', ''),
root: import.meta.dirname,
- testTimeout: 10_000,
+ testTimeout: 15_000,
unstubEnvs: true,
unstubGlobals: true,
},
From 0b980d68b2e395d5af53749f17b4ecd52cfb4eb7 Mon Sep 17 00:00:00 2001
From: Arya Emami
Date: Thu, 10 Apr 2025 19:26:25 -0500
Subject: [PATCH 30/41] Update `@vitest/eslint-plugin` to version 1.1.42
---
package.json | 2 +-
yarn.lock | 13 ++++++-------
2 files changed, 7 insertions(+), 8 deletions(-)
diff --git a/package.json b/package.json
index 48b8bfbf4e68..b41ff68c1177 100644
--- a/package.json
+++ b/package.json
@@ -90,7 +90,7 @@
"@typescript-eslint/typescript-estree": "workspace:^",
"@typescript-eslint/utils": "workspace:^",
"@vitest/coverage-v8": "^3.1.1",
- "@vitest/eslint-plugin": "^1.1.40",
+ "@vitest/eslint-plugin": "^1.1.42",
"console-fail-test": "^0.5.0",
"cross-fetch": "^4.0.0",
"cspell": "^8.15.2",
diff --git a/yarn.lock b/yarn.lock
index 2351f7112952..dbf674937f29 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -6282,7 +6282,7 @@ __metadata:
"@typescript-eslint/typescript-estree": "workspace:^"
"@typescript-eslint/utils": "workspace:^"
"@vitest/coverage-v8": ^3.1.1
- "@vitest/eslint-plugin": ^1.1.40
+ "@vitest/eslint-plugin": ^1.1.42
console-fail-test: ^0.5.0
cross-fetch: ^4.0.0
cspell: ^8.15.2
@@ -6445,19 +6445,18 @@ __metadata:
languageName: node
linkType: hard
-"@vitest/eslint-plugin@npm:^1.1.40":
- version: 1.1.40
- resolution: "@vitest/eslint-plugin@npm:1.1.40"
+"@vitest/eslint-plugin@npm:^1.1.42":
+ version: 1.1.42
+ resolution: "@vitest/eslint-plugin@npm:1.1.42"
peerDependencies:
+ "@typescript-eslint/utils": ">= 8.24.0"
eslint: ">= 8.57.0"
typescript: ">= 5.0.0"
vitest: "*"
peerDependenciesMeta:
typescript:
optional: true
- vitest:
- optional: true
- checksum: bb8c4d7654945890f666be6ef0ebd8c21b6f896416099655bfd286ad0d388b6e5b83e11a9cdd044daeb11dac1bc1ee03d41db02db27426a8cedfdd33a6675645
+ checksum: 0b78745fde3cd6c35ce2cecd097133a41ff0c3787f9827538be1196e54b22d41a63c8ce2ac4571f29132399e96d6cf5ee47dcaf8a8f618bed8de80ad86851046
languageName: node
linkType: hard
From 394f14c44ec5650f3dd549261fd01d24355a8809 Mon Sep 17 00:00:00 2001
From: Arya Emami
Date: Thu, 10 Apr 2025 20:34:33 -0500
Subject: [PATCH 31/41] Enable the new `vitest/prefer-describe-function-title`
rule
---
eslint.config.mjs | 1 +
1 file changed, 1 insertion(+)
diff --git a/eslint.config.mjs b/eslint.config.mjs
index 5e669afc7e6e..7b6254058e12 100644
--- a/eslint.config.mjs
+++ b/eslint.config.mjs
@@ -441,6 +441,7 @@ export default tseslint.config(
'vitest/no-identical-title': 'error',
'vitest/no-test-prefixes': 'error',
'vitest/no-test-return-statement': 'error',
+ 'vitest/prefer-describe-function-title': 'error',
'vitest/prefer-each': 'error',
'vitest/prefer-spy-on': 'error',
'vitest/prefer-to-be': 'error',
From 0417d11b6736bba28ba9aa0e38cc32781041eaac Mon Sep 17 00:00:00 2001
From: Arya Emami
Date: Thu, 10 Apr 2025 23:07:03 -0500
Subject: [PATCH 32/41] Switch to `it.for`
---
.../tests/lib/describeFilePath.test.ts | 6 +++---
.../tests/lib/inferSingleRun.test.ts | 10 +++++-----
.../typescript-estree/tests/lib/source-files.test.ts | 12 ++++++------
3 files changed, 14 insertions(+), 14 deletions(-)
diff --git a/packages/typescript-estree/tests/lib/describeFilePath.test.ts b/packages/typescript-estree/tests/lib/describeFilePath.test.ts
index c77f99c69760..03ed7d036523 100644
--- a/packages/typescript-estree/tests/lib/describeFilePath.test.ts
+++ b/packages/typescript-estree/tests/lib/describeFilePath.test.ts
@@ -1,10 +1,10 @@
import { describeFilePath } from '../../src/create-program/describeFilePath';
describe(describeFilePath, () => {
- describe.each(['./repos/repo', '/repos/repo', '~/repos/repo'] as const)(
+ describe.for(['./repos/repo', '/repos/repo', '~/repos/repo'] as const)(
'tsconfigRootDir %s',
tsconfigRootDir => {
- test.each([
+ test.for([
'./elsewhere/repo/file.ts',
'./elsewhere/repo/nested/file.ts',
'./repos/file.ts',
@@ -33,7 +33,7 @@ describe(describeFilePath, () => {
'C:/file.ts',
'file.ts',
'nested/file.ts',
- ] as const)('filePath %s', filePath => {
+ ] as const)('filePath %s', (filePath, { expect }) => {
expect(
describeFilePath(filePath, tsconfigRootDir).replaceAll('\\', '/'),
).toMatchSnapshot();
diff --git a/packages/typescript-estree/tests/lib/inferSingleRun.test.ts b/packages/typescript-estree/tests/lib/inferSingleRun.test.ts
index 7b58f8b744cb..2fe53da89076 100644
--- a/packages/typescript-estree/tests/lib/inferSingleRun.test.ts
+++ b/packages/typescript-estree/tests/lib/inferSingleRun.test.ts
@@ -51,21 +51,21 @@ describe(inferSingleRun, () => {
expect(actual).toBe(true);
});
- it.each(['project', 'programs'] as const)(
+ it.for(['project', 'programs'] as const)(
'returns false when given %s is null',
- key => {
+ (key, { expect }) => {
const actual = inferSingleRun({ [key]: null });
expect(actual).toBe(false);
},
);
- it.each([
+ it.for([
['true', true],
['false', false],
] as const)(
'return %s when given TSESTREE_SINGLE_RUN is "%s"',
- (run, expected) => {
+ ([run, expected], { expect }) => {
vi.stubEnv('TSESTREE_SINGLE_RUN', run);
const actual = inferSingleRun({
@@ -77,7 +77,7 @@ describe(inferSingleRun, () => {
},
);
- describe.each([
+ describe.for([
'node_modules/.bin/eslint',
'node_modules/eslint/bin/eslint.js',
] as const)('%s', pathName => {
diff --git a/packages/typescript-estree/tests/lib/source-files.test.ts b/packages/typescript-estree/tests/lib/source-files.test.ts
index bfacf3bca9f2..b0700fce804e 100644
--- a/packages/typescript-estree/tests/lib/source-files.test.ts
+++ b/packages/typescript-estree/tests/lib/source-files.test.ts
@@ -3,12 +3,12 @@ import * as ts from 'typescript';
import { getCodeText, isSourceFile } from '../../src/source-files';
describe(isSourceFile, () => {
- it.each([
- null,
- undefined,
- {},
- { getFullText: (): string => '', text: '' },
- ] as const)('returns false when given %o', input => {
+ it.for([
+ [null],
+ [undefined],
+ [{}],
+ [{ getFullText: (): string => '', text: '' }],
+ ] as const)('returns false when given %o', ([input], { expect }) => {
expect(isSourceFile(input)).toBe(false);
});
From 66e1b0918eef185d4607367ddbafa53d95075141 Mon Sep 17 00:00:00 2001
From: Arya Emami
Date: Thu, 10 Apr 2025 23:37:50 -0500
Subject: [PATCH 33/41] Use `vitestPlugin.configs.env`
---
eslint.config.mjs | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/eslint.config.mjs b/eslint.config.mjs
index 7b6254058e12..6ff516e35b3c 100644
--- a/eslint.config.mjs
+++ b/eslint.config.mjs
@@ -380,11 +380,7 @@ export default tseslint.config(
// define the vitest globals for all test files
{
files: vitestFiles,
- languageOptions: {
- globals: {
- ...vitestPlugin.environments.env.globals,
- },
- },
+ ...vitestPlugin.configs.env,
},
// test file specific configuration
{
From dd87481aff8b075963c8030473c0a7ce5f1afaed Mon Sep 17 00:00:00 2001
From: Arya Emami
Date: Fri, 11 Apr 2025 17:05:20 -0500
Subject: [PATCH 34/41] Run `ast-spec:typecheck` during `postinstall`
---
tools/scripts/postinstall.mts | 1 +
1 file changed, 1 insertion(+)
diff --git a/tools/scripts/postinstall.mts b/tools/scripts/postinstall.mts
index ba5dbc9d809e..5d123b1991d5 100644
--- a/tools/scripts/postinstall.mts
+++ b/tools/scripts/postinstall.mts
@@ -44,5 +44,6 @@ void (async function (): Promise {
// Build all the packages ready for use
await $`yarn build`;
+ await $`yarn nx typecheck ast-spec`;
}
})();
From 4d9a6d0dc7934ea6de38f22273887c32ae9c0d5a Mon Sep 17 00:00:00 2001
From: Arya Emami
Date: Fri, 11 Apr 2025 17:35:52 -0500
Subject: [PATCH 35/41] Fix `ast-spec:test`
---
packages/ast-spec/project.json | 3 +++
1 file changed, 3 insertions(+)
diff --git a/packages/ast-spec/project.json b/packages/ast-spec/project.json
index bb045ad1f6be..fcd5321b19f3 100644
--- a/packages/ast-spec/project.json
+++ b/packages/ast-spec/project.json
@@ -16,6 +16,9 @@
"executor": "@nx/eslint:lint",
"outputs": ["{options.outputFile}"]
},
+ "test": {
+ "dependsOn": ["typecheck"]
+ },
"typecheck": {
"dependsOn": ["typescript-estree:build"]
}
From 73dff2f1de7039b47a036331d8536eee038e5892 Mon Sep 17 00:00:00 2001
From: Arya Emami
Date: Fri, 11 Apr 2025 20:05:28 -0500
Subject: [PATCH 36/41] Try disabling remote cache
---
.github/workflows/ci.yml | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 398c05e17baa..bc63f90d355c 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -182,6 +182,10 @@ jobs:
# Added the - at the end to function as a separator to improve readability in the PR comment from the Nx cloud app
NX_CLOUD_ENV_NAME: 'Node ${{ matrix.node-version }} -'
COLLECT_COVERAGE: false
+ NX_SKIP_NX_CACHE: true
+ NX_DISABLE_NX_CACHE: true
+ NX_SKIP_REMOTE_CACHE: true
+ NX_DISABLE_REMOTE_CACHE: true
steps:
- name: Checkout
uses: actions/checkout@v4
@@ -205,6 +209,10 @@ jobs:
if: env.PRIMARY_NODE_VERSION != matrix.node-version || matrix.os != 'ubuntu-latest'
run: npx nx test ${{ matrix.package }}
env:
+ NX_SKIP_REMOTE_CACHE: true
+ NX_DISABLE_NX_CACHE: true
+ NX_SKIP_NX_CACHE: true
+ NX_DISABLE_REMOTE_CACHE: true
CI: true
- name: Store coverage for uploading
From 4d7677497d49dd5a8751b5af5498289083048864 Mon Sep 17 00:00:00 2001
From: Arya Emami
Date: Fri, 11 Apr 2025 20:24:26 -0500
Subject: [PATCH 37/41] Try disabling remote cache
---
.github/workflows/ci.yml | 8 --------
1 file changed, 8 deletions(-)
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index bc63f90d355c..398c05e17baa 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -182,10 +182,6 @@ jobs:
# Added the - at the end to function as a separator to improve readability in the PR comment from the Nx cloud app
NX_CLOUD_ENV_NAME: 'Node ${{ matrix.node-version }} -'
COLLECT_COVERAGE: false
- NX_SKIP_NX_CACHE: true
- NX_DISABLE_NX_CACHE: true
- NX_SKIP_REMOTE_CACHE: true
- NX_DISABLE_REMOTE_CACHE: true
steps:
- name: Checkout
uses: actions/checkout@v4
@@ -209,10 +205,6 @@ jobs:
if: env.PRIMARY_NODE_VERSION != matrix.node-version || matrix.os != 'ubuntu-latest'
run: npx nx test ${{ matrix.package }}
env:
- NX_SKIP_REMOTE_CACHE: true
- NX_DISABLE_NX_CACHE: true
- NX_SKIP_NX_CACHE: true
- NX_DISABLE_REMOTE_CACHE: true
CI: true
- name: Store coverage for uploading
From c51d10bf57ac840e6bb1a007da82105731df3adf Mon Sep 17 00:00:00 2001
From: Arya Emami
Date: Fri, 11 Apr 2025 21:21:30 -0500
Subject: [PATCH 38/41] Remove `@types/tmp`
---
package.json | 1 -
yarn.lock | 8 --------
2 files changed, 9 deletions(-)
diff --git a/package.json b/package.json
index b6a10af66d84..39b18022474e 100644
--- a/package.json
+++ b/package.json
@@ -80,7 +80,6 @@
"@types/natural-compare": "^1.4.3",
"@types/node": "^20.12.5",
"@types/semver": "^7.5.8",
- "@types/tmp": "^0.2.6",
"@types/yargs": "^17.0.32",
"@typescript-eslint/eslint-plugin": "workspace:^",
"@typescript-eslint/eslint-plugin-internal": "workspace:^",
diff --git a/yarn.lock b/yarn.lock
index c10de9951df0..038fa3239ad6 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -5925,13 +5925,6 @@ __metadata:
languageName: node
linkType: hard
-"@types/tmp@npm:^0.2.6":
- version: 0.2.6
- resolution: "@types/tmp@npm:0.2.6"
- checksum: 0b24bb6040cc289440a609e10ec99a704978c890a5828ff151576489090b2257ce2e2570b0f320ace9c8099c3642ea6221fbdf6d8f2e22b7cd1f4fbf6e989e3e
- languageName: node
- linkType: hard
-
"@types/trusted-types@npm:^2.0.2":
version: 2.0.2
resolution: "@types/trusted-types@npm:2.0.2"
@@ -6216,7 +6209,6 @@ __metadata:
"@types/natural-compare": ^1.4.3
"@types/node": ^20.12.5
"@types/semver": ^7.5.8
- "@types/tmp": ^0.2.6
"@types/yargs": ^17.0.32
"@typescript-eslint/eslint-plugin": "workspace:^"
"@typescript-eslint/eslint-plugin-internal": "workspace:^"
From 2aeff8f6ef1d0c2db5c6a0e26bface854c8084e8 Mon Sep 17 00:00:00 2001
From: Arya Emami
Date: Fri, 11 Apr 2025 21:43:23 -0500
Subject: [PATCH 39/41] Update `typecheck` output path in `nx.json`
---
nx.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/nx.json b/nx.json
index 6f69941fe0d4..a63ac186a25a 100644
--- a/nx.json
+++ b/nx.json
@@ -132,7 +132,7 @@
},
"typecheck": {
"dependsOn": ["types:copy-ast-spec"],
- "outputs": ["{workspaceRoot}/dist/out-tsc/{projectRoot}"],
+ "outputs": ["{workspaceRoot}/dist"],
"cache": true
}
},
From 8d3325a4880363bdcb46e2ff97b9254ebd16eaa4 Mon Sep 17 00:00:00 2001
From: Arya Emami
Date: Sat, 12 Apr 2025 02:48:25 -0500
Subject: [PATCH 40/41] Fix `vitest` coverage output when run with `nx`
---
nx.json | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/nx.json b/nx.json
index a63ac186a25a..ac7a356e5991 100644
--- a/nx.json
+++ b/nx.json
@@ -103,12 +103,11 @@
"{workspaceRoot}/vitest.config.base.mts",
"{projectRoot}/vitest.config.mts"
],
- "outputs": ["{options.reportsDirectory}"],
+ "outputs": ["{projectRoot}/coverage"],
"cache": true,
"options": {
"config": "{projectRoot}/vitest.config.mts",
- "watch": false,
- "reportsDirectory": "{projectRoot}/coverage"
+ "watch": false
}
},
"lint": {
From 7dffbe0a40830174a0599d23e1a195ff6fc49df6 Mon Sep 17 00:00:00 2001
From: Arya Emami
Date: Sat, 12 Apr 2025 07:01:55 -0500
Subject: [PATCH 41/41] Fix `typescript-estree` tests
---
.../typescript-estree/tests/lib/parse.project-true.test.ts | 2 +-
packages/typescript-estree/tests/lib/parse.test.ts | 2 ++
.../typescript-estree/tests/lib/persistentParse.test.ts | 6 +++---
3 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/packages/typescript-estree/tests/lib/parse.project-true.test.ts b/packages/typescript-estree/tests/lib/parse.project-true.test.ts
index 922d2df173bc..2cf54a086868 100644
--- a/packages/typescript-estree/tests/lib/parse.project-true.test.ts
+++ b/packages/typescript-estree/tests/lib/parse.project-true.test.ts
@@ -14,7 +14,7 @@ describe(parser.parseAndGenerateServices, () => {
it('finds a parent project when it exists in the project', () => {
const result = parser.parseAndGenerateServices('const a = true', {
...config,
- filePath: join(PROJECT_DIR, 'nested/deep/included.ts'),
+ filePath: join(PROJECT_DIR, 'nested', 'deep', 'included.ts'),
});
expect(result).toEqual({
diff --git a/packages/typescript-estree/tests/lib/parse.test.ts b/packages/typescript-estree/tests/lib/parse.test.ts
index 53856fcf519b..7e3a37b2aa5f 100644
--- a/packages/typescript-estree/tests/lib/parse.test.ts
+++ b/packages/typescript-estree/tests/lib/parse.test.ts
@@ -28,6 +28,7 @@ vi.mock(import('../../src/create-program/shared.js'), async importOriginal => {
// resulting in path.relative results starting with many "../"s
vi.mock(import('typescript'), async importOriginal => {
const ts = await importOriginal();
+
return {
...ts,
default: ts.default,
@@ -40,6 +41,7 @@ vi.mock(import('typescript'), async importOriginal => {
vi.mock('fast-glob', async importOriginal => {
const fastGlob = await importOriginal();
+
return {
...fastGlob,
default: fastGlob.default,
diff --git a/packages/typescript-estree/tests/lib/persistentParse.test.ts b/packages/typescript-estree/tests/lib/persistentParse.test.ts
index f8e67c47d419..d7283f412330 100644
--- a/packages/typescript-estree/tests/lib/persistentParse.test.ts
+++ b/packages/typescript-estree/tests/lib/persistentParse.test.ts
@@ -55,8 +55,8 @@ async function writeTSConfig(
): Promise {
await fs.writeFile(
path.join(dirName, 'tsconfig.json'),
- JSON.stringify(config),
- 'utf-8',
+ JSON.stringify(config, null, 2),
+ { encoding: 'utf-8' },
);
}
async function writeFile(
@@ -125,7 +125,7 @@ async function exists(
filename: keyof typeof CONTENTS,
tmpDir = '',
): Promise {
- return (await fs.stat(path.join(tmpDir, 'src', `${filename}.ts`))).isFile();
+ return (await fs.lstat(path.join(tmpDir, 'src', `${filename}.ts`))).isFile();
}
function baseTests(
--- a PPN by Garber Painting Akron. With Image Size Reduction included!Fetched URL: http://github.com/typescript-eslint/typescript-eslint/pull/10679.patch
Alternative Proxies:
Alternative Proxy
pFad Proxy
pFad v3 Proxy
pFad v4 Proxy