chore(frontend): 接入 ESLint、Prettier 与 Vitest 质量门禁

This commit is contained in:
yml2213
2026-11-01 20:54:45 +08:00
parent 7f6ebddd5e
commit 6056afa436
150 changed files with 3895 additions and 1349 deletions
+32
View File
@@ -0,0 +1,32 @@
import js from '@eslint/js'
import globals from 'globals'
import reactHooks from 'eslint-plugin-react-hooks'
import tseslint from 'typescript-eslint'
export default tseslint.config(
{
ignores: ['dist/**', 'coverage/**', 'node_modules/**'],
},
js.configs.recommended,
...tseslint.configs.recommended,
{
files: ['**/*.{ts,tsx}'],
languageOptions: {
ecmaVersion: 'latest',
globals: globals.browser,
parserOptions: {
ecmaFeatures: { jsx: true },
},
},
plugins: {
'react-hooks': reactHooks,
},
rules: {
'react-hooks/rules-of-hooks': 'error',
'react-hooks/exhaustive-deps': 'warn',
'@typescript-eslint/no-explicit-any': 'error',
'@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_' }],
'no-console': ['error', { allow: ['warn', 'error'] }],
},
}
)