.eslintrc 2.2 KB

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