@definitelytyped/eslint-plugin 0.0.191 → 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 +9 -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 +7 -4
  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
@@ -0,0 +1,35 @@
1
+ types/no-self-import/bad.d.ts
2
+ 1:1 error Declaration file should not use a global import of itself. Use a relative import @definitelytyped/no-self-import
3
+ 2:1 error Declaration file should not use a global import of itself. Use a relative import @definitelytyped/no-self-import
4
+ 4:1 error Don't import an old version of the current package @definitelytyped/no-self-import
5
+ 5:1 error Don't import an old version of the current package @definitelytyped/no-self-import
6
+ 6:1 error Don't import an old version of the current package @definitelytyped/no-self-import
7
+ 7:1 error Don't import an old version of the current package @definitelytyped/no-self-import
8
+ 8:1 error Don't import an old version of the current package @definitelytyped/no-self-import
9
+
10
+ ✖ 7 problems (7 errors, 0 warnings)
11
+
12
+ ==== types/no-self-import/bad.d.ts ====
13
+
14
+ import myself from "no-self-import";
15
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
16
+ !!! @definitelytyped/no-self-import: Declaration file should not use a global import of itself. Use a relative import.
17
+ import abc from "no-self-import/abc.d.ts"
18
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
19
+ !!! @definitelytyped/no-self-import: Declaration file should not use a global import of itself. Use a relative import.
20
+
21
+ import old1 from "./v11";
22
+ ~~~~~~~~~~~~~~~~~~~~~~~~~
23
+ !!! @definitelytyped/no-self-import: Don't import an old version of the current package.
24
+ import old2 from "./v11/index";
25
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
26
+ !!! @definitelytyped/no-self-import: Don't import an old version of the current package.
27
+ import old3 from "./v11/subdir/file";
28
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
29
+ !!! @definitelytyped/no-self-import: Don't import an old version of the current package.
30
+ import old4 from "./v0.1"
31
+ ~~~~~~~~~~~~~~~~~~~~~~~~~
32
+ !!! @definitelytyped/no-self-import: Don't import an old version of the current package.
33
+ import old5 from "./v0.1/index"
34
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
35
+ !!! @definitelytyped/no-self-import: Don't import an old version of the current package.
@@ -0,0 +1,11 @@
1
+ No errors
2
+
3
+ ==== types/no-self-import/index.d.ts ====
4
+
5
+ import other from "other-package";
6
+
7
+ import other from "other-package/this-package";
8
+
9
+ import old from "./v1gardenpath"
10
+
11
+ import old from "./v1verb/other"
@@ -0,0 +1,24 @@
1
+ types/no-self-import/no-self-import-tests.ts
2
+ 1:1 error Do not use a triple slash reference for devdep, use `import` style instead @typescript-eslint/triple-slash-reference
3
+ 2:1 error Do not use a triple slash reference for otherdevdep, use `import` style instead @typescript-eslint/triple-slash-reference
4
+ 3:1 error Do not use a triple slash reference for other, use `import` style instead @typescript-eslint/triple-slash-reference
5
+
6
+ ✖ 3 problems (3 errors, 0 warnings)
7
+
8
+ ==== types/no-self-import/no-self-import-tests.ts ====
9
+
10
+ /// <reference types="devdep"/>
11
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
12
+ !!! @typescript-eslint/triple-slash-reference: Do not use a triple slash reference for devdep, use `import` style instead.
13
+ /// <reference types="otherdevdep"/>
14
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
15
+ !!! @typescript-eslint/triple-slash-reference: Do not use a triple slash reference for otherdevdep, use `import` style instead.
16
+ /// <reference types="other"/>
17
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
18
+ !!! @typescript-eslint/triple-slash-reference: Do not use a triple slash reference for other, use `import` style instead.
19
+
20
+ import other from "other";
21
+ import self from "no-import-of-dev-dependencies";
22
+
23
+ import devdep from "devdep";
24
+ import * as otherdevdep from "otherdevdep";
@@ -0,0 +1,13 @@
1
+ types/no-single-declare-module/bad.d.ts
2
+ 1:16 error File has only 1 ambient module declaration. Move the contents outside the ambient module block, rename the file to match the ambient module name, and remove the block @definitelytyped/no-single-declare-module
3
+
4
+ ✖ 1 problem (1 error, 0 warnings)
5
+
6
+ ==== types/no-single-declare-module/bad.d.ts ====
7
+
8
+ declare module "foo" {}
9
+ ~~~~~
10
+ !!! @definitelytyped/no-single-declare-module: File has only 1 ambient module declaration. Move the contents outside the ambient module block, rename the file to match the ambient module name, and remove the block.
11
+
12
+ // Other global declarations don't affect this. They should go in "declare global".
13
+ interface I { i: any }
@@ -0,0 +1,6 @@
1
+ No errors
2
+
3
+ ==== types/no-single-declare-module/index.d.ts ====
4
+
5
+ import x from "x";
6
+ declare module "foo" {}
@@ -0,0 +1,6 @@
1
+ No errors
2
+
3
+ ==== types/no-single-declare-module/index2.d.ts ====
4
+
5
+ declare module "foo" {}
6
+ declare module "bar" {}
@@ -0,0 +1,5 @@
1
+ No errors
2
+
3
+ ==== types/no-single-declare-module/index3.d.ts ====
4
+
5
+ declare module "*.svg" {}
@@ -0,0 +1,10 @@
1
+ types/no-single-declare-module/no-single-declare-module-tests.ts
2
+ 1:1 error File has no content @definitelytyped/no-useless-files
3
+
4
+ ✖ 1 problem (1 error, 0 warnings)
5
+
6
+ ==== types/no-single-declare-module/no-single-declare-module-tests.ts ====
7
+
8
+
9
+ ~
10
+ !!! @definitelytyped/no-useless-files: File has no content.
@@ -0,0 +1,10 @@
1
+ types/no-single-element-tuple-type/bad.d.ts
2
+ 1:16 error Type [T] is a single-element tuple type. You probably meant T[] @definitelytyped/no-single-element-tuple-type
3
+
4
+ ✖ 1 problem (1 error, 0 warnings)
5
+
6
+ ==== types/no-single-element-tuple-type/bad.d.ts ====
7
+
8
+ type Test<T> = [T];
9
+ ~~~
10
+ !!! @definitelytyped/no-single-element-tuple-type: Type [T] is a single-element tuple type. You probably meant T[].
@@ -0,0 +1,9 @@
1
+ No errors
2
+
3
+ ==== types/no-single-element-tuple-type/index.d.ts ====
4
+
5
+ type Test = number[];
6
+ type Test2<T> = T;
7
+ type Test3<T> = T[];
8
+ type Test4<T> = [T, number];
9
+ type Test5<T> = [T, T];
@@ -0,0 +1,10 @@
1
+ types/no-single-element-tuple-type/no-single-element-tuple-type-tests.ts
2
+ 1:1 error File has no content @definitelytyped/no-useless-files
3
+
4
+ ✖ 1 problem (1 error, 0 warnings)
5
+
6
+ ==== types/no-single-element-tuple-type/no-single-element-tuple-type-tests.ts ====
7
+
8
+
9
+ ~
10
+ !!! @definitelytyped/no-useless-files: File has no content.
@@ -0,0 +1,14 @@
1
+ types/no-unnecessary-generics/bad.d.ts
2
+ 1:12 error Type parameter T is used only once @definitelytyped/no-unnecessary-generics
3
+ 2:16 error Type parameter T is used only once @definitelytyped/no-unnecessary-generics
4
+
5
+ ✖ 2 problems (2 errors, 0 warnings)
6
+
7
+ ==== types/no-unnecessary-generics/bad.d.ts ====
8
+
9
+ type Fn = <T>() => T;
10
+ ~
11
+ !!! @definitelytyped/no-unnecessary-generics: Type parameter T is used only once.
12
+ type Ctr = new<T>() => T;
13
+ ~
14
+ !!! @definitelytyped/no-unnecessary-generics: Type parameter T is used only once.
@@ -0,0 +1,11 @@
1
+ No errors
2
+
3
+ ==== types/no-unnecessary-generics/index.d.ts ====
4
+
5
+ declare function example1(a: string): string;
6
+ declare function example2<T>(a: T): T;
7
+ declare function example3<T>(a: T[]): T;
8
+ declare function example4<T>(a: Set<T>): T;
9
+ declare function example5<T>(a: Set<T>, b: T[]): void;
10
+ declare function example6<T>(a: Map<T, T>): void;
11
+ declare function example7<T, U extends T>(t: T, u: U): U;
@@ -0,0 +1,44 @@
1
+ types/no-unnecessary-generics/no-unnecessary-generics-tests.ts
2
+ 1:13 error Type parameter T is used only once @definitelytyped/no-unnecessary-generics
3
+ 3:17 error Type parameter T is used only once @definitelytyped/no-unnecessary-generics
4
+ 5:13 error Type parameter T is used only once @definitelytyped/no-unnecessary-generics
5
+ 6:13 error Type parameter T is never used @definitelytyped/no-unnecessary-generics
6
+ 7:13 error Type parameter T is used only once @definitelytyped/no-unnecessary-generics
7
+ 8:21 error Type parameter T is used only once @definitelytyped/no-unnecessary-generics
8
+ 10:6 error Type parameter T is used only once @definitelytyped/no-unnecessary-generics
9
+ 13:7 error Type parameter T is used only once @definitelytyped/no-unnecessary-generics
10
+
11
+ ✖ 8 problems (8 errors, 0 warnings)
12
+
13
+ ==== types/no-unnecessary-generics/no-unnecessary-generics-tests.ts ====
14
+
15
+ const f1 = <T>(): T => {};
16
+ ~
17
+ !!! @definitelytyped/no-unnecessary-generics: Type parameter T is used only once.
18
+ class C {
19
+ constructor<T>(x: T) {}
20
+ ~
21
+ !!! @definitelytyped/no-unnecessary-generics: Type parameter T is used only once.
22
+ }
23
+ function f2<T>(): T { }
24
+ ~
25
+ !!! @definitelytyped/no-unnecessary-generics: Type parameter T is used only once.
26
+ function f3<T>(x: { T: number }): void;
27
+ ~
28
+ !!! @definitelytyped/no-unnecessary-generics: Type parameter T is never used.
29
+ function f4<T, U extends T>(u: U): U;
30
+ ~
31
+ !!! @definitelytyped/no-unnecessary-generics: Type parameter T is used only once.
32
+ const f5 = function<T>(): T {};
33
+ ~
34
+ !!! @definitelytyped/no-unnecessary-generics: Type parameter T is used only once.
35
+ interface I {
36
+ <T>(value: T): void;
37
+ ~
38
+ !!! @definitelytyped/no-unnecessary-generics: Type parameter T is used only once.
39
+ }
40
+ interface I {
41
+ m<T>(x: T): void;
42
+ ~
43
+ !!! @definitelytyped/no-unnecessary-generics: Type parameter T is used only once.
44
+ }
@@ -0,0 +1,10 @@
1
+ types/no-useless-files/bad.d.ts
2
+ 1:1 error File has no content @definitelytyped/no-useless-files
3
+
4
+ ✖ 1 problem (1 error, 0 warnings)
5
+
6
+ ==== types/no-useless-files/bad.d.ts ====
7
+
8
+ // I am useless
9
+ ~
10
+ !!! @definitelytyped/no-useless-files: File has no content.
@@ -0,0 +1,10 @@
1
+ types/no-useless-files/bad2.d.ts
2
+ 1:1 error File has no content @definitelytyped/no-useless-files
3
+
4
+ ✖ 1 problem (1 error, 0 warnings)
5
+
6
+ ==== types/no-useless-files/bad2.d.ts ====
7
+
8
+
9
+ ~
10
+ !!! @definitelytyped/no-useless-files: File has no content.
@@ -0,0 +1,10 @@
1
+ types/no-useless-files/bad3.d.ts
2
+ 1:1 error File has no content @definitelytyped/no-useless-files
3
+
4
+ ✖ 1 problem (1 error, 0 warnings)
5
+
6
+ ==== types/no-useless-files/bad3.d.ts ====
7
+
8
+ /// <reference lib="baz" />
9
+ ~
10
+ !!! @definitelytyped/no-useless-files: File has no content.
@@ -0,0 +1,5 @@
1
+ No errors
2
+
3
+ ==== types/no-useless-files/index.d.ts ====
4
+
5
+ export default "I am useful";
@@ -0,0 +1,5 @@
1
+ No errors
2
+
3
+ ==== types/no-useless-files/index2.d.ts ====
4
+
5
+ /// <reference path="foo" />
@@ -0,0 +1,5 @@
1
+ No errors
2
+
3
+ ==== types/no-useless-files/index3.d.ts ====
4
+
5
+ /// <reference types="bar" />
@@ -0,0 +1,10 @@
1
+ types/no-useless-files/no-useless-files-tests.ts
2
+ 1:1 error File has no content @definitelytyped/no-useless-files
3
+
4
+ ✖ 1 problem (1 error, 0 warnings)
5
+
6
+ ==== types/no-useless-files/no-useless-files-tests.ts ====
7
+
8
+
9
+ ~
10
+ !!! @definitelytyped/no-useless-files: File has no content.
@@ -0,0 +1,5 @@
1
+ No errors
2
+
3
+ ==== types/other/index.d.ts ====
4
+
5
+ export const foo = 1234;
@@ -0,0 +1,10 @@
1
+ types/other/other-tests.ts
2
+ 1:1 error File has no content @definitelytyped/no-useless-files
3
+
4
+ ✖ 1 problem (1 error, 0 warnings)
5
+
6
+ ==== types/other/other-tests.ts ====
7
+
8
+
9
+ ~
10
+ !!! @definitelytyped/no-useless-files: File has no content.
@@ -0,0 +1,5 @@
1
+ No errors
2
+
3
+ ==== types/other/v1/index.d.ts ====
4
+
5
+ export const foo = 1234;
@@ -0,0 +1,10 @@
1
+ types/other/v1/other-tests.ts
2
+ 1:1 error File has no content @definitelytyped/no-useless-files
3
+
4
+ ✖ 1 problem (1 error, 0 warnings)
5
+
6
+ ==== types/other/v1/other-tests.ts ====
7
+
8
+
9
+ ~
10
+ !!! @definitelytyped/no-useless-files: File has no content.
@@ -0,0 +1,33 @@
1
+ types/prefer-declare-function/bad.d.ts
2
+ 1:14 error Use a function declaration instead of a variable of function type @definitelytyped/prefer-declare-function
3
+ 3:11 error All declarations in this module are exported automatically. Prefer to explicitly write 'export' for clarity. If you have a good reason not to export this declaration, add 'export {}' to the module to shut off automatic exporting @definitelytyped/strict-export-declare-modifiers
4
+ 4:5 error 'export' keyword is redundant here because all declarations in this module are exported automatically. If you have a good reason to export some declarations and not others, add 'export {}' to the module to shut off automatic exporting @definitelytyped/strict-export-declare-modifiers
5
+ 4:18 error Use a function declaration instead of a variable of function type @definitelytyped/prefer-declare-function
6
+ 7:11 error All declarations in this module are exported automatically. Prefer to explicitly write 'export' for clarity. If you have a good reason not to export this declaration, add 'export {}' to the module to shut off automatic exporting @definitelytyped/strict-export-declare-modifiers
7
+ 8:11 error Use a function declaration instead of a variable of function type @definitelytyped/prefer-declare-function
8
+
9
+ ✖ 6 problems (6 errors, 0 warnings)
10
+
11
+ ==== types/prefer-declare-function/bad.d.ts ====
12
+
13
+ export const example: () => void;
14
+ ~~~~~~~~~~~~~~~~~~~
15
+ !!! @definitelytyped/prefer-declare-function: Use a function declaration instead of a variable of function type.
16
+
17
+ namespace N {
18
+ ~
19
+ !!! @definitelytyped/strict-export-declare-modifiers: All declarations in this module are exported automatically. Prefer to explicitly write 'export' for clarity. If you have a good reason not to export this declaration, add 'export {}' to the module to shut off automatic exporting.
20
+ export const example: () => void;
21
+ ~~~~~~
22
+ !!! @definitelytyped/strict-export-declare-modifiers: 'export' keyword is redundant here because all declarations in this module are exported automatically. If you have a good reason to export some declarations and not others, add 'export {}' to the module to shut off automatic exporting.
23
+ ~~~~~~~~~~~~~~~~~~~
24
+ !!! @definitelytyped/prefer-declare-function: Use a function declaration instead of a variable of function type.
25
+ }
26
+
27
+ namespace N2 {
28
+ ~~
29
+ !!! @definitelytyped/strict-export-declare-modifiers: All declarations in this module are exported automatically. Prefer to explicitly write 'export' for clarity. If you have a good reason not to export this declaration, add 'export {}' to the module to shut off automatic exporting.
30
+ const example: () => void;
31
+ ~~~~~~~~~~~~~~~~~~~
32
+ !!! @definitelytyped/prefer-declare-function: Use a function declaration instead of a variable of function type.
33
+ }
@@ -0,0 +1,14 @@
1
+ types/prefer-declare-function/index.d.ts
2
+ 1:10 error All declarations in this module are exported automatically. Prefer to explicitly write 'export' for clarity. If you have a good reason not to export this declaration, add 'export {}' to the module to shut off automatic exporting @definitelytyped/strict-export-declare-modifiers
3
+ 2:14 error Use a function declaration instead of a variable of function type @definitelytyped/prefer-declare-function
4
+
5
+ ✖ 2 problems (2 errors, 0 warnings)
6
+
7
+ ==== types/prefer-declare-function/index.d.ts ====
8
+
9
+ function example(): void
10
+ ~~~~~~~
11
+ !!! @definitelytyped/strict-export-declare-modifiers: All declarations in this module are exported automatically. Prefer to explicitly write 'export' for clarity. If you have a good reason not to export this declaration, add 'export {}' to the module to shut off automatic exporting.
12
+ export const example2: () => void;
13
+ ~~~~~~~~~~~~~~~~~~~~
14
+ !!! @definitelytyped/prefer-declare-function: Use a function declaration instead of a variable of function type.
@@ -0,0 +1,10 @@
1
+ types/prefer-declare-function/prefer-declare-function-tests.ts
2
+ 1:1 error File has no content @definitelytyped/no-useless-files
3
+
4
+ ✖ 1 problem (1 error, 0 warnings)
5
+
6
+ ==== types/prefer-declare-function/prefer-declare-function-tests.ts ====
7
+
8
+
9
+ ~
10
+ !!! @definitelytyped/no-useless-files: File has no content.
@@ -0,0 +1,15 @@
1
+ types/redundant-undefined/bad.d.ts
2
+ 1:23 error Parameter is optional, so no need to include `undefined` in the type @definitelytyped/redundant-undefined
3
+ 3:29 error Parameter is optional, so no need to include `undefined` in the type @definitelytyped/redundant-undefined
4
+
5
+ ✖ 2 problems (2 errors, 0 warnings)
6
+
7
+ ==== types/redundant-undefined/bad.d.ts ====
8
+
9
+ export function f(s?: string | undefined): void;
10
+ ~~~~~~~~~~~~~~~~~~
11
+ !!! @definitelytyped/redundant-undefined: Parameter is optional, so no need to include `undefined` in the type.
12
+
13
+ export function f2([a, b]?: [number, number] | undefined): void;
14
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
15
+ !!! @definitelytyped/redundant-undefined: Parameter is optional, so no need to include `undefined` in the type.
@@ -0,0 +1,9 @@
1
+ No errors
2
+
3
+ ==== types/redundant-undefined/index.d.ts ====
4
+
5
+ interface I {
6
+ ok?: string | undefined;
7
+ s?: string;
8
+ almost?: number | string;
9
+ }
@@ -0,0 +1,10 @@
1
+ types/redundant-undefined/redundant-undefined-tests.ts
2
+ 1:17 error Including `any` in a union will override all other members of the union @definitelytyped/no-any-union
3
+
4
+ ✖ 1 problem (1 error, 0 warnings)
5
+
6
+ ==== types/redundant-undefined/redundant-undefined-tests.ts ====
7
+
8
+ export const z: string | any;
9
+ ~~~~~~~~~~~~
10
+ !!! @definitelytyped/no-any-union: Including `any` in a union will override all other members of the union.
@@ -0,0 +1,5 @@
1
+ No errors
2
+
3
+ ==== types/scoped__foo/index.d.ts ====
4
+
5
+ export const foo = 1234;
@@ -0,0 +1,10 @@
1
+ types/scoped__foo/scoped__foo-tests.ts
2
+ 1:1 error File has no content @definitelytyped/no-useless-files
3
+
4
+ ✖ 1 problem (1 error, 0 warnings)
5
+
6
+ ==== types/scoped__foo/scoped__foo-tests.ts ====
7
+
8
+
9
+ ~
10
+ !!! @definitelytyped/no-useless-files: File has no content.
@@ -0,0 +1,5 @@
1
+ No errors
2
+
3
+ ==== types/scoped__foo/v1/index.d.ts ====
4
+
5
+ export const foo = 1234;
@@ -0,0 +1,10 @@
1
+ types/scoped__foo/v1/scoped__foo-tests.ts
2
+ 1:1 error File has no content @definitelytyped/no-useless-files
3
+
4
+ ✖ 1 problem (1 error, 0 warnings)
5
+
6
+ ==== types/scoped__foo/v1/scoped__foo-tests.ts ====
7
+
8
+
9
+ ~
10
+ !!! @definitelytyped/no-useless-files: File has no content.
@@ -0,0 +1,13 @@
1
+ types/scoped__no-declare-current-package/index.d.ts
2
+ 1:16 error File has only 1 ambient module declaration. Move the contents outside the ambient module block, rename the file to match the ambient module name, and remove the block @definitelytyped/no-single-declare-module
3
+ 1:16 error Instead of declaring a module with `declare module "@scoped/no-declare-current-package"`, write its contents in directly in "index.d.ts" @definitelytyped/no-declare-current-package
4
+
5
+ ✖ 2 problems (2 errors, 0 warnings)
6
+
7
+ ==== types/scoped__no-declare-current-package/index.d.ts ====
8
+
9
+ declare module "@scoped/no-declare-current-package" { }
10
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
11
+ !!! @definitelytyped/no-single-declare-module: File has only 1 ambient module declaration. Move the contents outside the ambient module block, rename the file to match the ambient module name, and remove the block.
12
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
13
+ !!! @definitelytyped/no-declare-current-package: Instead of declaring a module with `declare module "@scoped/no-declare-current-package"`, write its contents in directly in "index.d.ts".
@@ -0,0 +1,10 @@
1
+ types/scoped__no-declare-current-package/no-declare-current-package-tests.ts
2
+ 1:1 error File has no content @definitelytyped/no-useless-files
3
+
4
+ ✖ 1 problem (1 error, 0 warnings)
5
+
6
+ ==== types/scoped__no-declare-current-package/no-declare-current-package-tests.ts ====
7
+
8
+
9
+ ~
10
+ !!! @definitelytyped/no-useless-files: File has no content.
@@ -0,0 +1,13 @@
1
+ types/scoped__no-declare-current-package/test/deep/import.d.ts
2
+ 1:16 error File has only 1 ambient module declaration. Move the contents outside the ambient module block, rename the file to match the ambient module name, and remove the block @definitelytyped/no-single-declare-module
3
+ 1:16 error Instead of declaring a module with `declare module "@scoped/no-declare-current-package/deep/import"`, write its contents in directly in "@scoped/no-declare-current-package/deep/import.d.ts" or "@scoped/no-declare-current-package/deep/import/index.d.ts" @definitelytyped/no-declare-current-package
4
+
5
+ ✖ 2 problems (2 errors, 0 warnings)
6
+
7
+ ==== types/scoped__no-declare-current-package/test/deep/import.d.ts ====
8
+
9
+ declare module "@scoped/no-declare-current-package/deep/import" { }
10
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
11
+ !!! @definitelytyped/no-single-declare-module: File has only 1 ambient module declaration. Move the contents outside the ambient module block, rename the file to match the ambient module name, and remove the block.
12
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
13
+ !!! @definitelytyped/no-declare-current-package: Instead of declaring a module with `declare module "@scoped/no-declare-current-package/deep/import"`, write its contents in directly in "@scoped/no-declare-current-package/deep/import.d.ts" or "@scoped/no-declare-current-package/deep/import/index.d.ts".
@@ -0,0 +1,45 @@
1
+ types/scoped__no-relative-references/index.d.ts
2
+ 1:22 error The reference "../foo/index.d.ts" resolves outside of the package. Use a global reference to reference other packages @definitelytyped/no-bad-reference
3
+ 2:22 error The reference "./v1/index.d.ts" resolves outside of the package. Use a global reference to reference other packages @definitelytyped/no-bad-reference
4
+ 3:22 error The reference "../foo/v1/index.d.ts" resolves outside of the package. Use a global reference to reference other packages @definitelytyped/no-bad-reference
5
+ 5:22 error The import "../foo" resolves outside of the package. Use a bare import to reference other packages @definitelytyped/no-bad-reference
6
+ 6:1 error Don't import an old version of the current package @definitelytyped/no-self-import
7
+ 6:23 error The import "./v1" resolves outside of the package. Use a bare import to reference other packages @definitelytyped/no-bad-reference
8
+ 7:23 error The import "../foo/v1" resolves outside of the package. Use a bare import to reference other packages @definitelytyped/no-bad-reference
9
+ 9:16 error Instead of declaring a module with `declare module "@scoped/no-relative-references"`, write its contents in directly in "index.d.ts" @definitelytyped/no-declare-current-package
10
+ 11:22 error The import "@scoped/no-relative-references/v1" resolves outside of the package. Use a bare import to reference other packages @definitelytyped/no-bad-reference
11
+
12
+ ✖ 9 problems (9 errors, 0 warnings)
13
+
14
+ ==== types/scoped__no-relative-references/index.d.ts ====
15
+
16
+ /// <reference path="../foo/index.d.ts" />
17
+ ~~~~~~~~~~~~~~~~~
18
+ !!! @definitelytyped/no-bad-reference: The reference "../foo/index.d.ts" resolves outside of the package. Use a global reference to reference other packages.
19
+ /// <reference path="./v1/index.d.ts" />
20
+ ~~~~~~~~~~~~~~~
21
+ !!! @definitelytyped/no-bad-reference: The reference "./v1/index.d.ts" resolves outside of the package. Use a global reference to reference other packages.
22
+ /// <reference path="../foo/v1/index.d.ts" />
23
+ ~~~~~~~~~~~~~~~~~~~~
24
+ !!! @definitelytyped/no-bad-reference: The reference "../foo/v1/index.d.ts" resolves outside of the package. Use a global reference to reference other packages.
25
+
26
+ import * as foo from "../foo";
27
+ ~~~~~~~~
28
+ !!! @definitelytyped/no-bad-reference: The import "../foo" resolves outside of the package. Use a bare import to reference other packages.
29
+ import * as foo2 from "./v1";
30
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
31
+ !!! @definitelytyped/no-self-import: Don't import an old version of the current package.
32
+ ~~~~~~
33
+ !!! @definitelytyped/no-bad-reference: The import "./v1" resolves outside of the package. Use a bare import to reference other packages.
34
+ import * as foo3 from "../foo/v1";
35
+ ~~~~~~~~~~~
36
+ !!! @definitelytyped/no-bad-reference: The import "../foo/v1" resolves outside of the package. Use a bare import to reference other packages.
37
+
38
+ declare module "@scoped/no-relative-references" {
39
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
40
+ !!! @definitelytyped/no-declare-current-package: Instead of declaring a module with `declare module "@scoped/no-relative-references"`, write its contents in directly in "index.d.ts".
41
+ import A = require("@scoped/no-relative-references/blah"); // Okay; relative
42
+ import B = require("@scoped/no-relative-references/v1"); // Bad; versioned subdir
43
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
44
+ !!! @definitelytyped/no-bad-reference: The import "@scoped/no-relative-references/v1" resolves outside of the package. Use a bare import to reference other packages.
45
+ }
@@ -0,0 +1,10 @@
1
+ types/scoped__no-relative-references/no-relative-references-tests.ts
2
+ 1:1 error File has no content @definitelytyped/no-useless-files
3
+
4
+ ✖ 1 problem (1 error, 0 warnings)
5
+
6
+ ==== types/scoped__no-relative-references/no-relative-references-tests.ts ====
7
+
8
+
9
+ ~
10
+ !!! @definitelytyped/no-useless-files: File has no content.
@@ -0,0 +1,31 @@
1
+ types/scoped__no-relative-references/other/other.d.ts
2
+ 1:22 error The reference "../../foo/index.d.ts" resolves outside of the package. Use a global reference to reference other packages @definitelytyped/no-bad-reference
3
+ 2:22 error The reference "../v1/index.d.ts" resolves outside of the package. Use a global reference to reference other packages @definitelytyped/no-bad-reference
4
+ 3:22 error The reference "../../foo/v1/index.d.ts" resolves outside of the package. Use a global reference to reference other packages @definitelytyped/no-bad-reference
5
+ 5:22 error The import "../../foo" resolves outside of the package. Use a bare import to reference other packages @definitelytyped/no-bad-reference
6
+ 6:23 error The import "../v1" resolves outside of the package. Use a bare import to reference other packages @definitelytyped/no-bad-reference
7
+ 7:23 error The import "../../foo/v1" resolves outside of the package. Use a bare import to reference other packages @definitelytyped/no-bad-reference
8
+
9
+ ✖ 6 problems (6 errors, 0 warnings)
10
+
11
+ ==== types/scoped__no-relative-references/other/other.d.ts ====
12
+
13
+ /// <reference path="../../foo/index.d.ts" />
14
+ ~~~~~~~~~~~~~~~~~~~~
15
+ !!! @definitelytyped/no-bad-reference: The reference "../../foo/index.d.ts" resolves outside of the package. Use a global reference to reference other packages.
16
+ /// <reference path="../v1/index.d.ts" />
17
+ ~~~~~~~~~~~~~~~~
18
+ !!! @definitelytyped/no-bad-reference: The reference "../v1/index.d.ts" resolves outside of the package. Use a global reference to reference other packages.
19
+ /// <reference path="../../foo/v1/index.d.ts" />
20
+ ~~~~~~~~~~~~~~~~~~~~~~~
21
+ !!! @definitelytyped/no-bad-reference: The reference "../../foo/v1/index.d.ts" resolves outside of the package. Use a global reference to reference other packages.
22
+
23
+ import * as foo from "../../foo";
24
+ ~~~~~~~~~~~
25
+ !!! @definitelytyped/no-bad-reference: The import "../../foo" resolves outside of the package. Use a bare import to reference other packages.
26
+ import * as foo2 from "../v1";
27
+ ~~~~~~~
28
+ !!! @definitelytyped/no-bad-reference: The import "../v1" resolves outside of the package. Use a bare import to reference other packages.
29
+ import * as foo3 from "../../foo/v1";
30
+ ~~~~~~~~~~~~~~
31
+ !!! @definitelytyped/no-bad-reference: The import "../../foo/v1" resolves outside of the package. Use a bare import to reference other packages.