ca4bfc33fd
- Remove unused imports and variables across 35 files - Simplify component logic and remove dead code - Clean up test files by removing unnecessary setup - Streamline CI workflow configuration Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
71 lines
1.6 KiB
TypeScript
71 lines
1.6 KiB
TypeScript
import js from '@eslint/js';
|
|
import tseslint from 'typescript-eslint';
|
|
import reactHooks from 'eslint-plugin-react-hooks';
|
|
import reactPlugin from 'eslint-plugin-react';
|
|
import globals from 'globals';
|
|
|
|
export default tseslint.config(
|
|
{
|
|
ignores: ['dist', '.output', '.wxt', 'node_modules', 'eslint.config.ts', 'eslint.config.js'],
|
|
},
|
|
|
|
js.configs.recommended,
|
|
...tseslint.configs.recommended,
|
|
|
|
{
|
|
files: ['**/__tests__/**', '**/*.test.{ts,tsx}', '**/*.spec.{ts,tsx}', 'setupTests.ts'],
|
|
rules: {
|
|
'@typescript-eslint/no-explicit-any': 'off',
|
|
'@typescript-eslint/no-unused-vars': [
|
|
'warn',
|
|
{ argsIgnorePattern: '^_', varsIgnorePattern: '^_' },
|
|
],
|
|
},
|
|
},
|
|
|
|
{
|
|
files: ['src/**/*.{ts,tsx}'],
|
|
ignores: ['**/__tests__/**', '**/*.test.{ts,tsx}', '**/*.spec.{ts,tsx}'],
|
|
|
|
languageOptions: {
|
|
ecmaVersion: 2022, // 💡 升级至现代高频语法解析
|
|
globals: {
|
|
...globals.browser,
|
|
...globals.node,
|
|
},
|
|
|
|
parserOptions: {
|
|
projectService: true,
|
|
tsconfigRootDir: import.meta.dirname,
|
|
},
|
|
},
|
|
|
|
plugins: {
|
|
react: reactPlugin,
|
|
'react-hooks': reactHooks,
|
|
},
|
|
|
|
settings: {
|
|
react: {
|
|
version: 'detect',
|
|
},
|
|
},
|
|
|
|
rules: {
|
|
...reactHooks.configs.recommended.rules,
|
|
...reactPlugin.configs.recommended.rules,
|
|
...reactPlugin.configs['jsx-runtime'].rules,
|
|
|
|
'react/prop-types': 'off',
|
|
|
|
'no-unused-vars': 'off',
|
|
'@typescript-eslint/no-unused-vars': [
|
|
'warn',
|
|
{ argsIgnorePattern: '^_', varsIgnorePattern: '^_' },
|
|
],
|
|
|
|
'react/react-in-jsx-scope': 'off',
|
|
},
|
|
},
|
|
);
|