.eslintrc.js 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. module.exports = {
  2. env: {
  3. browser: true,
  4. es2021: true,
  5. node: true,
  6. },
  7. extends: [
  8. 'eslint:recommended',
  9. '@typescript-eslint/recommended',
  10. '@typescript-eslint/recommended-requiring-type-checking',
  11. ],
  12. parser: '@typescript-eslint/parser',
  13. parserOptions: {
  14. ecmaVersion: 'latest',
  15. sourceType: 'module',
  16. project: './tsconfig.json',
  17. },
  18. plugins: [
  19. '@typescript-eslint',
  20. 'react',
  21. 'react-hooks',
  22. ],
  23. rules: {
  24. // React specific rules
  25. 'react/jsx-uses-react': 'off',
  26. 'react/react-in-jsx-scope': 'off',
  27. 'react-hooks/rules-of-hooks': 'error',
  28. 'react-hooks/exhaustive-deps': 'warn',
  29. // TypeScript rules
  30. '@typescript-eslint/no-unused-vars': 'error',
  31. '@typescript-eslint/explicit-function-return-type': 'off',
  32. '@typescript-eslint/explicit-module-boundary-types': 'off',
  33. '@typescript-eslint/no-explicit-any': 'warn',
  34. // General rules
  35. 'no-console': 'warn',
  36. 'prefer-const': 'error',
  37. 'no-var': 'error',
  38. },
  39. settings: {
  40. react: {
  41. version: 'detect',
  42. },
  43. },
  44. };