子仓库提交

This commit is contained in:
2025-11-10 09:19:56 +08:00
parent 5b93b6ff7d
commit caae0492ee
733 changed files with 141413 additions and 0 deletions

47
crop-x-new/.eslintrc.cjs Normal file
View File

@@ -0,0 +1,47 @@
// ESLint配置文件 - 需要通过 .dev-tools-config.json 启用
// 运行 `npm run scripts:enable` 来启用ESLint
const fs = require('fs');
const path = require('path');
// 检查开发工具配置
const configPath = path.join(__dirname, '.dev-tools-config.json');
let eslintEnabled = false;
try {
const config = JSON.parse(fs.readFileSync(configPath, 'utf8'));
eslintEnabled = config.tools?.eslint?.enabled === true;
} catch (error) {
console.warn('⚠️ 无法读取开发工具配置ESLint将被禁用');
}
// 如果ESLint被禁用返回空配置
if (!eslintEnabled) {
console.log(' ESLint已在配置中被禁用如需启用请运行: npm run scripts:enable');
module.exports = {};
return;
}
// ESLint正常配置
module.exports = {
root: true,
env: { browser: true, es2020: true },
extends: [
'eslint:recommended',
'@typescript-eslint/recommended',
'plugin:react-hooks/recommended',
],
ignorePatterns: ['dist', '.eslintrc.cjs', 'node_modules'],
parser: '@typescript-eslint/parser',
plugins: ['react-refresh'],
rules: {
'react-refresh/only-export-components': [
'warn',
{ allowConstantExport: true },
],
'@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_' }],
'@typescript-eslint/no-explicit-any': 'warn',
'react-hooks/rules-of-hooks': 'error',
'react-hooks/exhaustive-deps': 'warn',
},
};