.eslintrc.js 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229
  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. "overrides": [
  29. {
  30. "files": ["test/Util/*.js"],
  31. "rules": {
  32. "@typescript-eslint/explicit-function-return-type": "off",
  33. "@typescript-eslint/typedef": "off",
  34. }
  35. }
  36. ],
  37. "rules": {
  38. "@typescript-eslint/dot-notation": "error",
  39. "@typescript-eslint/explicit-function-return-type": "error",
  40. "@typescript-eslint/explicit-member-accessibility": [
  41. "off",
  42. {
  43. "accessibility": "explicit"
  44. }
  45. ],
  46. "@typescript-eslint/indent": [
  47. "off",
  48. 2,
  49. {
  50. "CallExpression": {
  51. "arguments": "first"
  52. },
  53. "FunctionDeclaration": {
  54. "parameters": "first"
  55. },
  56. "FunctionExpression": {
  57. "parameters": "first"
  58. }
  59. }
  60. ],
  61. "@typescript-eslint/member-delimiter-style": [
  62. "error",
  63. {
  64. "multiline": {
  65. "delimiter": "semi",
  66. "requireLast": true
  67. },
  68. "singleline": {
  69. "delimiter": "comma",
  70. "requireLast": false
  71. }
  72. }
  73. ],
  74. "@typescript-eslint/member-ordering": "off",
  75. "@typescript-eslint/naming-convention": "off",
  76. "@typescript-eslint/no-empty-function": "error",
  77. "@typescript-eslint/no-explicit-any": "off",
  78. "@typescript-eslint/no-inferrable-types": "off",
  79. "@typescript-eslint/no-parameter-properties": "error",
  80. "@typescript-eslint/no-require-imports": "off",
  81. "@typescript-eslint/no-shadow": [
  82. "error",
  83. {
  84. "hoist": "all"
  85. }
  86. ],
  87. "@typescript-eslint/no-unused-expressions": "error",
  88. "@typescript-eslint/no-var-requires": "error",
  89. "@typescript-eslint/prefer-namespace-keyword": "error",
  90. "@typescript-eslint/quotes": [
  91. "error",
  92. "double",
  93. {
  94. "avoidEscape": true
  95. }
  96. ],
  97. "@typescript-eslint/semi": [
  98. "error"
  99. ],
  100. "@typescript-eslint/typedef": [
  101. "error",
  102. {
  103. // we could add this requirement for arrow (function) parameters too,
  104. // but we have a lot of arrow parameters without types already (~25),
  105. // and a lot of them look ugly and unnecessarily explicit with types,
  106. // the type info is usually obvious there.
  107. "arrowParameter": false,
  108. "variableDeclaration": true
  109. }
  110. ],
  111. "@typescript-eslint/type-annotation-spacing": "error",
  112. "brace-style": [
  113. "off",
  114. "1tbs"
  115. ],
  116. "comma-dangle": "off",
  117. "curly": "error",
  118. "default-case": "error",
  119. "eol-last": "error",
  120. "eqeqeq": [
  121. "error",
  122. "smart"
  123. ],
  124. "guard-for-in": "error",
  125. // this misfires in Typescript
  126. /*"id-blacklist": [
  127. "error",
  128. "any",
  129. "Number",
  130. "number",
  131. "String",
  132. "string",
  133. "Boolean",
  134. "boolean",
  135. //"Undefined",
  136. //"undefined"
  137. ],*/
  138. "id-match": "error",
  139. "jsdoc/check-alignment": "error",
  140. "jsdoc/check-indentation": "off",
  141. "jsdoc/newline-after-description": "off",
  142. "max-len": [
  143. "error",
  144. {
  145. "code": 160
  146. }
  147. ],
  148. "no-bitwise": "error",
  149. "no-caller": "error",
  150. "no-cond-assign": "error",
  151. "no-console": [
  152. "error",
  153. {
  154. "allow": [
  155. "log",
  156. "warn",
  157. "dir",
  158. "timeLog",
  159. "assert",
  160. "clear",
  161. "count",
  162. "countReset",
  163. "group",
  164. "groupEnd",
  165. "table",
  166. "dirxml",
  167. "error",
  168. "groupCollapsed",
  169. "Console",
  170. "profile",
  171. "profileEnd",
  172. "timeStamp",
  173. "context"
  174. ]
  175. }
  176. ],
  177. "no-debugger": "error",
  178. "no-empty": "error",
  179. "no-eval": "error",
  180. "no-fallthrough": "error",
  181. "no-multiple-empty-lines": "off",
  182. "no-new-wrappers": "error",
  183. "no-null/no-null": "off",
  184. "no-redeclare": "error",
  185. "no-trailing-spaces": "error",
  186. "no-underscore-dangle": "off",
  187. "no-unused-labels": "error",
  188. "no-var": "error",
  189. "prefer-const": "error",
  190. "radix": "error",
  191. "spaced-comment": [
  192. "off",
  193. "always",
  194. {
  195. "markers": [
  196. "/"
  197. ]
  198. }
  199. ],
  200. // using this requires two extra modules: tslint and @typescript-eslint/tslint.
  201. // "@typescript-eslint/tslint/config": [
  202. // "error",
  203. // {
  204. // "rules": {
  205. // "object-literal-sort-keys": true,
  206. // "typedef": [
  207. // true,
  208. // "call-signature",
  209. // "parameter",
  210. // "property-declaration",
  211. // "variable-declaration",
  212. // "member-variable-declaration"
  213. // ],
  214. // "whitespace": [
  215. // true,
  216. // "check-branch",
  217. // "check-decl",
  218. // "check-operator",
  219. // "check-separator",
  220. // "check-type"
  221. // ]
  222. // }
  223. // }
  224. // ]
  225. }
  226. };