From 0badfc493fad25c57242472519c36fa567ca0b01 Mon Sep 17 00:00:00 2001 From: alex8088 <244096523@qq.com> Date: Fri, 17 Oct 2025 21:28:47 +0800 Subject: [PATCH] chore: update eslint config --- eslint.config.js | 5 +++++ node.d.ts | 2 +- src/config.ts | 1 - 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/eslint.config.js b/eslint.config.js index df529da..e68e891 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -29,6 +29,7 @@ export default tseslint.config( }, rules: { 'prettier/prettier': 'warn', + 'no-empty': ['warn', { allowEmptyCatch: true }], '@typescript-eslint/ban-ts-comment': ['error', { 'ts-ignore': 'allow-with-description' }], '@typescript-eslint/explicit-function-return-type': [ 'error', @@ -52,6 +53,10 @@ export default tseslint.config( allowTaggedTemplates: true, allowTernary: true } + ], + '@typescript-eslint/consistent-type-imports': [ + 'error', + { prefer: 'type-imports', disallowTypeAnnotations: false } ] } }, diff --git a/node.d.ts b/node.d.ts index 5b8b896..5ca0f21 100644 --- a/node.d.ts +++ b/node.d.ts @@ -1,6 +1,6 @@ // node worker declare module '*?nodeWorker' { - import { Worker, WorkerOptions } from 'node:worker_threads' + import type { Worker, WorkerOptions } from 'node:worker_threads' export default function (options: WorkerOptions): Worker } diff --git a/src/config.ts b/src/config.ts index 69d836a..94d7fa3 100644 --- a/src/config.ts +++ b/src/config.ts @@ -417,7 +417,6 @@ async function loadConfigFormBundledFile( } finally { try { fs.unlinkSync(fileNameTmp) - // eslint-disable-next-line no-empty } catch {} } } else {