.eslintrc.json 3.8 KB

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