.eslintrc 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. {
  2. "env": {
  3. "browser": false,
  4. "es2021": true,
  5. "node": true
  6. },
  7. "parserOptions": {
  8. "ecmaVersion": 2021,
  9. "sourceType": "module",
  10. "parser": "@typescript-eslint/parser"
  11. },
  12. "extends": [
  13. "eslint:recommended",
  14. "airbnb-base",
  15. "prettier",
  16. "plugin:@typescript-eslint/eslint-recommended",
  17. "plugin:@typescript-eslint/recommended"
  18. ],
  19. "plugins": ["prettier", "eslint-plugin-tsdoc", "@typescript-eslint"],
  20. "rules": {
  21. "no-console": 0,
  22. "no-control-regex": 0,
  23. "no-var": 2,
  24. "no-underscore-dangle": 0,
  25. "radix": 0,
  26. "no-multi-assign": 0,
  27. "no-shadow": 0,
  28. "no-new": 0,
  29. "import/no-unresolved": 0,
  30. "prettier/prettier": ["error"], // end of copied frontend rules
  31. "max-classes-per-file": 0,
  32. "max-len": [
  33. "error",
  34. {
  35. "code": 140,
  36. "ignoreComments": true,
  37. "ignoreUrls": true,
  38. "ignoreTemplateLiterals": true
  39. }
  40. ],
  41. "no-param-reassign": 0,
  42. "implicit-arrow-linebreak": 0,
  43. "import/extensions": 0,
  44. "class-methods-use-this": 0,
  45. "tsdoc/syntax": "warn",
  46. "@typescript-eslint/no-empty-function": 0,
  47. "@typescript-eslint/no-this-alias": 0,
  48. "@typescript-eslint/no-non-null-assertion": 0,
  49. "@typescript-eslint/naming-convention": [
  50. "error",
  51. {
  52. "selector": "memberLike",
  53. "modifiers": ["private"],
  54. "format": null,
  55. "leadingUnderscore": "require"
  56. },
  57. {
  58. "selector": "memberLike",
  59. "modifiers": ["protected"],
  60. "format": null,
  61. "leadingUnderscore": "require"
  62. }
  63. ],
  64. "no-void": 0,
  65. "import/no-extraneous-dependencies": [
  66. "error",
  67. {
  68. "devDependencies": ["**/*.test.ts", "**/*.spec.ts"]
  69. }
  70. ],
  71. "no-restricted-syntax": [
  72. "error",
  73. {
  74. "selector": "ForInStatement",
  75. "message": "for..in loops iterate over the entire prototype chain, which is virtually never what you want. Use Object.{keys,values,entries}, and iterate over the resulting array."
  76. },
  77. {
  78. "selector": "LabeledStatement",
  79. "message": "Labels are a form of GOTO; using them makes code confusing and hard to maintain and understand."
  80. },
  81. {
  82. "selector": "WithStatement",
  83. "message": "`with` is disallowed in strict mode because it makes code impossible to predict and optimize."
  84. }
  85. ],
  86. "import/prefer-default-export": "off",
  87. "@typescript-eslint/no-explicit-any": 0
  88. },
  89. "overrides": [
  90. {
  91. "files": ["**/*.test.ts", "**/*.spec.ts"],
  92. "rules": {
  93. "no-unused-expressions": "off",
  94. "prefer-arrow-callback": "off",
  95. "func-names": "off"
  96. }
  97. }
  98. ]
  99. }