@definitelytyped/eslint-plugin 0.0.190 → 0.0.192

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (329) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/dist/configs/all.js +29 -2
  3. package/dist/configs/all.js.map +1 -1
  4. package/dist/index.d.ts +1 -1
  5. package/dist/index.js +4 -4
  6. package/dist/index.js.map +1 -1
  7. package/dist/rules/export-just-namespace.js +1 -1
  8. package/dist/rules/export-just-namespace.js.map +1 -1
  9. package/dist/rules/no-bad-reference.js +6 -5
  10. package/dist/rules/no-bad-reference.js.map +1 -1
  11. package/dist/rules/no-dead-reference.js +6 -3
  12. package/dist/rules/no-dead-reference.js.map +1 -1
  13. package/dist/rules/no-declare-current-package.js +2 -2
  14. package/dist/rules/no-declare-current-package.js.map +1 -1
  15. package/dist/rules/no-import-default-of-export-equals.js +1 -1
  16. package/dist/rules/no-import-default-of-export-equals.js.map +1 -1
  17. package/dist/rules/no-import-of-dev-dependencies.js +3 -3
  18. package/dist/rules/no-import-of-dev-dependencies.js.map +1 -1
  19. package/dist/rules/no-old-dt-header.js +2 -2
  20. package/dist/rules/no-old-dt-header.js.map +1 -1
  21. package/dist/rules/no-relative-import-in-test.js +1 -1
  22. package/dist/rules/no-relative-import-in-test.js.map +1 -1
  23. package/dist/rules/no-self-import.js +1 -1
  24. package/dist/rules/no-self-import.js.map +1 -1
  25. package/dist/rules/no-single-declare-module.js +2 -2
  26. package/dist/rules/no-single-declare-module.js.map +1 -1
  27. package/dist/rules/no-useless-files.js +2 -2
  28. package/dist/rules/no-useless-files.js.map +1 -1
  29. package/dist/rules/prefer-declare-function.js +1 -1
  30. package/dist/rules/prefer-declare-function.js.map +1 -1
  31. package/dist/rules/strict-export-declare-modifiers.js +1 -1
  32. package/dist/rules/strict-export-declare-modifiers.js.map +1 -1
  33. package/package.json +8 -5
  34. package/src/configs/all.ts +28 -1
  35. package/src/index.ts +2 -2
  36. package/src/rules/export-just-namespace.ts +1 -1
  37. package/src/rules/no-bad-reference.ts +6 -5
  38. package/src/rules/no-dead-reference.ts +6 -3
  39. package/src/rules/no-declare-current-package.ts +2 -2
  40. package/src/rules/no-import-default-of-export-equals.ts +1 -1
  41. package/src/rules/no-import-of-dev-dependencies.ts +3 -3
  42. package/src/rules/no-old-dt-header.ts +2 -2
  43. package/src/rules/no-relative-import-in-test.ts +1 -1
  44. package/src/rules/no-self-import.ts +1 -1
  45. package/src/rules/no-single-declare-module.ts +2 -2
  46. package/src/rules/no-useless-files.ts +2 -2
  47. package/src/rules/prefer-declare-function.ts +1 -1
  48. package/src/rules/strict-export-declare-modifiers.ts +1 -1
  49. package/test/__file_snapshots__/types/export-just-namespace/bad1.d.ts.lint +11 -0
  50. package/test/__file_snapshots__/types/export-just-namespace/bad2.d.ts.lint +11 -0
  51. package/test/__file_snapshots__/types/export-just-namespace/bad3.d.ts.lint +12 -0
  52. package/test/__file_snapshots__/types/export-just-namespace/export-just-namespace-tests.ts.lint +10 -0
  53. package/test/__file_snapshots__/types/export-just-namespace/good1.d.ts.lint +5 -0
  54. package/test/__file_snapshots__/types/export-just-namespace/good2.d.ts.lint +5 -0
  55. package/test/__file_snapshots__/types/export-just-namespace/good3.d.ts.lint +5 -0
  56. package/test/__file_snapshots__/types/export-just-namespace/good4.d.ts.lint +5 -0
  57. package/test/__file_snapshots__/types/export-just-namespace/good5.d.ts.lint +5 -0
  58. package/test/__file_snapshots__/types/export-just-namespace/good6.d.ts.lint +5 -0
  59. package/test/__file_snapshots__/types/export-just-namespace/good7.d.ts.lint +7 -0
  60. package/test/__file_snapshots__/types/export-just-namespace/good8.d.ts.lint +7 -0
  61. package/test/__file_snapshots__/types/export-just-namespace/good9.d.ts.lint +15 -0
  62. package/test/__file_snapshots__/types/foo/foo-tests.ts.lint +10 -0
  63. package/test/__file_snapshots__/types/foo/index.d.ts.lint +5 -0
  64. package/test/__file_snapshots__/types/foo/v1/foo-tests.ts.lint +10 -0
  65. package/test/__file_snapshots__/types/foo/v1/index.d.ts.lint +5 -0
  66. package/test/__file_snapshots__/types/no-any-union/bad.d.ts.lint +10 -0
  67. package/test/__file_snapshots__/types/no-any-union/index.d.ts.lint +5 -0
  68. package/test/__file_snapshots__/types/no-any-union/no-any-union-tests.ts.lint +10 -0
  69. package/test/__file_snapshots__/types/no-bad-reference/index.d.ts.lint +43 -0
  70. package/test/__file_snapshots__/types/no-bad-reference/no-bad-reference-tests.ts.lint +14 -0
  71. package/test/__file_snapshots__/types/no-bad-reference/v0.1/index.d.ts.lint +48 -0
  72. package/test/__file_snapshots__/types/no-bad-reference/v0.1/no-bad-reference-tests.ts.lint +10 -0
  73. package/test/__file_snapshots__/types/no-bad-reference/v11/index.d.ts.lint +48 -0
  74. package/test/__file_snapshots__/types/no-bad-reference/v11/no-bad-reference-tests.ts.lint +10 -0
  75. package/test/__file_snapshots__/types/no-const-enum/bad.d.ts.lint +10 -0
  76. package/test/__file_snapshots__/types/no-const-enum/index.d.ts.lint +5 -0
  77. package/test/__file_snapshots__/types/no-const-enum/no-const-enum-tests.ts.lint +10 -0
  78. package/test/__file_snapshots__/types/no-dead-reference/bad.d.ts.lint +18 -0
  79. package/test/__file_snapshots__/types/no-dead-reference/bad2.d.ts.lint +15 -0
  80. package/test/__file_snapshots__/types/no-dead-reference/bad3.d.ts.lint +17 -0
  81. package/test/__file_snapshots__/types/no-dead-reference/index.d.ts.lint +6 -0
  82. package/test/__file_snapshots__/types/no-dead-reference/no-dead-reference-tests.ts.lint +10 -0
  83. package/test/__file_snapshots__/types/no-declare-current-package/index.d.ts.lint +13 -0
  84. package/test/__file_snapshots__/types/no-declare-current-package/no-declare-current-package-tests.ts.lint +10 -0
  85. package/test/__file_snapshots__/types/no-declare-current-package/test/deep/import.d.ts.lint +13 -0
  86. package/test/__file_snapshots__/types/no-declare-current-package-other/index.d.ts.lint +6 -0
  87. package/test/__file_snapshots__/types/no-declare-current-package-other/no-declare-current-package-other-tests.ts.lint +10 -0
  88. package/test/__file_snapshots__/types/no-import-default-of-export-equals/bad.d.ts.lint +17 -0
  89. package/test/__file_snapshots__/types/no-import-default-of-export-equals/index.d.ts.lint +12 -0
  90. package/test/__file_snapshots__/types/no-import-default-of-export-equals/no-import-default-of-export-equals-tests.ts.lint +10 -0
  91. package/test/__file_snapshots__/types/no-import-of-dev-dependencies/bad.d.ts.lint +29 -0
  92. package/test/__file_snapshots__/types/no-import-of-dev-dependencies/index.d.ts.lint +16 -0
  93. package/test/__file_snapshots__/types/no-import-of-dev-dependencies/no-import-of-dev-dependencies-tests.ts.lint +24 -0
  94. package/test/__file_snapshots__/types/no-old-dt-header/index.d.ts.lint +23 -0
  95. package/test/__file_snapshots__/types/no-old-dt-header/index2.d.ts.lint +14 -0
  96. package/test/__file_snapshots__/types/no-old-dt-header/no-old-dt-header-tests.ts.lint +10 -0
  97. package/test/__file_snapshots__/types/no-old-dt-header/ok1.ts.lint +11 -0
  98. package/test/__file_snapshots__/types/no-old-dt-header/ok2.d.ts.lint +10 -0
  99. package/test/__file_snapshots__/types/no-old-dt-header/ok3.d.ts.lint +10 -0
  100. package/test/__file_snapshots__/types/no-old-dt-header/ok4.d.ts.lint +12 -0
  101. package/test/__file_snapshots__/types/no-relative-import-in-test/abc.d.ts.lint +6 -0
  102. package/test/__file_snapshots__/types/no-relative-import-in-test/bad.d.ts.lint +10 -0
  103. package/test/__file_snapshots__/types/no-relative-import-in-test/index.d.ts.lint +10 -0
  104. package/test/__file_snapshots__/types/no-relative-import-in-test/no-relative-import-in-test/abc.d.ts.lint +6 -0
  105. package/test/__file_snapshots__/types/no-relative-import-in-test/no-relative-import-in-test-tests.ts.lint +10 -0
  106. package/test/__file_snapshots__/types/no-relative-import-in-test/no-relative-import-in-test-tests2.ts.lint +7 -0
  107. package/test/__file_snapshots__/types/no-relative-references/index.d.ts.lint +45 -0
  108. package/test/__file_snapshots__/types/no-relative-references/no-relative-references-tests.ts.lint +10 -0
  109. package/test/__file_snapshots__/types/no-relative-references/other/other.d.ts.lint +31 -0
  110. package/test/__file_snapshots__/types/no-relative-references/v1/index.d.ts.lint +51 -0
  111. package/test/__file_snapshots__/types/no-relative-references/v1/no-relative-references-tests.ts.lint +10 -0
  112. package/test/__file_snapshots__/types/no-relative-references/v1/other/other.d.ts.lint +31 -0
  113. package/test/__file_snapshots__/types/no-self-import/bad.d.ts.lint +35 -0
  114. package/test/__file_snapshots__/types/no-self-import/index.d.ts.lint +11 -0
  115. package/test/__file_snapshots__/types/no-self-import/no-self-import-tests.ts.lint +24 -0
  116. package/test/__file_snapshots__/types/no-single-declare-module/bad.d.ts.lint +13 -0
  117. package/test/__file_snapshots__/types/no-single-declare-module/index.d.ts.lint +6 -0
  118. package/test/__file_snapshots__/types/no-single-declare-module/index2.d.ts.lint +6 -0
  119. package/test/__file_snapshots__/types/no-single-declare-module/index3.d.ts.lint +5 -0
  120. package/test/__file_snapshots__/types/no-single-declare-module/no-single-declare-module-tests.ts.lint +10 -0
  121. package/test/__file_snapshots__/types/no-single-element-tuple-type/bad.d.ts.lint +10 -0
  122. package/test/__file_snapshots__/types/no-single-element-tuple-type/index.d.ts.lint +9 -0
  123. package/test/__file_snapshots__/types/no-single-element-tuple-type/no-single-element-tuple-type-tests.ts.lint +10 -0
  124. package/test/__file_snapshots__/types/no-unnecessary-generics/bad.d.ts.lint +14 -0
  125. package/test/__file_snapshots__/types/no-unnecessary-generics/index.d.ts.lint +11 -0
  126. package/test/__file_snapshots__/types/no-unnecessary-generics/no-unnecessary-generics-tests.ts.lint +44 -0
  127. package/test/__file_snapshots__/types/no-useless-files/bad.d.ts.lint +10 -0
  128. package/test/__file_snapshots__/types/no-useless-files/bad2.d.ts.lint +10 -0
  129. package/test/__file_snapshots__/types/no-useless-files/bad3.d.ts.lint +10 -0
  130. package/test/__file_snapshots__/types/no-useless-files/index.d.ts.lint +5 -0
  131. package/test/__file_snapshots__/types/no-useless-files/index2.d.ts.lint +5 -0
  132. package/test/__file_snapshots__/types/no-useless-files/index3.d.ts.lint +5 -0
  133. package/test/__file_snapshots__/types/no-useless-files/no-useless-files-tests.ts.lint +10 -0
  134. package/test/__file_snapshots__/types/other/index.d.ts.lint +5 -0
  135. package/test/__file_snapshots__/types/other/other-tests.ts.lint +10 -0
  136. package/test/__file_snapshots__/types/other/v1/index.d.ts.lint +5 -0
  137. package/test/__file_snapshots__/types/other/v1/other-tests.ts.lint +10 -0
  138. package/test/__file_snapshots__/types/prefer-declare-function/bad.d.ts.lint +33 -0
  139. package/test/__file_snapshots__/types/prefer-declare-function/index.d.ts.lint +14 -0
  140. package/test/__file_snapshots__/types/prefer-declare-function/prefer-declare-function-tests.ts.lint +10 -0
  141. package/test/__file_snapshots__/types/redundant-undefined/bad.d.ts.lint +15 -0
  142. package/test/__file_snapshots__/types/redundant-undefined/index.d.ts.lint +9 -0
  143. package/test/__file_snapshots__/types/redundant-undefined/redundant-undefined-tests.ts.lint +10 -0
  144. package/test/__file_snapshots__/types/scoped__foo/index.d.ts.lint +5 -0
  145. package/test/__file_snapshots__/types/scoped__foo/scoped__foo-tests.ts.lint +10 -0
  146. package/test/__file_snapshots__/types/scoped__foo/v1/index.d.ts.lint +5 -0
  147. package/test/__file_snapshots__/types/scoped__foo/v1/scoped__foo-tests.ts.lint +10 -0
  148. package/test/__file_snapshots__/types/scoped__no-declare-current-package/index.d.ts.lint +13 -0
  149. package/test/__file_snapshots__/types/scoped__no-declare-current-package/no-declare-current-package-tests.ts.lint +10 -0
  150. package/test/__file_snapshots__/types/scoped__no-declare-current-package/test/deep/import.d.ts.lint +13 -0
  151. package/test/__file_snapshots__/types/scoped__no-relative-references/index.d.ts.lint +45 -0
  152. package/test/__file_snapshots__/types/scoped__no-relative-references/no-relative-references-tests.ts.lint +10 -0
  153. package/test/__file_snapshots__/types/scoped__no-relative-references/other/other.d.ts.lint +31 -0
  154. package/test/__file_snapshots__/types/scoped__no-relative-references/v1/index.d.ts.lint +51 -0
  155. package/test/__file_snapshots__/types/scoped__no-relative-references/v1/no-relative-references-tests.ts.lint +10 -0
  156. package/test/__file_snapshots__/types/scoped__no-relative-references/v1/other/other.d.ts.lint +31 -0
  157. package/test/__file_snapshots__/types/strict-export-declare-modifiers/bad1.d.ts.lint +10 -0
  158. package/test/__file_snapshots__/types/strict-export-declare-modifiers/bad2.d.ts.lint +12 -0
  159. package/test/__file_snapshots__/types/strict-export-declare-modifiers/bad3.d.ts.lint +10 -0
  160. package/test/__file_snapshots__/types/strict-export-declare-modifiers/bad4.d.ts.lint +12 -0
  161. package/test/__file_snapshots__/types/strict-export-declare-modifiers/bad5.d.ts.lint +11 -0
  162. package/test/__file_snapshots__/types/strict-export-declare-modifiers/bad6.d.ts.lint +14 -0
  163. package/test/__file_snapshots__/types/strict-export-declare-modifiers/bad7.d.ts.lint +14 -0
  164. package/test/__file_snapshots__/types/strict-export-declare-modifiers/good1.ts.lint +5 -0
  165. package/test/__file_snapshots__/types/strict-export-declare-modifiers/good2.d.ts.lint +5 -0
  166. package/test/__file_snapshots__/types/strict-export-declare-modifiers/good3.d.ts.lint +5 -0
  167. package/test/__file_snapshots__/types/strict-export-declare-modifiers/good4.d.ts.lint +5 -0
  168. package/test/__file_snapshots__/types/strict-export-declare-modifiers/good5.d.ts.lint +5 -0
  169. package/test/__file_snapshots__/types/strict-export-declare-modifiers/good6.ts.lint +7 -0
  170. package/test/__file_snapshots__/types/strict-export-declare-modifiers/good7.d.ts.lint +6 -0
  171. package/test/__file_snapshots__/types/strict-export-declare-modifiers/good8.d.ts.lint +9 -0
  172. package/test/__file_snapshots__/types/strict-export-declare-modifiers/good9.d.ts.lint +7 -0
  173. package/test/__file_snapshots__/types/strict-export-declare-modifiers/strict-export-declare-modifiers-tests.ts.lint +10 -0
  174. package/test/eslint.test.ts +134 -0
  175. package/test/fixtures/.eslintrc.cjs +4 -0
  176. package/test/fixtures/types/export-just-namespace/bad1.d.ts +2 -0
  177. package/test/fixtures/types/export-just-namespace/bad2.d.ts +2 -0
  178. package/test/fixtures/types/export-just-namespace/bad3.d.ts +3 -0
  179. package/test/fixtures/types/export-just-namespace/export-just-namespace-tests.ts +0 -0
  180. package/test/fixtures/types/export-just-namespace/good1.d.ts +1 -0
  181. package/test/fixtures/types/export-just-namespace/good2.d.ts +1 -0
  182. package/test/fixtures/types/export-just-namespace/good3.d.ts +1 -0
  183. package/test/fixtures/types/export-just-namespace/good4.d.ts +1 -0
  184. package/test/fixtures/types/export-just-namespace/good5.d.ts +1 -0
  185. package/test/fixtures/types/export-just-namespace/good6.d.ts +1 -0
  186. package/test/fixtures/types/export-just-namespace/good7.d.ts +3 -0
  187. package/test/fixtures/types/export-just-namespace/good8.d.ts +3 -0
  188. package/test/fixtures/types/export-just-namespace/good9.d.ts +3 -0
  189. package/test/fixtures/types/export-just-namespace/package.json +8 -0
  190. package/test/fixtures/types/export-just-namespace/tsconfig.json +31 -0
  191. package/test/fixtures/types/no-any-union/bad.d.ts +1 -0
  192. package/test/fixtures/types/no-any-union/index.d.ts +1 -0
  193. package/test/fixtures/types/no-any-union/no-any-union-tests.ts +1 -0
  194. package/test/fixtures/types/no-any-union/package.json +8 -0
  195. package/test/fixtures/types/no-any-union/tsconfig.json +21 -0
  196. package/test/fixtures/types/no-bad-reference/tsconfig.json +1 -1
  197. package/test/fixtures/types/no-bad-reference/v0.1/tsconfig.json +1 -1
  198. package/test/fixtures/types/no-bad-reference/v11/tsconfig.json +1 -1
  199. package/test/fixtures/types/no-const-enum/bad.d.ts +1 -0
  200. package/test/fixtures/types/no-const-enum/index.d.ts +1 -0
  201. package/test/fixtures/types/no-const-enum/no-const-enum-tests.ts +0 -0
  202. package/test/fixtures/types/no-const-enum/package.json +8 -0
  203. package/test/fixtures/types/no-const-enum/tsconfig.json +21 -0
  204. package/test/fixtures/types/no-dead-reference/bad.d.ts +6 -0
  205. package/test/fixtures/types/no-dead-reference/bad2.d.ts +3 -0
  206. package/test/fixtures/types/no-dead-reference/bad3.d.ts +5 -0
  207. package/test/fixtures/types/no-dead-reference/index.d.ts +2 -0
  208. package/test/fixtures/types/no-dead-reference/no-dead-reference-tests.ts +0 -0
  209. package/test/fixtures/types/no-dead-reference/package.json +8 -0
  210. package/test/fixtures/types/no-dead-reference/tsconfig.json +23 -0
  211. package/test/fixtures/types/no-declare-current-package/tsconfig.json +2 -1
  212. package/test/fixtures/types/no-declare-current-package-other/tsconfig.json +1 -1
  213. package/test/fixtures/types/no-import-default-of-export-equals/bad.d.ts +8 -0
  214. package/test/fixtures/types/no-import-default-of-export-equals/index.d.ts +8 -0
  215. package/test/fixtures/types/no-import-default-of-export-equals/no-import-default-of-export-equals-tests.ts +0 -0
  216. package/test/fixtures/types/no-import-default-of-export-equals/package.json +8 -0
  217. package/test/fixtures/types/no-import-default-of-export-equals/tsconfig.json +21 -0
  218. package/test/fixtures/types/no-import-of-dev-dependencies/tsconfig.json +1 -0
  219. package/test/fixtures/types/no-old-dt-header/index.d.ts +14 -0
  220. package/test/fixtures/types/no-old-dt-header/index2.d.ts +2 -0
  221. package/test/fixtures/types/no-old-dt-header/no-old-dt-header-tests.ts +0 -0
  222. package/test/fixtures/types/no-old-dt-header/ok1.ts +2 -0
  223. package/test/fixtures/types/no-old-dt-header/ok2.d.ts +1 -0
  224. package/test/fixtures/types/no-old-dt-header/ok3.d.ts +1 -0
  225. package/test/fixtures/types/no-old-dt-header/ok4.d.ts +3 -0
  226. package/test/fixtures/types/no-old-dt-header/package.json +8 -0
  227. package/test/fixtures/types/no-old-dt-header/tsconfig.json +25 -0
  228. package/test/fixtures/types/no-relative-import-in-test/bad.d.ts +0 -0
  229. package/test/fixtures/types/no-relative-import-in-test/index.d.ts +0 -0
  230. package/test/fixtures/types/no-relative-import-in-test/no-relative-import-in-test-tests.ts +1 -0
  231. package/test/fixtures/types/no-relative-import-in-test/no-relative-import-in-test-tests2.ts +3 -0
  232. package/test/fixtures/types/no-relative-import-in-test/package.json +8 -0
  233. package/test/fixtures/types/no-relative-import-in-test/tsconfig.json +24 -0
  234. package/test/fixtures/types/no-relative-references/tsconfig.json +1 -0
  235. package/test/fixtures/types/no-relative-references/v1/tsconfig.json +1 -0
  236. package/test/fixtures/types/no-self-import/tsconfig.json +2 -1
  237. package/test/fixtures/types/no-single-declare-module/bad.d.ts +4 -0
  238. package/test/fixtures/types/no-single-declare-module/index.d.ts +2 -0
  239. package/test/fixtures/types/no-single-declare-module/index2.d.ts +2 -0
  240. package/test/fixtures/types/no-single-declare-module/index3.d.ts +1 -0
  241. package/test/fixtures/types/no-single-declare-module/no-single-declare-module-tests.ts +0 -0
  242. package/test/fixtures/types/no-single-declare-module/package.json +8 -0
  243. package/test/fixtures/types/no-single-declare-module/tsconfig.json +23 -0
  244. package/test/fixtures/types/no-single-element-tuple-type/bad.d.ts +1 -0
  245. package/test/fixtures/types/no-single-element-tuple-type/index.d.ts +5 -0
  246. package/test/fixtures/types/no-single-element-tuple-type/no-single-element-tuple-type-tests.ts +0 -0
  247. package/test/fixtures/types/no-single-element-tuple-type/package.json +8 -0
  248. package/test/fixtures/types/no-single-element-tuple-type/tsconfig.json +21 -0
  249. package/test/fixtures/types/no-unnecessary-generics/bad.d.ts +2 -0
  250. package/test/fixtures/types/no-unnecessary-generics/index.d.ts +7 -0
  251. package/test/fixtures/types/no-unnecessary-generics/no-unnecessary-generics-tests.ts +14 -0
  252. package/test/fixtures/types/no-unnecessary-generics/package.json +8 -0
  253. package/test/fixtures/types/no-unnecessary-generics/tsconfig.json +21 -0
  254. package/test/fixtures/types/no-useless-files/bad.d.ts +1 -0
  255. package/test/fixtures/types/no-useless-files/bad2.d.ts +0 -0
  256. package/test/fixtures/types/no-useless-files/bad3.d.ts +1 -0
  257. package/test/fixtures/types/no-useless-files/index.d.ts +1 -0
  258. package/test/fixtures/types/no-useless-files/index2.d.ts +1 -0
  259. package/test/fixtures/types/no-useless-files/index3.d.ts +1 -0
  260. package/test/fixtures/types/no-useless-files/no-useless-files-tests.ts +0 -0
  261. package/test/fixtures/types/no-useless-files/package.json +8 -0
  262. package/test/fixtures/types/no-useless-files/tsconfig.json +25 -0
  263. package/test/fixtures/types/other/tsconfig.json +1 -1
  264. package/test/fixtures/types/other/v1/tsconfig.json +1 -1
  265. package/test/fixtures/types/prefer-declare-function/bad.d.ts +9 -0
  266. package/test/fixtures/types/prefer-declare-function/index.d.ts +2 -0
  267. package/test/fixtures/types/prefer-declare-function/package.json +8 -0
  268. package/test/fixtures/types/prefer-declare-function/prefer-declare-function-tests.ts +0 -0
  269. package/test/fixtures/types/prefer-declare-function/tsconfig.json +21 -0
  270. package/test/fixtures/types/redundant-undefined/bad.d.ts +3 -0
  271. package/test/fixtures/types/redundant-undefined/index.d.ts +5 -0
  272. package/test/fixtures/types/redundant-undefined/package.json +8 -0
  273. package/test/fixtures/types/redundant-undefined/redundant-undefined-tests.ts +1 -0
  274. package/test/fixtures/types/redundant-undefined/tsconfig.json +21 -0
  275. package/test/fixtures/types/scoped__foo/tsconfig.json +1 -1
  276. package/test/fixtures/types/scoped__foo/v1/tsconfig.json +1 -1
  277. package/test/fixtures/types/scoped__no-declare-current-package/tsconfig.json +2 -1
  278. package/test/fixtures/types/scoped__no-relative-references/tsconfig.json +1 -0
  279. package/test/fixtures/types/scoped__no-relative-references/v1/tsconfig.json +1 -0
  280. package/test/fixtures/types/strict-export-declare-modifiers/bad1.d.ts +1 -0
  281. package/test/fixtures/types/strict-export-declare-modifiers/bad2.d.ts +3 -0
  282. package/test/fixtures/types/strict-export-declare-modifiers/bad3.d.ts +1 -0
  283. package/test/fixtures/types/strict-export-declare-modifiers/bad4.d.ts +3 -0
  284. package/test/fixtures/types/strict-export-declare-modifiers/bad5.d.ts +2 -0
  285. package/test/fixtures/types/strict-export-declare-modifiers/bad6.d.ts +2 -0
  286. package/test/fixtures/types/strict-export-declare-modifiers/bad7.d.ts +2 -0
  287. package/test/fixtures/types/strict-export-declare-modifiers/good1.ts +1 -0
  288. package/test/fixtures/types/strict-export-declare-modifiers/good2.d.ts +1 -0
  289. package/test/fixtures/types/strict-export-declare-modifiers/good3.d.ts +1 -0
  290. package/test/fixtures/types/strict-export-declare-modifiers/good4.d.ts +1 -0
  291. package/test/fixtures/types/strict-export-declare-modifiers/good5.d.ts +1 -0
  292. package/test/fixtures/types/strict-export-declare-modifiers/good6.ts +3 -0
  293. package/test/fixtures/types/strict-export-declare-modifiers/good7.d.ts +2 -0
  294. package/test/fixtures/types/strict-export-declare-modifiers/good8.d.ts +5 -0
  295. package/test/fixtures/types/strict-export-declare-modifiers/good9.d.ts +3 -0
  296. package/test/fixtures/types/strict-export-declare-modifiers/package.json +8 -0
  297. package/test/fixtures/types/strict-export-declare-modifiers/strict-export-declare-modifiers-tests.ts +0 -0
  298. package/test/fixtures/types/strict-export-declare-modifiers/tsconfig.json +35 -0
  299. package/test/util.test.ts +6 -1
  300. package/test/util.ts +3 -0
  301. package/tsconfig.tsbuildinfo +1 -1
  302. package/test/export-just-namespace.test.ts +0 -68
  303. package/test/fixtureTester.ts +0 -63
  304. package/test/no-any-union.test.ts +0 -20
  305. package/test/no-bad-reference.test.ts +0 -127
  306. package/test/no-const-enum.test.ts +0 -20
  307. package/test/no-dead-reference.test.ts +0 -64
  308. package/test/no-declare-current-package.test.ts +0 -59
  309. package/test/no-import-default-of-export-equals.test.ts +0 -49
  310. package/test/no-import-of-dev-dependencies.test.ts +0 -27
  311. package/test/no-old-dt-header.test.ts +0 -69
  312. package/test/no-relative-import-in-test.test.ts +0 -27
  313. package/test/no-self-import.test.ts +0 -30
  314. package/test/no-single-declare-module.test.ts +0 -49
  315. package/test/no-single-element-tuple-type.test.ts +0 -26
  316. package/test/no-unnecessary-generics.test.ts +0 -152
  317. package/test/no-useless-files.test.ts +0 -40
  318. package/test/prefer-declare-function.test.ts +0 -64
  319. package/test/redundant-undefined.test.ts +0 -37
  320. package/test/strict-export-declare-modifiers.test.ts +0 -156
  321. package/test/tsconfig.no-declare-current-package.json +0 -11
  322. package/test/tsconfig.no-declare-current-package2.json +0 -11
  323. package/test/tsconfig.no-import-default-of-export-equals.json +0 -11
  324. package/test/tsconfig.no-relative-import-in-test.json +0 -14
  325. package/test/tsconfig.no-self-import.json +0 -7
  326. package/test/tsconfig.no-single-declare-module.json +0 -7
  327. package/test/tsconfig.test.json +0 -10
  328. /package/test/{abc.d.ts → fixtures/types/no-relative-import-in-test/abc.d.ts} +0 -0
  329. /package/test/{no-relative-import-in-test → fixtures/types/no-relative-import-in-test/no-relative-import-in-test}/abc.d.ts +0 -0
