Files
ThriveX-Admin/eslint.config.js
宇阳 9078cf1385 feat: 初始化项目结构并添加基础配置文件
- 新增 .dockerignore, .env, .gitignore, .prettierrc 等基础配置文件,确保项目环境一致性。
- 添加初始的 Dockerfile 和 Vite 配置,支持项目的容器化和构建。
- 引入 ESLint 和 Prettier 配置,提升代码质量和一致性。
- 创建基本的页面和组件结构,便于后续开发和扩展。
2025-12-23 20:44:57 +08:00

43 lines
1.3 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import js from '@eslint/js';
import globals from 'globals';
import tseslint from 'typescript-eslint';
import pluginReact from 'eslint-plugin-react';
import { defineConfig } from 'eslint/config';
import reactHooks from 'eslint-plugin-react-hooks';
import reactRefresh from 'eslint-plugin-react-refresh';
export default defineConfig([
{ ignores: ['dist'] },
{
files: ['**/*.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'],
plugins: { js },
extends: ['js/recommended'],
},
{
files: ['**/*.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'],
languageOptions: { globals: globals.browser },
},
{
plugins: {
'react-hooks': reactHooks,
'react-refresh': reactRefresh,
},
},
tseslint.configs.recommended,
pluginReact.configs.flat.recommended,
{
rules: {
'no-unused-vars': 'off', // 关闭未使用变量的检查
'react-refresh/only-export-components': 'off',
'react/display-name': 'off',
// 约束js使用单引号允许jsx双引号
quotes: ['error', 'single', { avoidEscape: true, allowTemplateLiterals: true }],
'jsx-quotes': ['error', 'prefer-double'],
'react-hooks/exhaustive-deps': 'off',
'react/react-in-jsx-scope': 'off',
// 禁止使用 any 类型
'@typescript-eslint/no-explicit-any': 'error',
},
},
]);