.eslintrc.js 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. module.exports = {
  2. env: {
  3. browser: true,
  4. es2021: true,
  5. node: true,
  6. commonjs: true,
  7. },
  8. extends: [
  9. 'eslint:recommended',
  10. 'plugin:@typescript-eslint/recommended',
  11. 'plugin:react/recommended',
  12. 'plugin:react-hooks/recommended',
  13. 'plugin:prettier/recommended',
  14. 'prettier',
  15. ],
  16. parser: '@typescript-eslint/parser',
  17. parserOptions: {
  18. ecmaFeatures: {
  19. jsx: true,
  20. },
  21. ecmaVersion: 'latest',
  22. sourceType: 'module',
  23. },
  24. plugins: ['@typescript-eslint', 'prettier'],
  25. rules: {
  26. 'prettier/prettier': 'error',
  27. 'react/react-in-jsx-scope': 'off',
  28. 'react/prop-types': 'off',
  29. '@typescript-eslint/no-explicit-any': 'off',
  30. '@typescript-eslint/no-unused-expressions': ['error', { allowShortCircuit: true, allowTernary: true }],
  31. '@typescript-eslint/no-unused-vars': [
  32. 'error',
  33. {
  34. args: 'all',
  35. argsIgnorePattern: '^_',
  36. caughtErrors: 'all',
  37. caughtErrorsIgnorePattern: '^_',
  38. destructuredArrayIgnorePattern: '^_',
  39. varsIgnorePattern: '^_',
  40. ignoreRestSiblings: true,
  41. },
  42. ],
  43. quotes: ['error', 'single', { allowTemplateLiterals: true, avoidEscape: true }],
  44. semi: ['error', 'always'],
  45. },
  46. settings: {
  47. react: {
  48. version: 'detect',
  49. },
  50. 'import/resolver': {
  51. typescript: {
  52. alwaysTryTypes: true,
  53. project: './tsconfig.json',
  54. },
  55. },
  56. },
  57. };