eslint.config.js 873 B

1234567891011121314151617181920212223242526272829303132
  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. parserOptions: {
  15. project: ['./tsconfig.json', './tsconfig.node.json'],
  16. tsconfigRootDir: import.meta.dirname,
  17. },
  18. },
  19. plugins: {
  20. 'react-hooks': reactHooks,
  21. 'react-refresh': reactRefresh,
  22. },
  23. rules: {
  24. ...reactHooks.configs.recommended.rules,
  25. 'react-refresh/only-export-components': [
  26. 'warn',
  27. { allowConstantExport: true },
  28. ],
  29. },
  30. },
  31. )