// Author: fruit.com.cn import js from '@eslint/js'; import react from 'eslint-plugin-react'; import reactHooks from 'eslint-plugin-react-hooks'; import globals from 'globals'; export default [ { ignores: ['dist/**', 'node_modules/**'] }, { files: ['**/*.{js,jsx}'], languageOptions: { ecmaVersion: 'latest', sourceType: 'module', globals: { ...globals.browser }, parserOptions: { ecmaFeatures: { jsx: true } }, }, plugins: { react, 'react-hooks': reactHooks }, settings: { react: { version: 'detect' } }, rules: { ...js.configs.recommended.rules, ...react.configs.recommended.rules, ...react.configs['jsx-runtime'].rules, 'react/prop-types': 'off', 'react-hooks/rules-of-hooks': 'error', 'react-hooks/exhaustive-deps': 'warn', }, }, { files: ['vite.config.js', 'eslint.config.js'], languageOptions: { globals: { ...globals.node } }, }, ];