- 在 .gitignore 中添加 public/audio/* 以忽略音频文件。 - 更新 bun.lock,添加 eslint-config-prettier 和 eslint-plugin-prettier 依赖,确保 ESLint 与 Prettier 的兼容性。 - 修改 eslint.config.ts,整合 Prettier 规则,优化代码风格一致性。 - 在 package.json 中添加 lint:fix 和 format 脚本,简化代码格式化和修复流程。 - 更新 tailwind.config.ts 和其他组件文件,统一代码风格,提升可读性。
39 lines
1.2 KiB
TypeScript
39 lines
1.2 KiB
TypeScript
import js from '@eslint/js'
|
|
import globals from 'globals'
|
|
import reactHooks from 'eslint-plugin-react-hooks'
|
|
import reactRefresh from 'eslint-plugin-react-refresh'
|
|
import tseslint from 'typescript-eslint'
|
|
import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended'
|
|
|
|
export default tseslint.config(
|
|
{ ignores: ['dist', 'node_modules', 'vite.config.ts'] },
|
|
{
|
|
extends: [
|
|
js.configs.recommended,
|
|
...tseslint.configs.recommended,
|
|
eslintPluginPrettierRecommended, // Prettier + ESLint 整合
|
|
],
|
|
files: ['**/*.{ts,tsx}'],
|
|
languageOptions: {
|
|
ecmaVersion: 2020,
|
|
globals: globals.browser,
|
|
},
|
|
plugins: {
|
|
'react-hooks': reactHooks,
|
|
'react-refresh': reactRefresh,
|
|
},
|
|
rules: {
|
|
...reactHooks.configs.recommended.rules,
|
|
'react-refresh/only-export-components': ['warn', { allowConstantExport: true }],
|
|
'@typescript-eslint/no-unused-vars': [
|
|
'warn',
|
|
{ varsIgnorePattern: '^_', argsIgnorePattern: '^_' },
|
|
],
|
|
'@typescript-eslint/no-explicit-any': 'off',
|
|
// 禁用可能与 Prettier 冲突的 ESLint 规则
|
|
quotes: 'off',
|
|
semi: 'off',
|
|
},
|
|
}
|
|
)
|