.eslintrc.json 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. {
  2. "env": {
  3. "browser": true,
  4. "es6": true,
  5. "jest": true
  6. },
  7. "globals": {
  8. "Atomics": "readonly",
  9. "SharedArrayBuffer": "readonly"
  10. },
  11. "parser": "@typescript-eslint/parser",
  12. "parserOptions": {
  13. "ecmaFeatures": {
  14. "jsx": true
  15. },
  16. "ecmaVersion": 2018,
  17. "sourceType": "module",
  18. "project": [
  19. "./tsconfig.json",
  20. "./src/setupTests.ts"
  21. ]
  22. },
  23. "plugins": [
  24. "react",
  25. "@typescript-eslint",
  26. "prettier",
  27. "react-hooks"
  28. ],
  29. "extends": [
  30. "airbnb",
  31. "airbnb-typescript",
  32. "plugin:@typescript-eslint/recommended",
  33. "plugin:jest-dom/recommended",
  34. "plugin:prettier/recommended",
  35. "eslint:recommended",
  36. "plugin:react/recommended",
  37. "prettier"
  38. ],
  39. "rules": {
  40. "react/no-unused-prop-types": "off",
  41. "react/require-default-props": "off",
  42. "prettier/prettier": "warn",
  43. "@typescript-eslint/explicit-module-boundary-types": "off",
  44. "jsx-a11y/label-has-associated-control": "off",
  45. "import/prefer-default-export": "off",
  46. "@typescript-eslint/no-explicit-any": "error",
  47. "react-hooks/rules-of-hooks": "error", // Checks rules of Hooks
  48. // breaks builds as we still have those warns
  49. "react-hooks/exhaustive-deps": "off", // Checks effect dependencies
  50. "import/no-extraneous-dependencies": [
  51. "error",
  52. {
  53. "devDependencies": true
  54. }
  55. ],
  56. "import/no-cycle": "error",
  57. "import/order": [
  58. "error",
  59. {
  60. "groups": [
  61. "builtin",
  62. "external",
  63. "parent",
  64. "sibling",
  65. "index"
  66. ],
  67. "newlines-between": "always"
  68. }
  69. ],
  70. "import/no-relative-parent-imports": "error",
  71. "no-debugger": "warn",
  72. "react/jsx-props-no-spreading": "off",
  73. "no-param-reassign": [
  74. "error",
  75. {
  76. "props": true,
  77. "ignorePropertyModificationsFor": [
  78. "state"
  79. ]
  80. }
  81. ],
  82. "react/function-component-definition": [
  83. 2,
  84. {
  85. "namedComponents": "arrow-function",
  86. "unnamedComponents": "arrow-function"
  87. }
  88. ],
  89. "react/jsx-no-constructed-context-values": "off",
  90. "react/display-name": "off"
  91. },
  92. "overrides": [
  93. {
  94. "files": [
  95. "**/*.tsx"
  96. ],
  97. "rules": {
  98. "react/prop-types": "off"
  99. }
  100. },
  101. {
  102. "files": [
  103. "*.spec.tsx"
  104. ],
  105. "rules": {
  106. "react/jsx-props-no-spreading": "off"
  107. }
  108. }
  109. ]
  110. }