Skip to content

Commit 8ca2b3f

Browse files
authored
chore(lint): replace deprecated tseslint.config and prefer-ts-expect-error (#13942)
1 parent 5689884 commit 8ca2b3f

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

eslint.config.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import importX from 'eslint-plugin-import-x'
22
import tseslint from 'typescript-eslint'
3+
import { defineConfig } from 'eslint/config'
34
import vitest from '@vitest/eslint-plugin'
45
import { builtinModules } from 'node:module'
56

@@ -12,7 +13,7 @@ const banConstEnum = {
1213
'Please use non-const enums. This project automatically inlines enums.',
1314
}
1415

15-
export default tseslint.config(
16+
export default defineConfig(
1617
{
1718
files: ['**/*.js', '**/*.ts', '**/*.tsx'],
1819
extends: [tseslint.configs.base],
@@ -60,7 +61,10 @@ export default tseslint.config(
6061
],
6162
// This rule enforces the preference for using '@ts-expect-error' comments in TypeScript
6263
// code to indicate intentional type errors, improving code clarity and maintainability.
63-
'@typescript-eslint/prefer-ts-expect-error': 'error',
64+
'@typescript-eslint/ban-ts-comment': [
65+
'error',
66+
{ minimumDescriptionLength: 0 },
67+
],
6468
// Enforce the use of 'import type' for importing types
6569
'@typescript-eslint/consistent-type-imports': [
6670
'error',

packages/vue/jsx-runtime/index.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* eslint-disable @typescript-eslint/prefer-ts-expect-error */
1+
/* eslint-disable @typescript-eslint/ban-ts-comment */
22
import type { NativeElements, ReservedProps, VNode } from '@vue/runtime-dom'
33

44
/**

packages/vue/jsx.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* eslint-disable @typescript-eslint/prefer-ts-expect-error */
1+
/* eslint-disable @typescript-eslint/ban-ts-comment */
22
// global JSX namespace registration
33
// somehow we have to copy=pase the jsx-runtime types here to make TypeScript happy
44
import type { NativeElements, ReservedProps, VNode } from '@vue/runtime-dom'

0 commit comments

Comments
 (0)