.eslintrc 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  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": [
  69. "**/*.test.ts",
  70. "**/*.spec.ts",
  71. "src/tests/**/*.ts"
  72. ]
  73. }
  74. ],
  75. "no-restricted-syntax": [
  76. "error",
  77. {
  78. "selector": "ForInStatement",
  79. "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."
  80. },
  81. {
  82. "selector": "LabeledStatement",
  83. "message": "Labels are a form of GOTO; using them makes code confusing and hard to maintain and understand."
  84. },
  85. {
  86. "selector": "WithStatement",
  87. "message": "`with` is disallowed in strict mode because it makes code impossible to predict and optimize."
  88. }
  89. ],
  90. "import/prefer-default-export": "off",
  91. "@typescript-eslint/no-explicit-any": 0
  92. },
  93. "overrides": [
  94. {
  95. "files": [
  96. "**/*.test.ts",
  97. "**/*.spec.ts",
  98. "src/tests/**/*.ts"
  99. ],
  100. "rules": {
  101. "no-unused-expressions": "off",
  102. "prefer-arrow-callback": "off",
  103. "func-names": "off",
  104. "@typescript-eslint/ban-ts-comment": "off"
  105. }
  106. }
  107. ]
  108. }