@nr1e/commons 0.1.1 → 0.1.2

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 (440) hide show
  1. package/package.json +1 -1
  2. package/.editorconfig +0 -19
  3. package/.eslintignore +0 -3
  4. package/.eslintrc.json +0 -4
  5. package/.git/COMMIT_EDITMSG +0 -5
  6. package/.git/FETCH_HEAD +0 -1
  7. package/.git/HEAD +0 -1
  8. package/.git/config +0 -18
  9. package/.git/config.worktree +0 -5
  10. package/.git/description +0 -1
  11. package/.git/hooks/applypatch-msg.sample +0 -15
  12. package/.git/hooks/commit-msg.sample +0 -24
  13. package/.git/hooks/fsmonitor-watchman.sample +0 -174
  14. package/.git/hooks/post-update.sample +0 -8
  15. package/.git/hooks/pre-applypatch.sample +0 -14
  16. package/.git/hooks/pre-commit.sample +0 -49
  17. package/.git/hooks/pre-merge-commit.sample +0 -13
  18. package/.git/hooks/pre-push.sample +0 -53
  19. package/.git/hooks/pre-rebase.sample +0 -169
  20. package/.git/hooks/pre-receive.sample +0 -24
  21. package/.git/hooks/prepare-commit-msg.sample +0 -42
  22. package/.git/hooks/push-to-checkout.sample +0 -78
  23. package/.git/hooks/sendemail-validate.sample +0 -77
  24. package/.git/hooks/update.sample +0 -128
  25. package/.git/index +0 -0
  26. package/.git/info/exclude +0 -6
  27. package/.git/logs/HEAD +0 -2
  28. package/.git/logs/refs/heads/main +0 -2
  29. package/.git/logs/refs/remotes/origin/main +0 -2
  30. package/.git/objects/07/c0af7cd711cab6a55ad3dc349ac8c70775623c +0 -0
  31. package/.git/objects/0d/698432e2c44311c17b845cc63093a898972b95 +0 -0
  32. package/.git/objects/10/ba4a7d64968326293182d571a9c73f5e041fb6 +0 -3
  33. package/.git/objects/12/069a5aa45479564e00749f730582627a276a55 +0 -3
  34. package/.git/objects/14/5ab9cf82c40696a07ab42f117ba199acb2a50b +0 -4
  35. package/.git/objects/17/7b0dc4bf884f8ae0403b4aad053e76baafd632 +0 -2
  36. package/.git/objects/1d/a517ce3527df45a4f28e52ff2c0d9d1c8179f6 +0 -0
  37. package/.git/objects/27/50076ed23b5211a52ef834f40f183ddecb917a +0 -0
  38. package/.git/objects/2a/96e4bb57fa4bd69c719dca224b17b569e94e82 +0 -2
  39. package/.git/objects/2b/38c26b4ec43b8f5574acb164d2ba64bca8e230 +0 -0
  40. package/.git/objects/2c/61d463bee185f04e7c2bd1d2a15ad1117c589e +0 -0
  41. package/.git/objects/2d/22dbc836cfd75c8d7640ebe5a4fe90bd2c23c6 +0 -0
  42. package/.git/objects/2e/58414df7b4d5c972167a83270f78fc4ed508f5 +0 -0
  43. package/.git/objects/38/0be191ee415827a1217f46626fea4fefba48e5 +0 -0
  44. package/.git/objects/3a/93aa29cd19bdc95a87d15910baec8455f8b7b7 +0 -0
  45. package/.git/objects/50/150b739272269be2ede552448013eba65323da +0 -0
  46. package/.git/objects/53/2b7b796ffd3223f913a5a5e1e17743ee3591fe +0 -0
  47. package/.git/objects/54/a8535f50287f6a7a8c00aed143ca6e5ee5f5d1 +0 -0
  48. package/.git/objects/5d/4aa0709f62f1bc1fa80251208b570cb3b89d9c +0 -0
  49. package/.git/objects/63/1c43e00d4c34ba914c510f4fe2e6df15b8b06e +0 -0
  50. package/.git/objects/63/9900d13c6182e452e33a3bd638e70a0146c785 +0 -2
  51. package/.git/objects/64/3fa02661c3a1b54205729a75d2fb5f013833af +0 -0
  52. package/.git/objects/6c/59086d862516d2fffa5da2035e5003100fb5c7 +0 -0
  53. package/.git/objects/6c/b74f90a0c799eea1c54a04d8d6a8a9e9691cca +0 -2
  54. package/.git/objects/70/0e093acb1c1e55d523507411b7940a01a3bb65 +0 -0
  55. package/.git/objects/71/1ba2014bc137dece4c4156ff5e77e6abaeb95c +0 -0
  56. package/.git/objects/74/c82ffe8eb71efecbccfdf67b590949c944dd1a +0 -0
  57. package/.git/objects/76/1413a07839108abb46ef0e4490bd1c1444b4fc +0 -0
  58. package/.git/objects/77/96f8282f2c553ecdde72bc976478eb3a8a948e +0 -0
  59. package/.git/objects/79/ee123c2b23e069e35ed634d687e17f731cc702 +0 -0
  60. package/.git/objects/7d/80af9735f0527db35ecc79ae3c887e445cb3e0 +0 -0
  61. package/.git/objects/85/1d8d26c2a946ccfd5461a2573665c1fb7d71f7 +0 -0
  62. package/.git/objects/85/c5f24b8c55496f82a2680f94a7d3fa32887ea0 +0 -0
  63. package/.git/objects/87/00b3833597b600e6f0ffcfbaf622fd8cfaa9c3 +0 -1
  64. package/.git/objects/87/f31d3df8e7edbf96e45d80126f878b8e0c243f +0 -0
  65. package/.git/objects/8b/cc95b71b20c79513e9157b921238ca2c79f906 +0 -0
  66. package/.git/objects/8d/d819967bdc8457f04c1b5498bce89380d6552b +0 -7
  67. package/.git/objects/91/b0fba96bf994b6232bb923f2a9929fc258a05f +0 -0
  68. package/.git/objects/92/608c4e069a4301d466d8d18daecbe7abc9500e +0 -0
  69. package/.git/objects/94/a25f7f4cb416c083d265558da75d457237d671 +0 -0
  70. package/.git/objects/9c/69411050eac81b5dce09314516a30b38c41a20 +0 -3
  71. package/.git/objects/9f/54b5b21769da383f12fb9c7bd364bdb05e13a9 +0 -0
  72. package/.git/objects/a5/886c22eb68b152bb95ec5151504676d8e78ae1 +0 -0
  73. package/.git/objects/a6/582c9510e264f3b46fc3b20597a16923a03523 +0 -0
  74. package/.git/objects/a9/d7db9c0a81b2db47ca92e4e180b30090b27632 +0 -0
  75. package/.git/objects/ad/c418f9105db9ec488de6831584b82e3929eaef +0 -0
  76. package/.git/objects/b0/c1c68fbbad6b190434cd2bb0e807796bd56fca +0 -0
  77. package/.git/objects/b1/0f0d0ef3bc5aaf3a91be0b991cb6fe0fcadc40 +0 -0
  78. package/.git/objects/b6/3b642cfb4254fc0f7058903abc5b481895c4ef +0 -0
  79. package/.git/objects/b8/a2c461d7ffed9d4ba242c58a52341832b99e0a +0 -0
  80. package/.git/objects/ba/5b53857ced8d97f6d6e3fb3538b3273743dafc +0 -2
  81. package/.git/objects/ba/5ef7104c0d019a9692cd2d78261d96f29e916f +0 -0
  82. package/.git/objects/bc/91e0079eb00d56dcde16714748f36a10dbd525 +0 -0
  83. package/.git/objects/c1/beeb895b71b709e48560460199db11b3fc18af +0 -0
  84. package/.git/objects/c5/166c2aeebaeb0a0f7654223c843c50cd4c8953 +0 -0
  85. package/.git/objects/d4/0a2096fc36c1fd9c7a9263c458d5e8a4a5bee7 +0 -0
  86. package/.git/objects/e1/b744bc6076ebeb02fa86af98583ac22e070ec0 +0 -0
  87. package/.git/objects/e8/019be9e978a8e2f094e748cbb6ce0c7163adee +0 -0
  88. package/.git/objects/eb/1d744c4e9b47bc902647298424320078e32980 +0 -0
  89. package/.git/objects/ee/15af38be7f3c3862229e59c6b5688f8e0f6099 +0 -0
  90. package/.git/objects/f1/9e0f429f231c34432784f9e33b92ac1d598c17 +0 -0
  91. package/.git/objects/f9/86f2fe82493e85651396b6d5886316d1c890dd +0 -0
  92. package/.git/refs/heads/main +0 -1
  93. package/.git/refs/remotes/origin/main +0 -1
  94. package/.git/refs/tags/v0.1.1 +0 -1
  95. package/.git/shallow +0 -1
  96. package/.github/dependabot.yml +0 -10
  97. package/.github/workflows/ci.yml +0 -12
  98. package/.github/workflows/issues.yml +0 -13
  99. package/.github/workflows/publish.yml +0 -21
  100. package/.gitignore +0 -13
  101. package/.idea/.gitignore +0 -10
  102. package/.idea/aws.xml +0 -11
  103. package/.idea/codeStyles/Project.xml +0 -58
  104. package/.idea/codeStyles/codeStyleConfig.xml +0 -5
  105. package/.idea/commons-js.iml +0 -14
  106. package/.idea/inspectionProfiles/Project_Default.xml +0 -7
  107. package/.idea/misc.xml +0 -6
  108. package/.idea/modules.xml +0 -8
  109. package/.idea/prettier.xml +0 -6
  110. package/.idea/vcs.xml +0 -6
  111. package/.npmrc +0 -1
  112. package/.prettierignore +0 -7
  113. package/.prettierrc.cjs +0 -3
  114. package/LICENSE +0 -26
  115. package/README.md +0 -14
  116. package/coverage/base.css +0 -224
  117. package/coverage/bitsnbytes/b64.mts.html +0 -559
  118. package/coverage/bitsnbytes/index.html +0 -131
  119. package/coverage/bitsnbytes/index.mts.html +0 -88
  120. package/coverage/clover.xml +0 -1003
  121. package/coverage/coverage-final.json +0 -15
  122. package/coverage/errors/errors.mts.html +0 -898
  123. package/coverage/errors/index.html +0 -131
  124. package/coverage/errors/index.mts.html +0 -88
  125. package/coverage/favicon.png +0 -0
  126. package/coverage/http/http-method.mts.html +0 -112
  127. package/coverage/http/http-status-code.mts.html +0 -211
  128. package/coverage/http/index.html +0 -146
  129. package/coverage/http/index.mts.html +0 -91
  130. package/coverage/index.html +0 -191
  131. package/coverage/lang/index.html +0 -146
  132. package/coverage/lang/index.mts.html +0 -91
  133. package/coverage/lang/sleep.mts.html +0 -109
  134. package/coverage/lang/type-functions.mts.html +0 -124
  135. package/coverage/oauth/crypto-functions.mts.html +0 -217
  136. package/coverage/oauth/index.html +0 -131
  137. package/coverage/oauth/index.mts.html +0 -88
  138. package/coverage/prettify.css +0 -1
  139. package/coverage/sort-arrow-sprite.png +0 -0
  140. package/coverage/validator/index.html +0 -131
  141. package/coverage/validator/index.mts.html +0 -88
  142. package/coverage/validator/validators.mts.html +0 -1237
  143. package/dist/package.json +0 -72
  144. package/node_modules/@eslint/eslintrc/LICENSE +0 -19
  145. package/node_modules/@eslint/eslintrc/README.md +0 -115
  146. package/node_modules/@eslint/eslintrc/dist/eslintrc-universal.cjs +0 -1104
  147. package/node_modules/@eslint/eslintrc/dist/eslintrc-universal.cjs.map +0 -1
  148. package/node_modules/@eslint/eslintrc/dist/eslintrc.cjs +0 -4344
  149. package/node_modules/@eslint/eslintrc/dist/eslintrc.cjs.map +0 -1
  150. package/node_modules/@eslint/eslintrc/package.json +0 -82
  151. package/node_modules/@eslint/eslintrc/universal.js +0 -9
  152. package/node_modules/@eslint/js/LICENSE +0 -19
  153. package/node_modules/@eslint/js/README.md +0 -57
  154. package/node_modules/@eslint/js/package.json +0 -31
  155. package/node_modules/@eslint/js/src/index.js +0 -17
  156. package/node_modules/@eslint-community/eslint-utils/LICENSE +0 -21
  157. package/node_modules/@eslint-community/eslint-utils/README.md +0 -37
  158. package/node_modules/@eslint-community/eslint-utils/index.js +0 -2068
  159. package/node_modules/@eslint-community/eslint-utils/index.js.map +0 -1
  160. package/node_modules/@eslint-community/eslint-utils/index.mjs +0 -2027
  161. package/node_modules/@eslint-community/eslint-utils/index.mjs.map +0 -1
  162. package/node_modules/@eslint-community/eslint-utils/package.json +0 -73
  163. package/node_modules/@eslint-community/regexpp/LICENSE +0 -21
  164. package/node_modules/@eslint-community/regexpp/README.md +0 -177
  165. package/node_modules/@eslint-community/regexpp/index.d.ts +0 -1065
  166. package/node_modules/@eslint-community/regexpp/index.js +0 -2747
  167. package/node_modules/@eslint-community/regexpp/index.js.map +0 -1
  168. package/node_modules/@eslint-community/regexpp/index.mjs +0 -2737
  169. package/node_modules/@eslint-community/regexpp/index.mjs.map +0 -1
  170. package/node_modules/@eslint-community/regexpp/package.json +0 -93
  171. package/node_modules/@types/node/LICENSE +0 -21
  172. package/node_modules/@types/node/README.md +0 -15
  173. package/node_modules/@types/node/package.json +0 -217
  174. package/node_modules/@typescript-eslint/eslint-plugin/LICENSE +0 -21
  175. package/node_modules/@typescript-eslint/eslint-plugin/README.md +0 -10
  176. package/node_modules/@typescript-eslint/eslint-plugin/dist/index.js +0 -23
  177. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/README.md +0 -23
  178. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/TEMPLATE.md +0 -26
  179. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/adjacent-overload-signatures.md +0 -93
  180. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/array-type.md +0 -103
  181. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/await-thenable.md +0 -40
  182. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/ban-ts-comment.md +0 -148
  183. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/ban-tslint-comment.md +0 -39
  184. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/ban-types.md +0 -183
  185. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/block-spacing.md +0 -12
  186. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/brace-style.md +0 -12
  187. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/camelcase.md +0 -10
  188. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/class-literal-property-style.md +0 -114
  189. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/comma-dangle.md +0 -22
  190. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/comma-spacing.md +0 -12
  191. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/consistent-generic-constructors.md +0 -73
  192. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/consistent-indexed-object-style.md +0 -80
  193. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/consistent-type-assertions.md +0 -108
  194. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/consistent-type-definitions.md +0 -82
  195. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/consistent-type-exports.md +0 -100
  196. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/consistent-type-imports.md +0 -105
  197. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/default-param-last.md +0 -48
  198. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/dot-notation.md +0 -77
  199. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/explicit-function-return-type.md +0 -319
  200. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/explicit-member-accessibility.md +0 -331
  201. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/explicit-module-boundary-types.md +0 -250
  202. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/func-call-spacing.md +0 -12
  203. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/indent.md +0 -20
  204. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/init-declarations.md +0 -12
  205. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/key-spacing.md +0 -12
  206. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/keyword-spacing.md +0 -12
  207. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/lines-around-comment.md +0 -37
  208. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/lines-between-class-members.md +0 -63
  209. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/member-delimiter-style.md +0 -161
  210. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/member-ordering.md +0 -1360
  211. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/method-signature-style.md +0 -110
  212. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/naming-convention.md +0 -706
  213. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-array-constructor.md +0 -35
  214. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-base-to-string.md +0 -88
  215. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-confusing-non-null-assertion.md +0 -56
  216. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-confusing-void-expression.md +0 -116
  217. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-dupe-class-members.md +0 -12
  218. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-duplicate-enum-values.md +0 -50
  219. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-duplicate-imports.md +0 -12
  220. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-duplicate-type-constituents.md +0 -61
  221. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-dynamic-delete.md +0 -53
  222. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-empty-function.md +0 -88
  223. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-empty-interface.md +0 -70
  224. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-explicit-any.md +0 -174
  225. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-extra-non-null-assertion.md +0 -52
  226. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-extra-parens.md +0 -12
  227. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-extra-semi.md +0 -12
  228. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-extraneous-class.md +0 -294
  229. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-floating-promises.md +0 -106
  230. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-for-in-array.md +0 -56
  231. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-implicit-any-catch.md +0 -73
  232. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-implied-eval.md +0 -101
  233. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-import-type-side-effects.md +0 -75
  234. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-inferrable-types.md +0 -103
  235. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-invalid-this.md +0 -12
  236. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-invalid-void-type.md +0 -113
  237. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-loop-func.md +0 -12
  238. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-loss-of-precision.md +0 -12
  239. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-magic-numbers.md +0 -131
  240. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-meaningless-void-operator.md +0 -47
  241. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-misused-new.md +0 -46
  242. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-misused-promises.md +0 -245
  243. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-mixed-enums.md +0 -88
  244. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-namespace.md +0 -129
  245. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-non-null-asserted-nullish-coalescing.md +0 -49
  246. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-non-null-asserted-optional-chain.md +0 -35
  247. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-non-null-assertion.md +0 -42
  248. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-parameter-properties.md +0 -406
  249. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-redeclare.md +0 -73
  250. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-redundant-type-constituents.md +0 -78
  251. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-require-imports.md +0 -37
  252. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-restricted-imports.md +0 -63
  253. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-shadow.md +0 -101
  254. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-this-alias.md +0 -38
  255. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-throw-literal.md +0 -111
  256. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-type-alias.md +0 -602
  257. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unnecessary-boolean-literal-compare.md +0 -133
  258. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unnecessary-condition.md +0 -103
  259. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unnecessary-qualifier.md +0 -51
  260. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unnecessary-type-arguments.md +0 -73
  261. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unnecessary-type-assertion.md +0 -77
  262. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unnecessary-type-constraint.md +0 -55
  263. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unsafe-argument.md +0 -83
  264. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unsafe-assignment.md +0 -86
  265. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unsafe-call.md +0 -58
  266. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unsafe-declaration-merging.md +0 -54
  267. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unsafe-enum-comparison.md +0 -75
  268. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unsafe-member-access.md +0 -64
  269. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unsafe-return.md +0 -103
  270. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unused-expressions.md +0 -12
  271. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unused-vars.md +0 -12
  272. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-use-before-define.md +0 -97
  273. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-useless-constructor.md +0 -21
  274. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-useless-empty-export.md +0 -43
  275. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-var-requires.md +0 -37
  276. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/non-nullable-type-assertion-style.md +0 -41
  277. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/object-curly-spacing.md +0 -12
  278. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/padding-line-between-statements.md +0 -35
  279. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/parameter-properties.md +0 -485
  280. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-as-const.md +0 -44
  281. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-enum-initializers.md +0 -62
  282. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-for-of.md +0 -46
  283. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-function-type.md +0 -92
  284. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-includes.md +0 -77
  285. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-literal-enum-member.md +0 -101
  286. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-namespace-keyword.md +0 -47
  287. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-nullish-coalescing.md +0 -164
  288. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-optional-chain.md +0 -71
  289. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-readonly-parameter-types.md +0 -268
  290. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-readonly.md +0 -87
  291. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-reduce-type-parameter.md +0 -58
  292. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-regexp-exec.md +0 -46
  293. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-return-this-type.md +0 -87
  294. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-string-starts-ends-with.md +0 -57
  295. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-ts-expect-error.md +0 -69
  296. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/promise-function-async.md +0 -59
  297. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/quotes.md +0 -12
  298. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/require-array-sort-compare.md +0 -78
  299. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/require-await.md +0 -24
  300. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/restrict-plus-operands.md +0 -208
  301. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/restrict-template-expressions.md +0 -117
  302. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/return-await.md +0 -216
  303. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/semi.md +0 -16
  304. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/sort-type-constituents.md +0 -101
  305. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/sort-type-union-intersection-members.md +0 -106
  306. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/space-before-blocks.md +0 -42
  307. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/space-before-function-paren.md +0 -12
  308. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/space-infix-ops.md +0 -16
  309. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/strict-boolean-expressions.md +0 -183
  310. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/switch-exhaustiveness-check.md +0 -106
  311. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/triple-slash-reference.md +0 -61
  312. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/type-annotation-spacing.md +0 -303
  313. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/typedef.md +0 -320
  314. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/unbound-method.md +0 -103
  315. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/unified-signatures.md +0 -70
  316. package/node_modules/@typescript-eslint/eslint-plugin/index.d.ts +0 -4
  317. package/node_modules/@typescript-eslint/eslint-plugin/package.json +0 -87
  318. package/node_modules/@typescript-eslint/parser/LICENSE +0 -22
  319. package/node_modules/@typescript-eslint/parser/README.md +0 -10
  320. package/node_modules/@typescript-eslint/parser/dist/index.js +0 -17
  321. package/node_modules/@typescript-eslint/parser/package.json +0 -75
  322. package/node_modules/@typescript-eslint/scope-manager/LICENSE +0 -21
  323. package/node_modules/@typescript-eslint/scope-manager/README.md +0 -8
  324. package/node_modules/@typescript-eslint/scope-manager/dist/index.js +0 -31
  325. package/node_modules/@typescript-eslint/scope-manager/package.json +0 -67
  326. package/node_modules/@typescript-eslint/type-utils/LICENSE +0 -21
  327. package/node_modules/@typescript-eslint/type-utils/README.md +0 -12
  328. package/node_modules/@typescript-eslint/type-utils/dist/index.js +0 -36
  329. package/node_modules/@typescript-eslint/type-utils/package.json +0 -71
  330. package/node_modules/@typescript-eslint/types/LICENSE +0 -21
  331. package/node_modules/@typescript-eslint/types/README.md +0 -12
  332. package/node_modules/@typescript-eslint/types/dist/index.js +0 -24
  333. package/node_modules/@typescript-eslint/types/package.json +0 -84
  334. package/node_modules/@typescript-eslint/typescript-estree/LICENSE +0 -26
  335. package/node_modules/@typescript-eslint/typescript-estree/README.md +0 -10
  336. package/node_modules/@typescript-eslint/typescript-estree/dist/index.js +0 -38
  337. package/node_modules/@typescript-eslint/typescript-estree/package.json +0 -85
  338. package/node_modules/@typescript-eslint/utils/LICENSE +0 -21
  339. package/node_modules/@typescript-eslint/utils/README.md +0 -10
  340. package/node_modules/@typescript-eslint/utils/dist/index.js +0 -41
  341. package/node_modules/@typescript-eslint/utils/package.json +0 -70
  342. package/node_modules/@typescript-eslint/visitor-keys/LICENSE +0 -21
  343. package/node_modules/@typescript-eslint/visitor-keys/README.md +0 -10
  344. package/node_modules/@typescript-eslint/visitor-keys/dist/index.js +0 -8
  345. package/node_modules/@typescript-eslint/visitor-keys/package.json +0 -60
  346. package/node_modules/@vitest/coverage-v8/LICENSE +0 -21
  347. package/node_modules/@vitest/coverage-v8/dist/index.js +0 -54
  348. package/node_modules/@vitest/coverage-v8/package.json +0 -72
  349. package/pnpm-lock.yaml +0 -3277
  350. package/src/bitsnbytes/b64.mts +0 -158
  351. package/src/bitsnbytes/b64.test.mts +0 -78
  352. package/src/bitsnbytes/index.mts +0 -1
  353. package/src/errors/errors.mts +0 -271
  354. package/src/errors/errors.test.mts +0 -74
  355. package/src/errors/index.mts +0 -1
  356. package/src/http/http-method.mts +0 -9
  357. package/src/http/http-status-code.mts +0 -42
  358. package/src/http/index.mts +0 -2
  359. package/src/lang/index.mts +0 -2
  360. package/src/lang/sleep.mts +0 -8
  361. package/src/lang/type-functions.mts +0 -13
  362. package/src/oauth/crypto-functions.mts +0 -44
  363. package/src/oauth/crypto-functions.test.mts +0 -48
  364. package/src/oauth/index.mts +0 -1
  365. package/src/validator/index.mts +0 -1
  366. package/src/validator/validators.mts +0 -384
  367. package/src/validator/validators.test.mts +0 -245
  368. package/tsconfig.json +0 -18
  369. /package/{dist/bitsnbytes → bitsnbytes}/b64.d.mts +0 -0
  370. /package/{dist/bitsnbytes → bitsnbytes}/b64.d.mts.map +0 -0
  371. /package/{dist/bitsnbytes → bitsnbytes}/b64.mjs +0 -0
  372. /package/{dist/bitsnbytes → bitsnbytes}/b64.mjs.map +0 -0
  373. /package/{dist/bitsnbytes → bitsnbytes}/b64.test.d.mts +0 -0
  374. /package/{dist/bitsnbytes → bitsnbytes}/b64.test.d.mts.map +0 -0
  375. /package/{dist/bitsnbytes → bitsnbytes}/b64.test.mjs +0 -0
  376. /package/{dist/bitsnbytes → bitsnbytes}/b64.test.mjs.map +0 -0
  377. /package/{dist/bitsnbytes → bitsnbytes}/index.d.mts +0 -0
  378. /package/{dist/bitsnbytes → bitsnbytes}/index.d.mts.map +0 -0
  379. /package/{dist/bitsnbytes → bitsnbytes}/index.mjs +0 -0
  380. /package/{dist/bitsnbytes → bitsnbytes}/index.mjs.map +0 -0
  381. /package/{dist/errors → errors}/errors.d.mts +0 -0
  382. /package/{dist/errors → errors}/errors.d.mts.map +0 -0
  383. /package/{dist/errors → errors}/errors.mjs +0 -0
  384. /package/{dist/errors → errors}/errors.mjs.map +0 -0
  385. /package/{dist/errors → errors}/errors.test.d.mts +0 -0
  386. /package/{dist/errors → errors}/errors.test.d.mts.map +0 -0
  387. /package/{dist/errors → errors}/errors.test.mjs +0 -0
  388. /package/{dist/errors → errors}/errors.test.mjs.map +0 -0
  389. /package/{dist/errors → errors}/index.d.mts +0 -0
  390. /package/{dist/errors → errors}/index.d.mts.map +0 -0
  391. /package/{dist/errors → errors}/index.mjs +0 -0
  392. /package/{dist/errors → errors}/index.mjs.map +0 -0
  393. /package/{dist/http → http}/http-method.d.mts +0 -0
  394. /package/{dist/http → http}/http-method.d.mts.map +0 -0
  395. /package/{dist/http → http}/http-method.mjs +0 -0
  396. /package/{dist/http → http}/http-method.mjs.map +0 -0
  397. /package/{dist/http → http}/http-status-code.d.mts +0 -0
  398. /package/{dist/http → http}/http-status-code.d.mts.map +0 -0
  399. /package/{dist/http → http}/http-status-code.mjs +0 -0
  400. /package/{dist/http → http}/http-status-code.mjs.map +0 -0
  401. /package/{dist/http → http}/index.d.mts +0 -0
  402. /package/{dist/http → http}/index.d.mts.map +0 -0
  403. /package/{dist/http → http}/index.mjs +0 -0
  404. /package/{dist/http → http}/index.mjs.map +0 -0
  405. /package/{dist/lang → lang}/index.d.mts +0 -0
  406. /package/{dist/lang → lang}/index.d.mts.map +0 -0
  407. /package/{dist/lang → lang}/index.mjs +0 -0
  408. /package/{dist/lang → lang}/index.mjs.map +0 -0
  409. /package/{dist/lang → lang}/sleep.d.mts +0 -0
  410. /package/{dist/lang → lang}/sleep.d.mts.map +0 -0
  411. /package/{dist/lang → lang}/sleep.mjs +0 -0
  412. /package/{dist/lang → lang}/sleep.mjs.map +0 -0
  413. /package/{dist/lang → lang}/type-functions.d.mts +0 -0
  414. /package/{dist/lang → lang}/type-functions.d.mts.map +0 -0
  415. /package/{dist/lang → lang}/type-functions.mjs +0 -0
  416. /package/{dist/lang → lang}/type-functions.mjs.map +0 -0
  417. /package/{dist/oauth → oauth}/crypto-functions.d.mts +0 -0
  418. /package/{dist/oauth → oauth}/crypto-functions.d.mts.map +0 -0
  419. /package/{dist/oauth → oauth}/crypto-functions.mjs +0 -0
  420. /package/{dist/oauth → oauth}/crypto-functions.mjs.map +0 -0
  421. /package/{dist/oauth → oauth}/crypto-functions.test.d.mts +0 -0
  422. /package/{dist/oauth → oauth}/crypto-functions.test.d.mts.map +0 -0
  423. /package/{dist/oauth → oauth}/crypto-functions.test.mjs +0 -0
  424. /package/{dist/oauth → oauth}/crypto-functions.test.mjs.map +0 -0
  425. /package/{dist/oauth → oauth}/index.d.mts +0 -0
  426. /package/{dist/oauth → oauth}/index.d.mts.map +0 -0
  427. /package/{dist/oauth → oauth}/index.mjs +0 -0
  428. /package/{dist/oauth → oauth}/index.mjs.map +0 -0
  429. /package/{dist/validator → validator}/index.d.mts +0 -0
  430. /package/{dist/validator → validator}/index.d.mts.map +0 -0
  431. /package/{dist/validator → validator}/index.mjs +0 -0
  432. /package/{dist/validator → validator}/index.mjs.map +0 -0
  433. /package/{dist/validator → validator}/validators.d.mts +0 -0
  434. /package/{dist/validator → validator}/validators.d.mts.map +0 -0
  435. /package/{dist/validator → validator}/validators.mjs +0 -0
  436. /package/{dist/validator → validator}/validators.mjs.map +0 -0
  437. /package/{dist/validator → validator}/validators.test.d.mts +0 -0
  438. /package/{dist/validator → validator}/validators.test.d.mts.map +0 -0
  439. /package/{dist/validator → validator}/validators.test.mjs +0 -0
  440. /package/{dist/validator → validator}/validators.test.mjs.map +0 -0
