.eslintrc 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. {
  2. "parser": "@typescript-eslint/parser",
  3. "parserOptions": {
  4. "project": "./tsconfig.json"
  5. },
  6. "extends": [
  7. "airbnb",
  8. "airbnb-typescript",
  9. "prettier",
  10. "plugin:@typescript-eslint/eslint-recommended",
  11. "plugin:@typescript-eslint/recommended",
  12. "plugin:react/recommended",
  13. "plugin:react-hooks/recommended"
  14. ],
  15. "plugins": [
  16. "prettier"
  17. ],
  18. "rules": {
  19. "prettier/prettier": [
  20. "error"
  21. ],
  22. // Resolves https://stackoverflow.com/questions/59265981/typescript-eslint-missing-file-extension-ts-import-extensions/59268871#59268871
  23. "import/extensions": [
  24. "error",
  25. "ignorePackages",
  26. {
  27. "": "never",
  28. "ts": "never",
  29. "tsx": "never"
  30. }
  31. ]
  32. },
  33. "settings": {
  34. "react": {
  35. "version": "detect"
  36. }
  37. },
  38. "overrides": [
  39. {
  40. "files": [
  41. "*.ts",
  42. "*.tsx"
  43. ],
  44. "rules": {
  45. // Allow state modification in reduce and Redux reducers
  46. "no-param-reassign": [
  47. "error",
  48. {
  49. "props": true,
  50. "ignorePropertyModificationsFor": [
  51. "acc",
  52. "state"
  53. ]
  54. }
  55. ],
  56. // For https://stackoverflow.com/questions/55844608/stuck-with-eslint-error-i-e-separately-loops-should-be-avoided-in-favor-of-arra
  57. "no-restricted-syntax": "off",
  58. "react/require-default-props": "off",
  59. "import/prefer-default-export": "off",
  60. "no-underscore-dangle": "off",
  61. "jsx-a11y/no-static-element-interactions": "off",
  62. "jsx-a11y/click-events-have-key-events": "off",
  63. // For https://github.com/airbnb/javascript/issues/1885
  64. "jsx-a11y/label-has-associated-control": [
  65. 2,
  66. {
  67. "required": {
  68. "some": [
  69. "nesting",
  70. "id"
  71. ]
  72. }
  73. }
  74. ],
  75. "react/no-array-index-key": "off",
  76. "react-hooks/exhaustive-deps": "off",
  77. "import/no-extraneous-dependencies": "off",
  78. "react/react-in-jsx-scope": "off"
  79. },
  80. "parserOptions": {
  81. "project": [
  82. "**/tsconfig.json"
  83. ]
  84. }
  85. }
  86. ]
  87. }