eslint.config.js 1.1 KB

123456789101112131415161718192021222324252627282930313233343536
  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 stylistic from '@stylistic/eslint-plugin'
  6. import tseslint from 'typescript-eslint'
  7. import prettier from 'eslint-config-prettier'
  8. import react from 'eslint-plugin-react'
  9. export default tseslint.config(
  10. { ignores: ['dist'] },
  11. {
  12. extends: [js.configs.recommended, ...tseslint.configs.recommended, prettier],
  13. files: ['**/*.{ts,tsx,js,jsx}'],
  14. languageOptions: {
  15. ecmaVersion: 2020,
  16. globals: globals.browser
  17. },
  18. settings: { react: { version: '19.0' } },
  19. plugins: {
  20. 'react-hooks': reactHooks,
  21. 'react-refresh': reactRefresh,
  22. '@stylistic': stylistic,
  23. react
  24. },
  25. rules: {
  26. ...reactHooks.configs.recommended.rules,
  27. 'react-refresh/only-export-components': ['warn', { allowConstantExport: true }],
  28. ...react.configs.recommended.rules,
  29. ...react.configs['jsx-runtime'].rules,
  30. '@stylistic/indent': ['error', 2],
  31. '@stylistic/quotes': ['error', 'single'],
  32. '@typescript-eslint/no-explicit-any': ['off']
  33. }
  34. }
  35. )