eslint.config.js 734 B

12345678910111213141516171819202122232425262728
  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. import tseslint from 'typescript-eslint'
  6. export default tseslint.config(
  7. { ignores: ['dist'] },
  8. {
  9. extends: [js.configs.recommended, ...tseslint.configs.recommended],
  10. files: ['**/*.{ts,tsx}'],
  11. languageOptions: {
  12. ecmaVersion: 2020,
  13. globals: globals.browser,
  14. },
  15. plugins: {
  16. 'react-hooks': reactHooks,
  17. 'react-refresh': reactRefresh,
  18. },
  19. rules: {
  20. ...reactHooks.configs.recommended.rules,
  21. 'react-refresh/only-export-components': [
  22. 'warn',
  23. { allowConstantExport: true },
  24. ],
  25. },
  26. },
  27. )