feat: 前端集成 Prettier 代码格式化
This commit is contained in:
@@ -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
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user