1
0

eslint.config.js 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. import js from '@eslint/js';
  2. import tseslint from 'typescript-eslint';
  3. import reactHooks from 'eslint-plugin-react-hooks';
  4. import globals from 'globals';
  5. export default [
  6. { ignores: ['node_modules/**', '../web/dist/**'] },
  7. js.configs.recommended,
  8. ...tseslint.configs.recommended.map((config) => ({
  9. ...config,
  10. files: ['**/*.{ts,tsx}'],
  11. })),
  12. {
  13. files: ['**/*.{ts,tsx}'],
  14. plugins: {
  15. 'react-hooks': reactHooks,
  16. },
  17. languageOptions: {
  18. ecmaVersion: 2022,
  19. sourceType: 'module',
  20. globals: {
  21. ...globals.browser,
  22. },
  23. },
  24. rules: {
  25. ...reactHooks.configs.recommended.rules,
  26. '@typescript-eslint/no-unused-vars': ['warn', {
  27. argsIgnorePattern: '^_',
  28. varsIgnorePattern: '^_',
  29. caughtErrorsIgnorePattern: '^_',
  30. }],
  31. 'no-empty': ['error', { allowEmptyCatch: true }],
  32. 'react-hooks/set-state-in-effect': 'off',
  33. 'react-hooks/purity': 'off',
  34. 'react-hooks/react-compiler': 'off',
  35. 'react-hooks/preserve-manual-memoization': 'off',
  36. 'react-hooks/immutability': 'off',
  37. 'react-hooks/refs': 'off',
  38. },
  39. },
  40. ];