eslint.config.js 844 B

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