From a9197f5cc962425459acb5491d3a3915e404f79a Mon Sep 17 00:00:00 2001 From: alex8088 <244096523@qq.com> Date: Wed, 7 May 2025 22:03:59 +0800 Subject: [PATCH] chore: remove deprecated rules and adjust rules --- eslint.config.js | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/eslint.config.js b/eslint.config.js index 99d0171..3146d76 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -25,12 +25,29 @@ export default tseslint.config( rules: { 'prettier/prettier': 'warn', '@typescript-eslint/ban-ts-comment': ['error', { 'ts-ignore': 'allow-with-description' }], - '@typescript-eslint/explicit-function-return-type': 'error', + '@typescript-eslint/explicit-function-return-type': [ + 'error', + { + allowExpressions: true, + allowTypedFunctionExpressions: true, + allowHigherOrderFunctions: true, + allowIIFEs: true + } + ], '@typescript-eslint/explicit-module-boundary-types': 'off', '@typescript-eslint/no-empty-function': ['error', { allow: ['arrowFunctions'] }], + '@typescript-eslint/no-empty-object-type': ['error', { allowInterfaces: 'always' }], '@typescript-eslint/no-explicit-any': 'error', '@typescript-eslint/no-non-null-assertion': 'off', - '@typescript-eslint/no-var-requires': 'off' + '@typescript-eslint/no-require-imports': 'error', + '@typescript-eslint/no-unused-expressions': [ + 'error', + { + allowShortCircuit: true, + allowTaggedTemplates: true, + allowTernary: true + } + ] } }, {