From bd040532f8ed7aa0012f700afdeac1b40fa82092 Mon Sep 17 00:00:00 2001 From: Vida Xie Date: Mon, 29 Sep 2025 14:04:28 +0800 Subject: [PATCH 1/2] chore(lint): replace `tseslint.config` with `defineConfig` --- eslint.config.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/eslint.config.js b/eslint.config.js index b752b2e19f1..26532e1519f 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -1,5 +1,6 @@ import importX from 'eslint-plugin-import-x' import tseslint from 'typescript-eslint' +import { defineConfig } from 'eslint/config' import vitest from '@vitest/eslint-plugin' import { builtinModules } from 'node:module' @@ -12,7 +13,7 @@ const banConstEnum = { 'Please use non-const enums. This project automatically inlines enums.', } -export default tseslint.config( +export default defineConfig( { files: ['**/*.js', '**/*.ts', '**/*.tsx'], extends: [tseslint.configs.base], From 1f70ed14c32993ba1b5dd07aa5a6b70bc3a92970 Mon Sep 17 00:00:00 2001 From: Vida Xie Date: Mon, 29 Sep 2025 14:16:25 +0800 Subject: [PATCH 2/2] chore: replace `prefer-ts-expect-error` with `ban-ts-comment` --- eslint.config.js | 5 ++++- packages/vue/jsx-runtime/index.d.ts | 2 +- packages/vue/jsx.d.ts | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/eslint.config.js b/eslint.config.js index 26532e1519f..2b472e14d1e 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -61,7 +61,10 @@ export default defineConfig( ], // This rule enforces the preference for using '@ts-expect-error' comments in TypeScript // code to indicate intentional type errors, improving code clarity and maintainability. - '@typescript-eslint/prefer-ts-expect-error': 'error', + '@typescript-eslint/ban-ts-comment': [ + 'error', + { minimumDescriptionLength: 0 }, + ], // Enforce the use of 'import type' for importing types '@typescript-eslint/consistent-type-imports': [ 'error', diff --git a/packages/vue/jsx-runtime/index.d.ts b/packages/vue/jsx-runtime/index.d.ts index af5ffe2ac24..28071b75afe 100644 --- a/packages/vue/jsx-runtime/index.d.ts +++ b/packages/vue/jsx-runtime/index.d.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/prefer-ts-expect-error */ +/* eslint-disable @typescript-eslint/ban-ts-comment */ import type { NativeElements, ReservedProps, VNode } from '@vue/runtime-dom' /** diff --git a/packages/vue/jsx.d.ts b/packages/vue/jsx.d.ts index 1fa1e326676..cfea000826b 100644 --- a/packages/vue/jsx.d.ts +++ b/packages/vue/jsx.d.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/prefer-ts-expect-error */ +/* eslint-disable @typescript-eslint/ban-ts-comment */ // global JSX namespace registration // somehow we have to copy=pase the jsx-runtime types here to make TypeScript happy import type { NativeElements, ReservedProps, VNode } from '@vue/runtime-dom'