@@ -1,133 +0,0 @@
1
- ---
2
- description: 'Disallow unnecessary equality comparisons against boolean literals.'
3
- ---
4
-
5
- > 🛑 This file is source code, not the primary documentation location! 🛑
6
- >
7
- > See **https://typescript-eslint.io/rules/no-unnecessary-boolean-literal-compare** for documentation.
8
-
9
- Comparing boolean values to boolean literals is unnecessary: those comparisons result in the same booleans.
10
- Using the boolean values directly, or via a unary negation (`!value`), is more concise and clearer.
11
-
12
- This rule ensures that you do not include unnecessary comparisons with boolean literals.
13
- A comparison is considered unnecessary if it checks a boolean literal against any variable with just the `boolean` type.
14
- A comparison is **_not_** considered unnecessary if the type is a union of booleans (`string | boolean`, `SomeObject | boolean`, etc.).
15
-
16
- ## Examples
17
-
18
- :::note
19
- Throughout this page, only strict equality (`===` and `!==`) are used in the examples.
20
- However, the implementation of the rule does not distinguish between strict and loose equality.
21
- Any example below that uses `===` would be treated the same way if `==` was used, and `!==` would be treated the same way if `!=` was used.
22
- :::
23
-
24
- <!--tabs-->
25
-
26
- ### ❌ Incorrect
27
-
28
- ```ts
29
- declare const someCondition: boolean;
30
- if (someCondition === true) {
31
- }
32
- ```
33
-
34
- ### ✅ Correct
35
-
36
- ```ts
37
- declare const someCondition: boolean;
38
- if (someCondition) {
39
- }
40
-
41
- declare const someObjectBoolean: boolean | Record<string, unknown>;
42
- if (someObjectBoolean === true) {
43
- }
44
-
45
- declare const someStringBoolean: boolean | string;
46
- if (someStringBoolean === true) {
47
- }
48
- ```
49
-
50
- ## Options
51
-
52
- This rule always checks comparisons between a boolean variable and a boolean
53
- literal. Comparisons between nullable boolean variables and boolean literals
54
- are **not** checked by default.
55
-
56
- ### `allowComparingNullableBooleansToTrue`
57
-
58
- Examples of code for this rule with `{ allowComparingNullableBooleansToTrue: false }`:
59
-
60
- <!--tabs-->
61
-
62
- #### ❌ Incorrect
63
-
64
- ```ts
65
- declare const someUndefinedCondition: boolean | undefined;
66
- if (someUndefinedCondition === true) {
67
- }
68
-
69
- declare const someNullCondition: boolean | null;
70
- if (someNullCondition !== true) {
71
- }
72
- ```
73
-
74
- #### ✅ Correct
75
-
76
- ```ts
77
- declare const someUndefinedCondition: boolean | undefined;
78
- if (someUndefinedCondition) {
79
- }
80
-
81
- declare const someNullCondition: boolean | null;
82
- if (!someNullCondition) {
83
- }
84
- ```
85
-
86
- ### `allowComparingNullableBooleansToFalse`
87
-
88
- Examples of code for this rule with `{ allowComparingNullableBooleansToFalse: false }`:
89
-
90
- <!--tabs-->
91
-
92
- #### ❌ Incorrect
93
-
94
- ```ts
95
- declare const someUndefinedCondition: boolean | undefined;
96
- if (someUndefinedCondition === false) {
97
- }
98
-
99
- declare const someNullCondition: boolean | null;
100
- if (someNullCondition !== false) {
101
- }
102
- ```
103
-
104
- #### ✅ Correct
105
-
106
- ```ts
107
- declare const someUndefinedCondition: boolean | undefined;
108
- if (someUndefinedCondition ?? true) {
109
- }
110
-
111
- declare const someNullCondition: boolean | null;
112
- if (!(someNullCondition ?? true)) {
113
- }
114
- ```
115
-
116
- ## Fixer
117
-
118
- | Comparison | Fixer Output | Notes |
119
- | :-------------------------------: | ------------------------------- | ----------------------------------------------------------------------------------- |
120
- | `booleanVar === true` | `booleanVar` | |
121
- | `booleanVar !== true` | `!booleanVar` | |
122
- | `booleanVar === false` | `!booleanVar` | |
123
- | `booleanVar !== false` | `booleanVar` | |
124
- | `nullableBooleanVar === true` | `nullableBooleanVar` | Only checked/fixed if the `allowComparingNullableBooleansToTrue` option is `false` |
125
- | `nullableBooleanVar !== true` | `!nullableBooleanVar` | Only checked/fixed if the `allowComparingNullableBooleansToTrue` option is `false` |
126
- | `!(nullableBooleanVar === false)` | `nullableBooleanVar ?? true` | Only checked/fixed if the `allowComparingNullableBooleansToFalse` option is `false` |
127
- | `!(nullableBooleanVar !== false)` | `!(nullableBooleanVar ?? true)` | Only checked/fixed if the `allowComparingNullableBooleansToFalse` option is `false` |
128
-
129
- ## Not To Use It
130
-
131
- Do not use this rule when `strictNullChecks` is disabled.
132
- ESLint is not able to distinguish between `false` and `undefined` or `null` values.
133
- This can cause unintended code changes when using autofix.
@@ -1,103 +0,0 @@
1
- ---
2
- description: 'Disallow conditionals where the type is always truthy or always falsy.'
3
- ---
4
-
5
- > 🛑 This file is source code, not the primary documentation location! 🛑
6
- >
7
- > See **https://typescript-eslint.io/rules/no-unnecessary-condition** for documentation.
8
-
9
- Any expression being used as a condition must be able to evaluate as truthy or falsy in order to be considered "necessary".
10
- Conversely, any expression that always evaluates to truthy or always evaluates to falsy, as determined by the type of the expression, is considered unnecessary and will be flagged by this rule.
11
-
12
- The following expressions are checked:
13
-
14
- - Arguments to the `&&`, `||` and `?:` (ternary) operators
15
- - Conditions for `if`, `for`, `while`, and `do-while` statements
16
- - Base values of optional chain expressions
17
-
18
- ## Examples
19
-
20
- <!--tabs-->
21
-
22
- ### ❌ Incorrect
23
-
24
- ```ts
25
- function head<T>(items: T[]) {
26
- // items can never be nullable, so this is unnecessary
27
- if (items) {
28
- return items[0].toUpperCase();
29
- }
30
- }
31
-
32
- function foo(arg: 'bar' | 'baz') {
33
- // arg is never nullable or empty string, so this is unnecessary
34
- if (arg) {
35
- }
36
- }
37
-
38
- function bar<T>(arg: string) {
39
- // arg can never be nullish, so ?. is unnecessary
40
- return arg?.length;
41
- }
42
-
43
- // Checks array predicate return types, where possible
44
- [
45
- [1, 2],
46
- [3, 4],
47
- ].filter(t => t); // number[] is always truthy
48
- ```
49
-
50
- ### ✅ Correct
51
-
52
- ```ts
53
- function head<T>(items: T[]) {
54
- // Necessary, since items.length might be 0
55
- if (items.length) {
56
- return items[0].toUpperCase();
57
- }
58
- }
59
-
60
- function foo(arg: string) {
61
- // Necessary, since foo might be ''.
62
- if (arg) {
63
- }
64
- }
65
-
66
- function bar(arg?: string | null) {
67
- // Necessary, since arg might be nullish
68
- return arg?.length;
69
- }
70
-
71
- [0, 1, 2, 3].filter(t => t); // number can be truthy or falsy
72
- ```
73
-
74
- ## Options
75
-
76
- ### `allowConstantLoopConditions`
77
-
78
- Example of correct code for `{ allowConstantLoopConditions: true }`:
79
-
80
- ```ts
81
- while (true) {}
82
- for (; true; ) {}
83
- do {} while (true);
84
- ```
85
-
86
- ### `allowRuleToRunWithoutStrictNullChecksIKnowWhatIAmDoing`
87
-
88
- If this is set to `false`, then the rule will error on every file whose `tsconfig.json` does _not_ have the `strictNullChecks` compiler option (or `strict`) set to `true`.
89
-
90
- Without `strictNullChecks`, TypeScript essentially erases `undefined` and `null` from the types. This means when this rule inspects the types from a variable, **it will not be able to tell that the variable might be `null` or `undefined`**, which essentially makes this rule useless.
91
-
92
- You should be using `strictNullChecks` to ensure complete type-safety in your codebase.
93
-
94
- If for some reason you cannot turn on `strictNullChecks`, but still want to use this rule - you can use this option to allow it - but know that the behavior of this rule is _undefined_ with the compiler option turned off. We will not accept bug reports if you are using this option.
95
-
96
- ## When Not To Use It
97
-
98
- The main downside to using this rule is the need for type information.
99
-
100
- ## Related To
101
-
102
- - ESLint: [no-constant-condition](https://eslint.org/docs/rules/no-constant-condition) - `no-unnecessary-condition` is essentially a stronger version of `no-constant-condition`, but requires type information.
103
- - [strict-boolean-expressions](./strict-boolean-expressions.md) - a more opinionated version of `no-unnecessary-condition`. `strict-boolean-expressions` enforces a specific code style, while `no-unnecessary-condition` is about correctness.
@@ -1,51 +0,0 @@
1
- ---
2
- description: 'Disallow unnecessary namespace qualifiers.'
3
- ---
4
-
5
- > 🛑 This file is source code, not the primary documentation location! 🛑
6
- >
7
- > See **https://typescript-eslint.io/rules/no-unnecessary-qualifier** for documentation.
8
-
9
- Members of TypeScript enums and namespaces are generally retrieved as qualified property lookups: e.g. `Enum.member`.
10
- However, when accessed within their parent enum or namespace, the qualifier is unnecessary: e.g. just `member` instead of `Enum.member`.
11
- This rule reports when an enum or namespace qualifier is unnecessary.
12
-
13
- ## Examples
14
-
15
- <!--tabs-->
16
-
17
- ### ❌ Incorrect
18
-
19
- ```ts
20
- enum A {
21
- B,
22
- C = A.B,
23
- }
24
- ```
25
-
26
- ```ts
27
- namespace A {
28
- export type B = number;
29
- const x: A.B = 3;
30
- }
31
- ```
32
-
33
- ### ✅ Correct
34
-
35
- ```ts
36
- enum A {
37
- B,
38
- C = B,
39
- }
40
- ```
41
-
42
- ```ts
43
- namespace A {
44
- export type B = number;
45
- const x: B = 3;
46
- }
47
- ```
48
-
49
- ## When Not To Use It
50
-
51
- If you don't care about having unneeded enum or namespace qualifiers, then you don't need to use this rule.
@@ -1,73 +0,0 @@
1
- ---
2
- description: 'Disallow type arguments that are equal to the default.'
3
- ---
4
-
5
- > 🛑 This file is source code, not the primary documentation location! 🛑
6
- >
7
- > See **https://typescript-eslint.io/rules/no-unnecessary-type-arguments** for documentation.
8
-
9
- Type parameters in TypeScript may specify a default value.
10
- For example:
11
-
12
- ```ts
13
- function f<T = number>(...) {...}
14
- ```
15
-
16
- It is redundant to provide an explicit type parameter equal to that default: e.g. calling `f<number>(...)`.
17
- This rule reports when an explicitly specified type argument is the default for that type parameter.
18
-
19
- ## Examples
20
-
21
- <!--tabs-->
22
-
23
- ### ❌ Incorrect
24
-
25
- ```ts
26
- function f<T = number>() {}
27
- f<number>();
28
- ```
29
-
30
- ```ts
31
- function g<T = number, U = string>() {}
32
- g<string, string>();
33
- ```
34
-
35
- ```ts
36
- class C<T = number> {}
37
- new C<number>();
38
-
39
- class D extends C<number> {}
40
- ```
41
-
42
- ```ts
43
- interface I<T = number> {}
44
- class Impl implements I<number> {}
45
- ```
46
-
47
- ### ✅ Correct
48
-
49
- ```ts
50
- function f<T = number>() {}
51
- f();
52
- f<string>();
53
- ```
54
-
55
- ```ts
56
- function g<T = number, U = string>() {}
57
- g<string>();
58
- g<number, number>();
59
- ```
60
-
61
- ```ts
62
- class C<T = number> {}
63
- new C();
64
- new C<string>();
65
-
66
- class D extends C {}
67
- class D extends C<string> {}
68
- ```
69
-
70
- ```ts
71
- interface I<T = number> {}
72
- class Impl implements I<string> {}
73
- ```
@@ -1,77 +0,0 @@
1
- ---
2
- description: 'Disallow type assertions that do not change the type of an expression.'
3
- ---
4
-
5
- > 🛑 This file is source code, not the primary documentation location! 🛑
6
- >
7
- > See **https://typescript-eslint.io/rules/no-unnecessary-type-assertion** for documentation.
8
-
9
- TypeScript can be told an expression is a different type than expected using `as` type assertions.
10
- Leaving `as` assertions in the codebase increases visual clutter and harms code readability, so it's generally best practice to remove them if they don't change the type of an expression.
11
- This rule reports when a type assertion does not change the type of an expression.
12
-
13
- ## Examples
14
-
15
- <!--tabs-->
16
-
17
- ### ❌ Incorrect
18
-
19
- ```ts
20
- const foo = 3;
21
- const bar = foo!;
22
- ```
23
-
24
- ```ts
25
- const foo = <3>3;
26
- ```
27
-
28
- ```ts
29
- type Foo = 3;
30
- const foo = <Foo>3;
31
- ```
32
-
33
- ```ts
34
- type Foo = 3;
35
- const foo = 3 as Foo;
36
- ```
37
-
38
- ```ts
39
- function foo(x: number): number {
40
- return x!; // unnecessary non-null
41
- }
42
- ```
43
-
44
- ### ✅ Correct
45
-
46
- ```ts
47
- const foo = <number>3;
48
- ```
49
-
50
- ```ts
51
- const foo = 3 as number;
52
- ```
53
-
54
- ```ts
55
- const foo = 'foo' as const;
56
- ```
57
-
58
- ```ts
59
- function foo(x: number | undefined): number {
60
- return x!;
61
- }
62
- ```
63
-
64
- ## Options
65
-
66
- ### `typesToIgnore`
67
-
68
- With `@typescript-eslint/no-unnecessary-type-assertion: ["error", { typesToIgnore: ['Foo'] }]`, the following is **correct** code":
69
-
70
- ```ts
71
- type Foo = 3;
72
- const foo: Foo = 3;
73
- ```
74
-
75
- ## When Not To Use It
76
-
77
- If you don't care about having no-op type assertions in your code, then you can turn off this rule.
@@ -1,55 +0,0 @@
1
- ---
2
- description: 'Disallow unnecessary constraints on generic types.'
3
- ---
4
-
5
- > 🛑 This file is source code, not the primary documentation location! 🛑
6
- >
7
- > See **https://typescript-eslint.io/rules/no-unnecessary-type-constraint** for documentation.
8
-
9
- Generic type parameters (`<T>`) in TypeScript may be "constrained" with an [`extends` keyword](https://www.typescriptlang.org/docs/handbook/generics.html#generic-constraints).
10
- When no `extends` is provided, type parameters default a constraint to `unknown`.
11
- It is therefore redundant to `extend` from `any` or `unknown`.
12
-
13
- ## Examples
14
-
15
- <!--tabs-->
16
-
17
- ### ❌ Incorrect
18
-
19
- ```ts
20
- interface FooAny<T extends any> {}
21
-
22
- interface FooUnknown<T extends unknown> {}
23
-
24
- type BarAny<T extends any> = {};
25
-
26
- type BarUnknown<T extends unknown> = {};
27
-
28
- class BazAny<T extends any> {
29
- quxAny<U extends any>() {}
30
- }
31
-
32
- const QuuxAny = <T extends any>() => {};
33
-
34
- function QuuzAny<T extends any>() {}
35
- ```
36
-
37
- ### ✅ Correct
38
-
39
- ```ts
40
- interface Foo<T> {}
41
-
42
- type Bar<T> = {};
43
-
44
- class Baz<T> {
45
- qux<U> { }
46
- }
47
-
48
- const Quux = <T>() => {};
49
-
50
- function Quuz<T>() {}
51
- ```
52
-
53
- ## When Not To Use It
54
-
55
- If you don't care about the specific styles of your type constraints, or never use them in the first place, then you will not need this rule.
@@ -1,83 +0,0 @@
1
- ---
2
- description: 'Disallow calling a function with a value with type `any`.'
3
- ---
4
-
5
- > 🛑 This file is source code, not the primary documentation location! 🛑
6
- >
7
- > See **https://typescript-eslint.io/rules/no-unsafe-argument** for documentation.
8
-
9
- The `any` type in TypeScript is a dangerous "escape hatch" from the type system.
10
- Using `any` disables many type checking rules and is generally best used only as a last resort or when prototyping code.
11
-
12
- Despite your best intentions, the `any` type can sometimes leak into your codebase.
13
- Calling a function with an `any` typed argument creates a potential safety hole and source of bugs.
14
-
15
- This rule disallows calling a function with `any` in its arguments.
16
- That includes spreading arrays or tuples with `any` typed elements as function arguments.
17
-
18
- This rule also compares generic type argument types to ensure you don't pass an unsafe `any` in a generic position to a receiver that's expecting a specific type.
19
- For example, it will error if you pass `Set<any>` as an argument to a parameter declared as `Set<string>`.
20
-
21
- ## Examples
22
-
23
- <!--tabs-->
24
-
25
- ### ❌ Incorrect
26
-
27
- ```ts
28
- declare function foo(arg1: string, arg2: number, arg3: string): void;
29
-
30
- const anyTyped = 1 as any;
31
-
32
- foo(...anyTyped);
33
- foo(anyTyped, 1, 'a');
34
-
35
- const anyArray: any[] = [];
36
- foo(...anyArray);
37
-
38
- const tuple1 = ['a', anyTyped, 'b'] as const;
39
- foo(...tuple1);
40
-
41
- const tuple2 = [1] as const;
42
- foo('a', ...tuple, anyTyped);
43
-
44
- declare function bar(arg1: string, arg2: number, ...rest: string[]): void;
45
- const x = [1, 2] as [number, ...number[]];
46
- foo('a', ...x, anyTyped);
47
-
48
- declare function baz(arg1: Set<string>, arg2: Map<string, string>): void;
49
- foo(new Set<any>(), new Map<any, string>());
50
- ```
51
-
52
- ### ✅ Correct
53
-
54
- ```ts
55
- declare function foo(arg1: string, arg2: number, arg3: string): void;
56
-
57
- foo('a', 1, 'b');
58
-
59
- const tuple1 = ['a', 1, 'b'] as const;
60
- foo(...tuple1);
61
-
62
- declare function bar(arg1: string, arg2: number, ...rest: string[]): void;
63
- const array: string[] = ['a'];
64
- bar('a', 1, ...array);
65
-
66
- declare function baz(arg1: Set<string>, arg2: Map<string, string>): void;
67
- foo(new Set<string>(), new Map<string, string>());
68
- ```
69
-
70
- <!--/tabs-->
71
-
72
- There are cases where the rule allows passing an argument of `any` to `unknown`.
73
-
74
- Example of `any` to `unknown` assignment that are allowed:
75
-
76
- ```ts
77
- declare function foo(arg1: unknown, arg2: Set<unkown>, arg3: unknown[]): void;
78
- foo(1 as any, new Set<any>(), [] as any[]);
79
- ```
80
-
81
- ## Related To
82
-
83
- - [`no-explicit-any`](./no-explicit-any.md)
@@ -1,86 +0,0 @@
1
- ---
2
- description: 'Disallow assigning a value with type `any` to variables and properties.'
3
- ---
4
-
5
- > 🛑 This file is source code, not the primary documentation location! 🛑
6
- >
7
- > See **https://typescript-eslint.io/rules/no-unsafe-assignment** for documentation.
8
-
9
- The `any` type in TypeScript is a dangerous "escape hatch" from the type system.
10
- Using `any` disables many type checking rules and is generally best used only as a last resort or when prototyping code.
11
-
12
- Despite your best intentions, the `any` type can sometimes leak into your codebase.
13
- Assigning an `any` typed value to a variable can be hard to pick up on, particularly if it leaks in from an external library.
14
-
15
- This rule disallows assigning `any` to a variable, and assigning `any[]` to an array destructuring.
16
-
17
- This rule also compares generic type argument types to ensure you don't pass an unsafe `any` in a generic position to a receiver that's expecting a specific type.
18
- For example, it will error if you assign `Set<any>` to a variable declared as `Set<string>`.
19
-
20
- ## Examples
21
-
22
- <!--tabs-->
23
-
24
- ### ❌ Incorrect
25
-
26
- ```ts
27
- const x = 1 as any,
28
- y = 1 as any;
29
- const [x] = 1 as any;
30
- const [x] = [] as any[];
31
- const [x] = [1 as any];
32
- [x] = [1] as [any];
33
-
34
- function foo(a = 1 as any) {}
35
- class Foo {
36
- constructor(private a = 1 as any) {}
37
- }
38
- class Foo {
39
- private a = 1 as any;
40
- }
41
-
42
- // generic position examples
43
- const x: Set<string> = new Set<any>();
44
- const x: Map<string, string> = new Map<string, any>();
45
- const x: Set<string[]> = new Set<any[]>();
46
- const x: Set<Set<Set<string>>> = new Set<Set<Set<any>>>();
47
- ```
48
-
49
- ### ✅ Correct
50
-
51
- ```ts
52
- const x = 1,
53
- y = 1;
54
- const [x] = [1];
55
- [x] = [1] as [number];
56
-
57
- function foo(a = 1) {}
58
- class Foo {
59
- constructor(private a = 1) {}
60
- }
61
- class Foo {
62
- private a = 1;
63
- }
64
-
65
- // generic position examples
66
- const x: Set<string> = new Set<string>();
67
- const x: Map<string, string> = new Map<string, string>();
68
- const x: Set<string[]> = new Set<string[]>();
69
- const x: Set<Set<Set<string>>> = new Set<Set<Set<string>>>();
70
- ```
71
-
72
- <!--/tabs-->
73
-
74
- There are cases where the rule allows assignment of `any` to `unknown`.
75
-
76
- Example of `any` to `unknown` assignment that are allowed:
77
-
78
- ```ts
79
- const x: unknown = y as any;
80
- const x: unknown[] = y as any[];
81
- const x: Set<unknown> = y as Set<any>;
82
- ```
83
-
84
- ## Related To
85
-
86
- - [`no-explicit-any`](./no-explicit-any.md)