blob: ec2b712d301e7ddeca8327fc4b967069cc82047b [file] [log] [blame]
ZBDf60356c2025-04-03 20:09:51 +08001import js from '@eslint/js'
2import globals from 'globals'
3import reactHooks from 'eslint-plugin-react-hooks'
4import reactRefresh from 'eslint-plugin-react-refresh'
5
6export default [
7 { ignores: ['dist'] },
8 {
9 files: ['**/*.{js,jsx}'],
10 languageOptions: {
11 ecmaVersion: 2020,
12 globals: globals.browser,
13 parserOptions: {
14 ecmaVersion: 'latest',
15 ecmaFeatures: { jsx: true },
16 sourceType: 'module',
17 },
18 },
19 plugins: {
20 'react-hooks': reactHooks,
21 'react-refresh': reactRefresh,
22 },
23 rules: {
24 ...js.configs.recommended.rules,
25 ...reactHooks.configs.recommended.rules,
26 'no-unused-vars': ['error', { varsIgnorePattern: '^[A-Z_]' }],
27 'react-refresh/only-export-components': [
28 'warn',
29 { allowConstantExport: true },
30 ],
31 },
32 },
33]