mirror of
https://github.com/LiuYuYang01/ThriveX-Blog.git
synced 2026-05-07 06:07:34 +08:00
40 lines
1.2 KiB
JavaScript
40 lines
1.2 KiB
JavaScript
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([
|
||
{
|
||
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: {
|
||
'@typescript-eslint/no-explicit-any': 'off',
|
||
'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',
|
||
},
|
||
},
|
||
]); |