.eslintrc.json 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. {
  2. "extends": "standard-with-typescript",
  3. "rules": {
  4. "eol-last": [
  5. "error",
  6. "always"
  7. ],
  8. "indent": "off",
  9. "no-lone-blocks": "off",
  10. "no-mixed-operators": "off",
  11. "max-len": [
  12. "error",
  13. {
  14. "code": 140
  15. }
  16. ],
  17. "array-bracket-spacing": [
  18. "error",
  19. "always"
  20. ],
  21. "quote-props": [
  22. "error",
  23. "consistent-as-needed"
  24. ],
  25. "padded-blocks": "off",
  26. "prefer-regex-literals": "off",
  27. "no-async-promise-executor": "off",
  28. "dot-notation": "off",
  29. "promise/param-names": "off",
  30. "import/first": "off",
  31. "operator-linebreak": [
  32. "error",
  33. "after",
  34. {
  35. "overrides": {
  36. "?": "before",
  37. ":": "before"
  38. }
  39. }
  40. ],
  41. "quotes": "off",
  42. "@typescript-eslint/indent": [
  43. "error",
  44. 2,
  45. {
  46. "SwitchCase": 1,
  47. "MemberExpression": "off",
  48. // https://github.com/eslint/eslint/issues/15299
  49. "ignoredNodes": ["PropertyDefinition"]
  50. }
  51. ],
  52. "@typescript-eslint/consistent-type-assertions": [
  53. "error",
  54. {
  55. "assertionStyle": "as"
  56. }
  57. ],
  58. "@typescript-eslint/array-type": [
  59. "error",
  60. {
  61. "default": "array"
  62. }
  63. ],
  64. "@typescript-eslint/restrict-template-expressions": [
  65. "off",
  66. {
  67. "allowNumber": "true"
  68. }
  69. ],
  70. "@typescript-eslint/no-this-alias": [
  71. "error",
  72. {
  73. "allowDestructuring": true, // Allow `const { props, state } = this`; false by default
  74. "allowedNames": ["self"] // Allow `const self = this`; `[]` by default
  75. }
  76. ],
  77. "@typescript-eslint/return-await": "off",
  78. "@typescript-eslint/dot-notation": "off",
  79. "@typescript-eslint/method-signature-style": "off",
  80. "@typescript-eslint/no-base-to-string": "off",
  81. "@typescript-eslint/quotes": [
  82. "error",
  83. "single",
  84. {
  85. "avoidEscape": true,
  86. "allowTemplateLiterals": true
  87. }
  88. ],
  89. "@typescript-eslint/no-var-requires": "off",
  90. "@typescript-eslint/explicit-function-return-type": "off",
  91. "@typescript-eslint/promise-function-async": "off",
  92. "@typescript-eslint/no-dynamic-delete": "off",
  93. "@typescript-eslint/no-unnecessary-boolean-literal-compare": "off",
  94. "@typescript-eslint/strict-boolean-expressions": "off",
  95. "@typescript-eslint/consistent-type-definitions": "off",
  96. "@typescript-eslint/no-misused-promises": "off",
  97. "@typescript-eslint/no-namespace": "off",
  98. "@typescript-eslint/no-empty-interface": "off",
  99. "@typescript-eslint/no-extraneous-class": "off",
  100. "@typescript-eslint/no-use-before-define": "off",
  101. "require-await": "off",
  102. "@typescript-eslint/require-await": "error",
  103. // bugged but useful
  104. "@typescript-eslint/restrict-plus-operands": "off"
  105. },
  106. "ignorePatterns": [
  107. "node_modules/"
  108. ],
  109. "parserOptions": {
  110. "EXPERIMENTAL_useSourceOfProjectReferenceRedirect": true,
  111. "project": [
  112. "./tsconfig.json",
  113. "./shared/tsconfig.json",
  114. "./scripts/tsconfig.json",
  115. "./server/tsconfig.json",
  116. "./server/tools/tsconfig.json"
  117. ]
  118. }
  119. }