1
0

feat: 前端集成 Prettier 代码格式化

This commit is contained in:
2026-04-24 13:40:53 +08:00
parent 52007c9461
commit 365943e4c4
61 changed files with 1968 additions and 1698 deletions

View File

@@ -6,6 +6,7 @@ import tseslint from 'typescript-eslint'
import importPlugin from 'eslint-plugin-import'
import tanstackQuery from '@tanstack/eslint-plugin-query'
import localRules from './eslint-rules/index.js'
import eslintConfigPrettier from 'eslint-config-prettier'
export default tseslint.config(
{ ignores: ['dist'] },
@@ -26,10 +27,7 @@ export default tseslint.config(
},
rules: {
...reactHooks.configs.recommended.rules,
'react-refresh/only-export-components': [
'warn',
{ allowConstantExport: true },
],
'react-refresh/only-export-components': ['warn', { allowConstantExport: true }],
'no-console': ['error', { allow: ['warn', 'error'] }],
'@typescript-eslint/consistent-type-imports': [
'error',
@@ -40,20 +38,10 @@ export default tseslint.config(
'import/order': [
'warn',
{
groups: [
'builtin',
'external',
'internal',
'parent',
'sibling',
'index',
'type',
],
groups: ['builtin', 'external', 'internal', 'parent', 'sibling', 'index', 'type'],
'newlines-between': 'never',
alphabetize: { order: 'asc', caseInsensitive: true },
pathGroups: [
{ pattern: '@/**', group: 'internal', position: 'before' },
],
pathGroups: [{ pattern: '@/**', group: 'internal', position: 'before' }],
},
],
},
@@ -67,4 +55,5 @@ export default tseslint.config(
'no-console': 'off',
},
},
eslintConfigPrettier
)