.eslintrc.js 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220
  1. /*
  2. 👋 Hi! This file was autogenerated by tslint-to-eslint-config.
  3. https://github.com/typescript-eslint/tslint-to-eslint-config
  4. It represents the closest reasonable ESLint configuration to this
  5. project's original TSLint configuration.
  6. We recommend eventually switching this configuration to extend from
  7. the recommended rulesets in typescript-eslint.
  8. https://github.com/typescript-eslint/tslint-to-eslint-config/blob/master/docs/FAQs.md
  9. Happy linting! 💖
  10. */
  11. module.exports = {
  12. "env": {
  13. "browser": true,
  14. "es6": true,
  15. "node": true
  16. },
  17. "parser": "@typescript-eslint/parser",
  18. "parserOptions": {
  19. "project": "tsconfig.json",
  20. "sourceType": "module"
  21. },
  22. "plugins": [
  23. "eslint-plugin-jsdoc",
  24. "eslint-plugin-no-null",
  25. "@typescript-eslint",
  26. //"@typescript-eslint/tslint"
  27. ],
  28. "rules": {
  29. "@typescript-eslint/dot-notation": "error",
  30. "@typescript-eslint/explicit-function-return-type": "error",
  31. "@typescript-eslint/explicit-member-accessibility": [
  32. "off",
  33. {
  34. "accessibility": "explicit"
  35. }
  36. ],
  37. "@typescript-eslint/indent": [
  38. "off",
  39. 2,
  40. {
  41. "CallExpression": {
  42. "arguments": "first"
  43. },
  44. "FunctionDeclaration": {
  45. "parameters": "first"
  46. },
  47. "FunctionExpression": {
  48. "parameters": "first"
  49. }
  50. }
  51. ],
  52. "@typescript-eslint/member-delimiter-style": [
  53. "error",
  54. {
  55. "multiline": {
  56. "delimiter": "semi",
  57. "requireLast": true
  58. },
  59. "singleline": {
  60. "delimiter": "comma",
  61. "requireLast": false
  62. }
  63. }
  64. ],
  65. "@typescript-eslint/member-ordering": "off",
  66. "@typescript-eslint/naming-convention": "off",
  67. "@typescript-eslint/no-empty-function": "error",
  68. "@typescript-eslint/no-explicit-any": "off",
  69. "@typescript-eslint/no-inferrable-types": "off",
  70. "@typescript-eslint/no-parameter-properties": "error",
  71. "@typescript-eslint/no-require-imports": "off",
  72. "@typescript-eslint/no-shadow": [
  73. "error",
  74. {
  75. "hoist": "all"
  76. }
  77. ],
  78. "@typescript-eslint/no-unused-expressions": "error",
  79. "@typescript-eslint/no-var-requires": "error",
  80. "@typescript-eslint/prefer-namespace-keyword": "error",
  81. "@typescript-eslint/quotes": [
  82. "error",
  83. "double",
  84. {
  85. "avoidEscape": true
  86. }
  87. ],
  88. "@typescript-eslint/semi": [
  89. "error"
  90. ],
  91. "@typescript-eslint/typedef": [
  92. "error",
  93. {
  94. // we could add this requirement for arrow (function) parameters too,
  95. // but we have a lot of arrow parameters without types already (~25),
  96. // and a lot of them look ugly and unnecessarily explicit with types,
  97. // the type info is usually obvious there.
  98. "arrowParameter": false,
  99. "variableDeclaration": true
  100. }
  101. ],
  102. "@typescript-eslint/type-annotation-spacing": "error",
  103. "brace-style": [
  104. "off",
  105. "1tbs"
  106. ],
  107. "comma-dangle": "off",
  108. "curly": "error",
  109. "default-case": "error",
  110. "eol-last": "error",
  111. "eqeqeq": [
  112. "error",
  113. "smart"
  114. ],
  115. "guard-for-in": "error",
  116. // this misfires in Typescript
  117. /*"id-blacklist": [
  118. "error",
  119. "any",
  120. "Number",
  121. "number",
  122. "String",
  123. "string",
  124. "Boolean",
  125. "boolean",
  126. //"Undefined",
  127. //"undefined"
  128. ],*/
  129. "id-match": "error",
  130. "jsdoc/check-alignment": "error",
  131. "jsdoc/check-indentation": "off",
  132. "jsdoc/newline-after-description": "off",
  133. "max-len": [
  134. "error",
  135. {
  136. "code": 160
  137. }
  138. ],
  139. "no-bitwise": "error",
  140. "no-caller": "error",
  141. "no-cond-assign": "error",
  142. "no-console": [
  143. "error",
  144. {
  145. "allow": [
  146. "log",
  147. "warn",
  148. "dir",
  149. "timeLog",
  150. "assert",
  151. "clear",
  152. "count",
  153. "countReset",
  154. "group",
  155. "groupEnd",
  156. "table",
  157. "dirxml",
  158. "error",
  159. "groupCollapsed",
  160. "Console",
  161. "profile",
  162. "profileEnd",
  163. "timeStamp",
  164. "context"
  165. ]
  166. }
  167. ],
  168. "no-debugger": "error",
  169. "no-empty": "error",
  170. "no-eval": "error",
  171. "no-fallthrough": "error",
  172. "no-multiple-empty-lines": "off",
  173. "no-new-wrappers": "error",
  174. "no-null/no-null": "off",
  175. "no-redeclare": "error",
  176. "no-trailing-spaces": "error",
  177. "no-underscore-dangle": "off",
  178. "no-unused-labels": "error",
  179. "no-var": "error",
  180. "prefer-const": "error",
  181. "radix": "error",
  182. "spaced-comment": [
  183. "off",
  184. "always",
  185. {
  186. "markers": [
  187. "/"
  188. ]
  189. }
  190. ],
  191. // using this requires two extra modules: tslint and @typescript-eslint/tslint.
  192. // "@typescript-eslint/tslint/config": [
  193. // "error",
  194. // {
  195. // "rules": {
  196. // "object-literal-sort-keys": true,
  197. // "typedef": [
  198. // true,
  199. // "call-signature",
  200. // "parameter",
  201. // "property-declaration",
  202. // "variable-declaration",
  203. // "member-variable-declaration"
  204. // ],
  205. // "whitespace": [
  206. // true,
  207. // "check-branch",
  208. // "check-decl",
  209. // "check-operator",
  210. // "check-separator",
  211. // "check-type"
  212. // ]
  213. // }
  214. // }
  215. // ]
  216. }
  217. };