@@ -1,26 +0,0 @@
1
- import { RuleTester } from "@typescript-eslint/rule-tester";
2
-
3
- import * as noDeclareCurrentPackage from "../src/rules/no-single-element-tuple-type";
4
-
5
- const ruleTester = new RuleTester();
6
-
7
- ruleTester.run("@definitelytyped/no-single-element-tuple-type", noDeclareCurrentPackage, {
8
- invalid: [
9
- {
10
- code: `type Test<T> = [T];`,
11
- errors: [
12
- {
13
- line: 1,
14
- messageId: "singleElementTupleType",
15
- },
16
- ],
17
- },
18
- ],
19
- valid: [
20
- `type Test = number[];`,
21
- `type Test<T> = T;`,
22
- `type Test<T> = T[];`,
23
- `type Test<T> = [T, number];`,
24
- `type Test<T> = [T, T];`,
25
- ],
26
- });
@@ -1,152 +0,0 @@
1
- import { RuleTester } from "@typescript-eslint/rule-tester";
2
-
3
- import * as rule from "../src/rules/no-unnecessary-generics";
4
-
5
- const ruleTester = new RuleTester({
6
- parserOptions: {
7
- ecmaVersion: 2018,
8
- tsconfigRootDir: __dirname,
9
- project: "./tsconfig.test.json",
10
- },
11
- parser: "@typescript-eslint/parser",
12
- });
13
-
14
- ruleTester.run("@definitelytyped/no-unnecessary-generics", rule, {
15
- invalid: [
16
- {
17
- code: `
18
- const f2 = <T>(): T => {};
19
- `,
20
- errors: [
21
- {
22
- line: 2,
23
- column: 13,
24
- messageId: "sole",
25
- },
26
- ],
27
- },
28
- {
29
- code: `
30
- class C {
31
- constructor<T>(x: T) {}
32
- }
33
- `,
34
- errors: [
35
- {
36
- line: 3,
37
- column: 15,
38
- messageId: "sole",
39
- },
40
- ],
41
- },
42
- {
43
- code: `
44
- function f<T>(): T { }
45
- `,
46
- errors: [
47
- {
48
- line: 2,
49
- column: 12,
50
- messageId: "sole",
51
- },
52
- ],
53
- },
54
- {
55
- code: `
56
- function f<T>(x: { T: number }): void;
57
- `,
58
- errors: [
59
- {
60
- line: 2,
61
- column: 12,
62
- messageId: "never",
63
- },
64
- ],
65
- },
66
- {
67
- code: `
68
- function f<T, U extends T>(u: U): U;
69
- `,
70
- errors: [
71
- {
72
- line: 2,
73
- column: 12,
74
- messageId: "sole",
75
- },
76
- ],
77
- },
78
- {
79
- code: `
80
- const f = function<T>(): T {};
81
- `,
82
- errors: [
83
- {
84
- line: 2,
85
- column: 20,
86
- messageId: "sole",
87
- },
88
- ],
89
- },
90
- {
91
- code: `
92
- interface I {
93
- <T>(value: T): void;
94
- }
95
- `,
96
- errors: [
97
- {
98
- line: 3,
99
- column: 4,
100
- messageId: "sole",
101
- },
102
- ],
103
- },
104
- {
105
- code: `
106
- interface I {
107
- m<T>(x: T): void;
108
- }
109
- `,
110
- errors: [
111
- {
112
- line: 3,
113
- column: 5,
114
- messageId: "sole",
115
- },
116
- ],
117
- },
118
- {
119
- code: `
120
- type Fn = <T>() => T;
121
- `,
122
- errors: [
123
- {
124
- line: 2,
125
- column: 12,
126
- messageId: "sole",
127
- },
128
- ],
129
- },
130
- {
131
- code: `
132
- type Ctr = new<T>() => T;
133
- `,
134
- errors: [
135
- {
136
- line: 2,
137
- column: 16,
138
- messageId: "sole",
139
- },
140
- ],
141
- },
142
- ],
143
- valid: [
144
- `function example(a: string): string;`,
145
- `function example<T>(a: T): T;`,
146
- `function example<T>(a: T[]): T;`,
147
- `function example<T>(a: Set<T>): T;`,
148
- `function example<T>(a: Set<T>, b: T[]): void;`,
149
- `function example<T>(a: Map<T, T>): void;`,
150
- `function example<T, U extends T>(t: T, u: U): U;`,
151
- ],
152
- });
@@ -1,40 +0,0 @@
1
- import { RuleTester } from "@typescript-eslint/rule-tester";
2
- import * as noUselessFiles from "../src/rules/no-useless-files";
3
-
4
- const ruleTester = new RuleTester();
5
-
6
- ruleTester.run("@definitelytyped/no-useless-files", noUselessFiles, {
7
- invalid: [
8
- {
9
- code: `// I am useless`,
10
- errors: [
11
- {
12
- column: 1,
13
- line: 1,
14
- messageId: "noContent",
15
- },
16
- ],
17
- },
18
- {
19
- code: ``,
20
- errors: [
21
- {
22
- column: 1,
23
- line: 1,
24
- messageId: "noContent",
25
- },
26
- ],
27
- },
28
- {
29
- code: `/// <reference lib="baz" />`,
30
- errors: [
31
- {
32
- column: 1,
33
- line: 1,
34
- messageId: "noContent",
35
- },
36
- ],
37
- },
38
- ],
39
- valid: [`export default "I am useful";`, `/// <reference path="foo" />`, `/// <reference types="bar" />`],
40
- });
@@ -1,64 +0,0 @@
1
- import { RuleTester } from "@typescript-eslint/rule-tester";
2
-
3
- import * as preferDeclareFunction from "../src/rules/prefer-declare-function";
4
-
5
- const ruleTester = new RuleTester();
6
-
7
- ruleTester.run("@definitelytyped/prefer-declare-function", preferDeclareFunction, {
8
- invalid: [
9
- {
10
- filename: "index.d.ts",
11
- code: `export const example: () => void;`,
12
- errors: [
13
- {
14
- column: 14,
15
- endColumn: 33,
16
- line: 1,
17
- messageId: "variableFunction",
18
- },
19
- ],
20
- },
21
- {
22
- filename: "index.d.ts",
23
- code: `
24
- namespace N {
25
- export const example: () => void;
26
- }
27
- `,
28
- errors: [
29
- {
30
- column: 26,
31
- endColumn: 45,
32
- line: 3,
33
- messageId: "variableFunction",
34
- },
35
- ],
36
- },
37
- {
38
- filename: "index.d.ts",
39
- code: `
40
- namespace N {
41
- const example: () => void;
42
- }
43
- `,
44
- errors: [
45
- {
46
- column: 19,
47
- endColumn: 38,
48
- line: 3,
49
- messageId: "variableFunction",
50
- },
51
- ],
52
- },
53
- ],
54
- valid: [
55
- {
56
- filename: "index.d.ts",
57
- code: `function example(): void`,
58
- },
59
- {
60
- filename: "test.ts",
61
- code: `export const example: () => void;`,
62
- },
63
- ],
64
- });
@@ -1,37 +0,0 @@
1
- import { RuleTester } from "@typescript-eslint/rule-tester";
2
-
3
- import * as redundantUndefined from "../src/rules/redundant-undefined";
4
-
5
- const ruleTester = new RuleTester();
6
-
7
- ruleTester.run("@definitelytyped/redundant-undefined", redundantUndefined, {
8
- invalid: [
9
- {
10
- code: `function f(s?: string | undefined): void {}`,
11
- errors: [
12
- {
13
- line: 1,
14
- messageId: "redundantUndefined",
15
- },
16
- ],
17
- },
18
- {
19
- code: `function f([a, b]?: [number, number] | undefined): void {}`,
20
- errors: [
21
- {
22
- line: 1,
23
- messageId: "redundantUndefined",
24
- },
25
- ],
26
- },
27
- ],
28
- valid: [
29
- `
30
- interface I {
31
- ok?: string | undefined;
32
- s?: string;
33
- almost?: number | string;
34
- }
35
- `,
36
- ],
37
- });
@@ -1,156 +0,0 @@
1
- import { RuleTester } from "@typescript-eslint/rule-tester";
2
-
3
- import * as strictExportDeclareModifiers from "../src/rules/strict-export-declare-modifiers";
4
-
5
- const ruleTester = new RuleTester();
6
-
7
- ruleTester.run("strict-export-declare-modifiers", strictExportDeclareModifiers, {
8
- invalid: [
9
- {
10
- code: `declare interface I {}`,
11
- errors: [
12
- {
13
- column: 1,
14
- endColumn: 8,
15
- line: 1,
16
- messageId: "redundantDeclare",
17
- },
18
- ],
19
- },
20
- {
21
- code: `
22
- declare namespace M {
23
- export const x: number;
24
- }
25
- `,
26
- errors: [
27
- {
28
- column: 5,
29
- endColumn: 11,
30
- line: 3,
31
- messageId: "redundantExport",
32
- },
33
- ],
34
- },
35
- {
36
- code: `export declare function f(): void;`,
37
- errors: [
38
- {
39
- line: 1,
40
- messageId: "redundantDeclare",
41
- },
42
- ],
43
- filename: "testModuleAutoExport.d.ts",
44
- },
45
- {
46
- code: `
47
- export namespace M {
48
- export function f(): void;
49
- }
50
- `,
51
- errors: [
52
- {
53
- column: 3,
54
- endColumn: 9,
55
- line: 3,
56
- messageId: "redundantExport",
57
- },
58
- ],
59
- filename: "testModuleAutoExport.d.ts",
60
- },
61
- {
62
- code: `
63
- interface I {}
64
- export namespace M {}
65
- `,
66
- errors: [
67
- {
68
- column: 11,
69
- endColumn: 12,
70
- line: 2,
71
- messageId: "missingExplicitExport",
72
- },
73
- ],
74
- filename: "testModuleAutoExport.d.ts",
75
- },
76
- {
77
- code: `
78
- declare function g(): void;
79
- export namespace M {}
80
- `,
81
- errors: [
82
- {
83
- column: 1,
84
- endColumn: 8,
85
- line: 2,
86
- messageId: "redundantDeclare",
87
- },
88
- {
89
- column: 18,
90
- endColumn: 19,
91
- line: 2,
92
- messageId: "missingExplicitExport",
93
- },
94
- ],
95
- filename: "testModuleAutoExport.d.ts",
96
- },
97
- {
98
- code: `
99
- declare namespace N {}
100
- export namespace M {}
101
- `,
102
- errors: [
103
- {
104
- column: 1,
105
- endColumn: 8,
106
- line: 2,
107
- messageId: "redundantDeclare",
108
- },
109
- {
110
- column: 19,
111
- endColumn: 20,
112
- line: 2,
113
- messageId: "missingExplicitExport",
114
- },
115
- ],
116
- filename: "testModuleAutoExport.d.ts",
117
- },
118
- ],
119
- valid: [
120
- `export declare class C {}`,
121
- `export function f() {}`,
122
- `declare function g(): void;`,
123
- `declare namespace N {};`,
124
- `interface J {}`,
125
- `
126
- namespace N {
127
- export const x: number;
128
- }
129
- `,
130
- {
131
- code: `
132
- declare class Foo {}
133
- export { Foo as Bar }
134
- `,
135
- filename: "./testValuesDeclareClass.d.ts",
136
- },
137
- {
138
- code: `
139
- import * as foo from "foo";
140
- import foo = require("foo");
141
- export { foo };
142
- export { foo } from "foo";
143
- export as namespace Foo;
144
- `,
145
- filename: "testModule.d.ts",
146
- },
147
- {
148
- code: `
149
- import * as foo from "foo";
150
- import foo = require("foo");
151
- export as namespace Foo;
152
- `,
153
- filename: "testModuleAutoExport.d.ts",
154
- },
155
- ],
156
- });
@@ -1,11 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "skipLibCheck": true,
4
- "strict": true,
5
- "target": "esnext"
6
- },
7
- "files": [
8
- "index.d.ts",
9
- "deep/import.d.ts"
10
- ]
11
- }
@@ -1,11 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "skipLibCheck": true,
4
- "strict": true,
5
- "target": "esnext"
6
- },
7
- "files": [
8
- "file.ts",
9
- "deep/import.d.ts"
10
- ]
11
- }
@@ -1,11 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "skipLibCheck": true,
4
- "strict": true,
5
- "target": "esnext"
6
- },
7
- "files": [
8
- "index.d.ts",
9
- "file.ts"
10
- ]
11
- }
@@ -1,14 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "strict": true,
4
- "target": "esnext"
5
- },
6
- "files": [
7
- "file.ts",
8
- "index.test.ts",
9
- "./abc.d.ts",
10
- "./no-relative-import-in-test/abc.d.ts",
11
- "./no-relative-import-in-test/index.d.ts",
12
- "./no-relative-import-in-test/index.test.ts"
13
- ]
14
- }
@@ -1,7 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "strict": true,
4
- "target": "esnext"
5
- },
6
- "files": ["this-package/index.d.ts"]
7
- }
@@ -1,7 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "strict": true,
4
- "target": "esnext"
5
- },
6
- "files": ["file.ts"]
7
- }
@@ -1,10 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "skipLibCheck": true,
4
- "strict": true,
5
- "target": "esnext"
6
- },
7
- "files": [
8
- "file.ts"
9
- ]
10
- }