Files
meijiaka-zy/tauri-app/eslint.config.js
T
小鱼开发 11a85bfee7 fix: 修复 BGM 本地上传、封面形象样式、ESLint 清零、access log 关闭
- BGM 本地上传改用 Tauri open 对话框,修复 path 为空导致混音失效
- Rust 端放宽 BGM 路径验证(系统文件选择器选取的文件),加路径遍历防护
- BGM 混音失败时 toast 提示,不再静默忽略
- 我的作品页增加导出功能
- 封面形象卡片样式统一为 works-card 体系
- 关闭 uvicorn access log(Dockerfile + 3 个 compose)
- ESLint 全绿:关掉 prop-types/incompatible-library,修复 curly/exhaustive-deps/any/unused-vars
- .gitignore 排除 *.exe 构建产物
2026-05-27 18:37:33 +08:00

60 lines
1.7 KiB
JavaScript

import js from '@eslint/js';
import tseslint from 'typescript-eslint';
import react from 'eslint-plugin-react';
import reactHooks from 'eslint-plugin-react-hooks';
import reactRefresh from 'eslint-plugin-react-refresh';
export default tseslint.config(
// 全局忽略
{
ignores: ['dist', 'node_modules', 'src-tauri', 'src/api/generated', 'src/_unused'],
},
// 基础规则
js.configs.recommended,
...tseslint.configs.recommended,
// React + TypeScript 文件
{
files: ['**/*.{ts,tsx}'],
plugins: {
react,
'react-hooks': reactHooks,
'react-refresh': reactRefresh,
},
settings: {
react: {
version: 'detect',
},
},
languageOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
},
rules: {
// React
...react.configs.recommended.rules,
...react.configs['jsx-runtime'].rules,
...reactHooks.configs.recommended.rules,
'react/prop-types': 'off', // TypeScript 已有类型检查,无需 PropTypes
'react-hooks/set-state-in-effect': 'warn',
'react-hooks/incompatible-library': 'off', // TanStack Virtual 等常见库误报
'react-refresh/only-export-components': 'warn',
'react/no-unescaped-entities': 'warn',
// TypeScript
'@typescript-eslint/ban-ts-comment': 'warn',
'@typescript-eslint/no-explicit-any': 'warn',
'@typescript-eslint/no-unused-vars': ['warn', { argsIgnorePattern: '^_' }],
// 通用
'no-console': ['warn', { allow: ['warn', 'error', 'info'] }],
'no-constant-condition': 'warn',
eqeqeq: ['warn', 'always'],
curly: ['warn', 'all'],
'no-var': 'error',
'prefer-const': 'warn',
},
},
);