chore: update eslint config

This commit is contained in:
alex8088 2025-10-17 21:28:47 +08:00
parent cbb039c3e9
commit 0badfc493f
3 changed files with 6 additions and 2 deletions

View File

@ -29,6 +29,7 @@ export default tseslint.config(
}, },
rules: { rules: {
'prettier/prettier': 'warn', 'prettier/prettier': 'warn',
'no-empty': ['warn', { allowEmptyCatch: true }],
'@typescript-eslint/ban-ts-comment': ['error', { 'ts-ignore': 'allow-with-description' }], '@typescript-eslint/ban-ts-comment': ['error', { 'ts-ignore': 'allow-with-description' }],
'@typescript-eslint/explicit-function-return-type': [ '@typescript-eslint/explicit-function-return-type': [
'error', 'error',
@ -52,6 +53,10 @@ export default tseslint.config(
allowTaggedTemplates: true, allowTaggedTemplates: true,
allowTernary: true allowTernary: true
} }
],
'@typescript-eslint/consistent-type-imports': [
'error',
{ prefer: 'type-imports', disallowTypeAnnotations: false }
] ]
} }
}, },

2
node.d.ts vendored
View File

@ -1,6 +1,6 @@
// node worker // node worker
declare module '*?nodeWorker' { declare module '*?nodeWorker' {
import { Worker, WorkerOptions } from 'node:worker_threads' import type { Worker, WorkerOptions } from 'node:worker_threads'
export default function (options: WorkerOptions): Worker export default function (options: WorkerOptions): Worker
} }

View File

@ -417,7 +417,6 @@ async function loadConfigFormBundledFile(
} finally { } finally {
try { try {
fs.unlinkSync(fileNameTmp) fs.unlinkSync(fileNameTmp)
// eslint-disable-next-line no-empty
} catch {} } catch {}
} }
} else { } else {