diff --git a/eslint.config.js b/eslint.config.js index e75ac25fc..0aa7ac6b7 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -97,7 +97,7 @@ export default tseslint.config( ], '@typescript-eslint/ban-ts-comment': 'error', - '@typescript-eslint/ban-types': 'off', // TODO: we should turn this on in a new PR + '@typescript-eslint/no-unsafe-function-type': 'off', // TODO: we should turn this on in a new PR '@typescript-eslint/explicit-module-boundary-types': [ 'error', { allowArgumentsExplicitlyTypedAsAny: true }, @@ -106,18 +106,23 @@ export default tseslint.config( 'error', { allow: ['arrowFunctions'] }, ], + '@typescript-eslint/no-empty-object-type': [ + 'error', + { allowInterfaces: 'with-single-extends' }, // maybe we should turn this on in a new PR + ], '@typescript-eslint/no-empty-interface': 'off', '@typescript-eslint/no-explicit-any': 'off', // maybe we should turn this on in a new PR 'no-extra-semi': 'off', '@typescript-eslint/no-extra-semi': 'off', // conflicts with prettier '@typescript-eslint/no-inferrable-types': 'off', + '@typescript-eslint/no-unused-expressions': 'off', // maybe we should turn this on in a new PR '@typescript-eslint/no-unused-vars': 'off', // maybe we should turn this on in a new PR - '@typescript-eslint/no-var-requires': 'off', + '@typescript-eslint/no-require-imports': 'off', '@typescript-eslint/consistent-type-imports': [ 'error', { prefer: 'type-imports', disallowTypeAnnotations: false }, ], - // disable rules set in @typescript-eslint/stylistic v6 that wasn't set in @typescript-eslint/recommended v5 and which conflict with current code + // disable rules set in @typescript-eslint/stylistic which conflict with current code // maybe we should turn them on in a new PR '@typescript-eslint/array-type': 'off', '@typescript-eslint/ban-tslint-comment': 'off', diff --git a/package.json b/package.json index 2cf225560..f4f354dc5 100644 --- a/package.json +++ b/package.json @@ -74,7 +74,7 @@ "tslib": "^2.6.3", "tsx": "^4.16.2", "typescript": "^5.5.3", - "typescript-eslint": "^7.18.0", + "typescript-eslint": "^8.0.0", "vite": "workspace:*", "vitest": "^2.0.4" }, diff --git a/packages/create-vite/template-react-ts/package.json b/packages/create-vite/template-react-ts/package.json index 9c2913bf8..92347d28d 100644 --- a/packages/create-vite/template-react-ts/package.json +++ b/packages/create-vite/template-react-ts/package.json @@ -23,7 +23,7 @@ "eslint-plugin-react-refresh": "^0.4.7", "globals": "^15.6.0", "typescript": "^5.5.3", - "typescript-eslint": "^7.18.0", + "typescript-eslint": "^8.0.0", "vite": "^5.3.5" }, "overrides": { diff --git a/packages/vite/src/node/plugins/importAnalysisBuild.ts b/packages/vite/src/node/plugins/importAnalysisBuild.ts index 7dcad1796..06e2f74e4 100644 --- a/packages/vite/src/node/plugins/importAnalysisBuild.ts +++ b/packages/vite/src/node/plugins/importAnalysisBuild.ts @@ -77,7 +77,7 @@ function detectScriptRel() { declare const scriptRel: string declare const seen: Record function preload( - baseModule: () => Promise<{}>, + baseModule: () => Promise, deps?: string[], importerUrl?: string, ) { diff --git a/packages/vite/src/types/shims.d.ts b/packages/vite/src/types/shims.d.ts index 9f637b00e..3a8c070e3 100644 --- a/packages/vite/src/types/shims.d.ts +++ b/packages/vite/src/types/shims.d.ts @@ -34,6 +34,7 @@ declare module 'postcss-import' { // LESS' types somewhat references this which doesn't make sense in Node, // so we have to shim it +// eslint-disable-next-line @typescript-eslint/no-empty-object-type declare interface HTMLLinkElement {} // eslint-disable-next-line no-var diff --git a/packages/vite/src/types/ws.d.ts b/packages/vite/src/types/ws.d.ts index 99932f49b..f52136587 100644 --- a/packages/vite/src/types/ws.d.ts +++ b/packages/vite/src/types/ws.d.ts @@ -300,7 +300,7 @@ declare class WebSocket extends EventEmitter { } declare const WebSocketAlias: typeof WebSocket -interface WebSocketAlias extends WebSocket {} // tslint:disable-line no-empty-interface +interface WebSocketAlias extends WebSocket {} declare namespace WebSocket { /** @@ -550,9 +550,9 @@ declare namespace WebSocket { } const WebSocketServer: typeof Server - interface WebSocketServer extends Server {} // tslint:disable-line no-empty-interface + interface WebSocketServer extends Server {} const WebSocket: typeof WebSocketAlias - interface WebSocket extends WebSocketAlias {} // tslint:disable-line no-empty-interface + interface WebSocket extends WebSocketAlias {} // WebSocket stream function createWebSocketStream( diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 4a5658d19..2e2988666 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -128,8 +128,8 @@ importers: specifier: ^5.5.3 version: 5.5.3 typescript-eslint: - specifier: ^7.18.0 - version: 7.18.0(eslint@9.8.0)(typescript@5.5.3) + specifier: ^8.0.0 + version: 8.0.0(eslint@9.8.0)(typescript@5.5.3) vite: specifier: workspace:* version: link:packages/vite @@ -3186,22 +3186,22 @@ packages: '@types/ws@8.5.12': resolution: {integrity: sha512-3tPRkv1EtkDpzlgyKyI8pGsGZAGPEaXeu0DOj5DI25Ja91bdAYddYHbADRYVrZMRbfW+1l5YwXVDKohDJNQxkQ==} - '@typescript-eslint/eslint-plugin@7.18.0': - resolution: {integrity: sha512-94EQTWZ40mzBc42ATNIBimBEDltSJ9RQHCC8vc/PDbxi4k8dVwUAv4o98dk50M1zB+JGFxp43FP7f8+FP8R6Sw==} - engines: {node: ^18.18.0 || >=20.0.0} + '@typescript-eslint/eslint-plugin@8.0.0': + resolution: {integrity: sha512-STIZdwEQRXAHvNUS6ILDf5z3u95Gc8jzywunxSNqX00OooIemaaNIA0vEgynJlycL5AjabYLLrIyHd4iazyvtg==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: - '@typescript-eslint/parser': ^7.0.0 - eslint: ^8.56.0 + '@typescript-eslint/parser': ^8.0.0 || ^8.0.0-alpha.0 + eslint: ^8.57.0 || ^9.0.0 typescript: '*' peerDependenciesMeta: typescript: optional: true - '@typescript-eslint/parser@7.18.0': - resolution: {integrity: sha512-4Z+L8I2OqhZV8qA132M4wNL30ypZGYOQVBfMgxDH/K5UX0PNqTu1c6za9ST5r9+tavvHiTWmBnKzpCJ/GlVFtg==} - engines: {node: ^18.18.0 || >=20.0.0} + '@typescript-eslint/parser@8.0.0': + resolution: {integrity: sha512-pS1hdZ+vnrpDIxuFXYQpLTILglTjSYJ9MbetZctrUawogUsPdz31DIIRZ9+rab0LhYNTsk88w4fIzVheiTbWOQ==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: - eslint: ^8.56.0 + eslint: ^8.57.0 || ^9.0.0 typescript: '*' peerDependenciesMeta: typescript: @@ -3211,15 +3211,14 @@ packages: resolution: {integrity: sha512-0P2jTTqyxWp9HiKLu/Vemr2Rg1Xb5B7uHItdVZ6iAenXmPo4SZ86yOPCJwMqpCyaMiEHTNqizHfsbmCFT1x9SA==} engines: {node: ^18.18.0 || >=20.0.0} - '@typescript-eslint/scope-manager@7.18.0': - resolution: {integrity: sha512-jjhdIE/FPF2B7Z1uzc6i3oWKbGcHb87Qw7AWj6jmEqNOfDFbJWtjt/XfwCpvNkpGWlcJaog5vTR+VV8+w9JflA==} - engines: {node: ^18.18.0 || >=20.0.0} + '@typescript-eslint/scope-manager@8.0.0': + resolution: {integrity: sha512-V0aa9Csx/ZWWv2IPgTfY7T4agYwJyILESu/PVqFtTFz9RIS823mAze+NbnBI8xiwdX3iqeQbcTYlvB04G9wyQw==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - '@typescript-eslint/type-utils@7.18.0': - resolution: {integrity: sha512-XL0FJXuCLaDuX2sYqZUUSOJ2sG5/i1AAze+axqmLnSkNEVMVYLF+cbwlB2w8D1tinFuSikHmFta+P+HOofrLeA==} - engines: {node: ^18.18.0 || >=20.0.0} + '@typescript-eslint/type-utils@8.0.0': + resolution: {integrity: sha512-mJAFP2mZLTBwAn5WI4PMakpywfWFH5nQZezUQdSKV23Pqo6o9iShQg1hP2+0hJJXP2LnZkWPphdIq4juYYwCeg==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: - eslint: ^8.56.0 typescript: '*' peerDependenciesMeta: typescript: @@ -3229,9 +3228,9 @@ packages: resolution: {integrity: sha512-a29Ir0EbyKTKHnZWbNsrc/gqfIBqYPwj3F2M+jWE/9bqfEHg0AMtXzkbUkOG6QgEScxh2+Pz9OXe11jHDnHR7A==} engines: {node: ^18.18.0 || >=20.0.0} - '@typescript-eslint/types@7.18.0': - resolution: {integrity: sha512-iZqi+Ds1y4EDYUtlOOC+aUmxnE9xS/yCigkjA7XpTKV6nCBd3Hp/PRGGmdwnfkV2ThMyYldP1wRpm/id99spTQ==} - engines: {node: ^18.18.0 || >=20.0.0} + '@typescript-eslint/types@8.0.0': + resolution: {integrity: sha512-wgdSGs9BTMWQ7ooeHtu5quddKKs5Z5dS+fHLbrQI+ID0XWJLODGMHRfhwImiHoeO2S5Wir2yXuadJN6/l4JRxw==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} '@typescript-eslint/typescript-estree@7.17.0': resolution: {integrity: sha512-72I3TGq93t2GoSBWI093wmKo0n6/b7O4j9o8U+f65TVD0FS6bI2180X5eGEr8MA8PhKMvYe9myZJquUT2JkCZw==} @@ -3242,9 +3241,9 @@ packages: typescript: optional: true - '@typescript-eslint/typescript-estree@7.18.0': - resolution: {integrity: sha512-aP1v/BSPnnyhMHts8cf1qQ6Q1IFwwRvAQGRvBFkWlo3/lH29OXA3Pts+c10nxRxIBrDnoMqzhgdwVe5f2D6OzA==} - engines: {node: ^18.18.0 || >=20.0.0} + '@typescript-eslint/typescript-estree@8.0.0': + resolution: {integrity: sha512-5b97WpKMX+Y43YKi4zVcCVLtK5F98dFls3Oxui8LbnmRsseKenbbDinmvxrWegKDMmlkIq/XHuyy0UGLtpCDKg==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: typescript: '*' peerDependenciesMeta: @@ -3257,19 +3256,19 @@ packages: peerDependencies: eslint: ^8.56.0 - '@typescript-eslint/utils@7.18.0': - resolution: {integrity: sha512-kK0/rNa2j74XuHVcoCZxdFBMF+aq/vH83CXAOHieC+2Gis4mF8jJXT5eAfyD3K0sAxtPuwxaIOIOvhwzVDt/kw==} - engines: {node: ^18.18.0 || >=20.0.0} + '@typescript-eslint/utils@8.0.0': + resolution: {integrity: sha512-k/oS/A/3QeGLRvOWCg6/9rATJL5rec7/5s1YmdS0ZU6LHveJyGFwBvLhSRBv6i9xaj7etmosp+l+ViN1I9Aj/Q==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: - eslint: ^8.56.0 + eslint: ^8.57.0 || ^9.0.0 '@typescript-eslint/visitor-keys@7.17.0': resolution: {integrity: sha512-RVGC9UhPOCsfCdI9pU++K4nD7to+jTcMIbXTSOcrLqUEW6gF2pU1UUbYJKc9cvcRSK1UDeMJ7pdMxf4bhMpV/A==} engines: {node: ^18.18.0 || >=20.0.0} - '@typescript-eslint/visitor-keys@7.18.0': - resolution: {integrity: sha512-cDF0/Gf81QpY3xYyJKDV14Zwdmid5+uuENhjH2EqFaF0ni+yAyq/LzMaIJdhNJXZI7uLzwIlA+V7oWoyn6Curg==} - engines: {node: ^18.18.0 || >=20.0.0} + '@typescript-eslint/visitor-keys@8.0.0': + resolution: {integrity: sha512-oN0K4nkHuOyF3PVMyETbpP5zp6wfyOvm7tWhTMfoqxSSsPmJIh6JNASuZDlODE8eE+0EB9uar+6+vxr9DBTYOA==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} '@typescript/vfs@1.5.0': resolution: {integrity: sha512-AJS307bPgbsZZ9ggCT3wwpg3VbTKMFNHfaY/uF0ahSkYYrPF2dSSKDNIDIQAHm9qJqbLvCsSJH7yN4Vs/CsMMg==} @@ -6574,11 +6573,10 @@ packages: type@2.7.2: resolution: {integrity: sha512-dzlvlNlt6AXU7EBSfpAscydQ7gXB+pPGsPnfJnZpiNJBDj7IaJzQlBZYGdEi4R9HmPdBv2XmWJ6YUtoTa7lmCw==} - typescript-eslint@7.18.0: - resolution: {integrity: sha512-PonBkP603E3tt05lDkbOMyaxJjvKqQrXsnow72sVeOFINDE/qNmnnd+f9b4N+U7W6MXnnYyrhtmF2t08QWwUbA==} - engines: {node: ^18.18.0 || >=20.0.0} + typescript-eslint@8.0.0: + resolution: {integrity: sha512-yQWBJutWL1PmpmDddIOl9/Mi6vZjqNCjqSGBMQ4vsc2Aiodk0SnbQQWPXbSy0HNuKCuGkw1+u4aQ2mO40TdhDQ==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: - eslint: ^8.56.0 typescript: '*' peerDependenciesMeta: typescript: @@ -8587,14 +8585,14 @@ snapshots: dependencies: '@types/node': 20.14.13 - '@typescript-eslint/eslint-plugin@7.18.0(@typescript-eslint/parser@7.18.0(eslint@9.8.0)(typescript@5.5.3))(eslint@9.8.0)(typescript@5.5.3)': + '@typescript-eslint/eslint-plugin@8.0.0(@typescript-eslint/parser@8.0.0(eslint@9.8.0)(typescript@5.5.3))(eslint@9.8.0)(typescript@5.5.3)': dependencies: '@eslint-community/regexpp': 4.11.0 - '@typescript-eslint/parser': 7.18.0(eslint@9.8.0)(typescript@5.5.3) - '@typescript-eslint/scope-manager': 7.18.0 - '@typescript-eslint/type-utils': 7.18.0(eslint@9.8.0)(typescript@5.5.3) - '@typescript-eslint/utils': 7.18.0(eslint@9.8.0)(typescript@5.5.3) - '@typescript-eslint/visitor-keys': 7.18.0 + '@typescript-eslint/parser': 8.0.0(eslint@9.8.0)(typescript@5.5.3) + '@typescript-eslint/scope-manager': 8.0.0 + '@typescript-eslint/type-utils': 8.0.0(eslint@9.8.0)(typescript@5.5.3) + '@typescript-eslint/utils': 8.0.0(eslint@9.8.0)(typescript@5.5.3) + '@typescript-eslint/visitor-keys': 8.0.0 eslint: 9.8.0 graphemer: 1.4.0 ignore: 5.3.1 @@ -8605,12 +8603,12 @@ snapshots: transitivePeerDependencies: - supports-color - '@typescript-eslint/parser@7.18.0(eslint@9.8.0)(typescript@5.5.3)': + '@typescript-eslint/parser@8.0.0(eslint@9.8.0)(typescript@5.5.3)': dependencies: - '@typescript-eslint/scope-manager': 7.18.0 - '@typescript-eslint/types': 7.18.0 - '@typescript-eslint/typescript-estree': 7.18.0(typescript@5.5.3) - '@typescript-eslint/visitor-keys': 7.18.0 + '@typescript-eslint/scope-manager': 8.0.0 + '@typescript-eslint/types': 8.0.0 + '@typescript-eslint/typescript-estree': 8.0.0(typescript@5.5.3) + '@typescript-eslint/visitor-keys': 8.0.0 debug: 4.3.6 eslint: 9.8.0 optionalDependencies: @@ -8623,26 +8621,26 @@ snapshots: '@typescript-eslint/types': 7.17.0 '@typescript-eslint/visitor-keys': 7.17.0 - '@typescript-eslint/scope-manager@7.18.0': + '@typescript-eslint/scope-manager@8.0.0': dependencies: - '@typescript-eslint/types': 7.18.0 - '@typescript-eslint/visitor-keys': 7.18.0 + '@typescript-eslint/types': 8.0.0 + '@typescript-eslint/visitor-keys': 8.0.0 - '@typescript-eslint/type-utils@7.18.0(eslint@9.8.0)(typescript@5.5.3)': + '@typescript-eslint/type-utils@8.0.0(eslint@9.8.0)(typescript@5.5.3)': dependencies: - '@typescript-eslint/typescript-estree': 7.18.0(typescript@5.5.3) - '@typescript-eslint/utils': 7.18.0(eslint@9.8.0)(typescript@5.5.3) + '@typescript-eslint/typescript-estree': 8.0.0(typescript@5.5.3) + '@typescript-eslint/utils': 8.0.0(eslint@9.8.0)(typescript@5.5.3) debug: 4.3.6 - eslint: 9.8.0 ts-api-utils: 1.3.0(typescript@5.5.3) optionalDependencies: typescript: 5.5.3 transitivePeerDependencies: + - eslint - supports-color '@typescript-eslint/types@7.17.0': {} - '@typescript-eslint/types@7.18.0': {} + '@typescript-eslint/types@8.0.0': {} '@typescript-eslint/typescript-estree@7.17.0(typescript@5.5.3)': dependencies: @@ -8659,10 +8657,10 @@ snapshots: transitivePeerDependencies: - supports-color - '@typescript-eslint/typescript-estree@7.18.0(typescript@5.5.3)': + '@typescript-eslint/typescript-estree@8.0.0(typescript@5.5.3)': dependencies: - '@typescript-eslint/types': 7.18.0 - '@typescript-eslint/visitor-keys': 7.18.0 + '@typescript-eslint/types': 8.0.0 + '@typescript-eslint/visitor-keys': 8.0.0 debug: 4.3.6 globby: 11.1.0 is-glob: 4.0.3 @@ -8685,12 +8683,12 @@ snapshots: - supports-color - typescript - '@typescript-eslint/utils@7.18.0(eslint@9.8.0)(typescript@5.5.3)': + '@typescript-eslint/utils@8.0.0(eslint@9.8.0)(typescript@5.5.3)': dependencies: '@eslint-community/eslint-utils': 4.4.0(eslint@9.8.0) - '@typescript-eslint/scope-manager': 7.18.0 - '@typescript-eslint/types': 7.18.0 - '@typescript-eslint/typescript-estree': 7.18.0(typescript@5.5.3) + '@typescript-eslint/scope-manager': 8.0.0 + '@typescript-eslint/types': 8.0.0 + '@typescript-eslint/typescript-estree': 8.0.0(typescript@5.5.3) eslint: 9.8.0 transitivePeerDependencies: - supports-color @@ -8701,9 +8699,9 @@ snapshots: '@typescript-eslint/types': 7.17.0 eslint-visitor-keys: 3.4.3 - '@typescript-eslint/visitor-keys@7.18.0': + '@typescript-eslint/visitor-keys@8.0.0': dependencies: - '@typescript-eslint/types': 7.18.0 + '@typescript-eslint/types': 8.0.0 eslint-visitor-keys: 3.4.3 '@typescript/vfs@1.5.0': @@ -12280,15 +12278,15 @@ snapshots: type@2.7.2: {} - typescript-eslint@7.18.0(eslint@9.8.0)(typescript@5.5.3): + typescript-eslint@8.0.0(eslint@9.8.0)(typescript@5.5.3): dependencies: - '@typescript-eslint/eslint-plugin': 7.18.0(@typescript-eslint/parser@7.18.0(eslint@9.8.0)(typescript@5.5.3))(eslint@9.8.0)(typescript@5.5.3) - '@typescript-eslint/parser': 7.18.0(eslint@9.8.0)(typescript@5.5.3) - '@typescript-eslint/utils': 7.18.0(eslint@9.8.0)(typescript@5.5.3) - eslint: 9.8.0 + '@typescript-eslint/eslint-plugin': 8.0.0(@typescript-eslint/parser@8.0.0(eslint@9.8.0)(typescript@5.5.3))(eslint@9.8.0)(typescript@5.5.3) + '@typescript-eslint/parser': 8.0.0(eslint@9.8.0)(typescript@5.5.3) + '@typescript-eslint/utils': 8.0.0(eslint@9.8.0)(typescript@5.5.3) optionalDependencies: typescript: 5.5.3 transitivePeerDependencies: + - eslint - supports-color typescript@5.5.3: {} diff --git a/scripts/releaseUtils.ts b/scripts/releaseUtils.ts index 586bbb571..6391bcfc9 100644 --- a/scripts/releaseUtils.ts +++ b/scripts/releaseUtils.ts @@ -8,7 +8,9 @@ export function run( bin: string, args: string[], opts?: EO, -): ResultPromise { +): ResultPromise< + EO & (keyof EO extends 'stdio' ? object : { stdio: 'inherit' }) +> { return execa(bin, args, { stdio: 'inherit', ...opts }) as any }