.eslintrc.js 6.9 KB

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