eslint.config.js 1003 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. import js from '@eslint/js'
  2. import globals from 'globals'
  3. import react from 'eslint-plugin-react'
  4. import reactHooks from 'eslint-plugin-react-hooks'
  5. import reactRefresh from 'eslint-plugin-react-refresh'
  6. export 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. settings: { react: { version: '18.3' } },
  20. plugins: {
  21. react,
  22. 'react-hooks': reactHooks,
  23. 'react-refresh': reactRefresh,
  24. },
  25. rules: {
  26. ...js.configs.recommended.rules,
  27. ...react.configs.recommended.rules,
  28. ...react.configs['jsx-runtime'].rules,
  29. ...reactHooks.configs.recommended.rules,
  30. 'react/jsx-no-target-blank': 'off',
  31. 'react-refresh/only-export-components': [
  32. 'warn',
  33. { allowConstantExport: true },
  34. ],
  35. },
  36. },
  37. ]