.eslintrc 1.8 KB

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