@nr1e/commons 0.1.0-alpha.1 → 0.1.1-alpha.0

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 (438) hide show
  1. package/.editorconfig +19 -0
  2. package/.eslintignore +3 -0
  3. package/.eslintrc.json +4 -0
  4. package/.git/COMMIT_EDITMSG +5 -0
  5. package/.git/FETCH_HEAD +1 -0
  6. package/.git/HEAD +1 -0
  7. package/.git/config +18 -0
  8. package/.git/config.worktree +5 -0
  9. package/.git/description +1 -0
  10. package/.git/hooks/applypatch-msg.sample +15 -0
  11. package/.git/hooks/commit-msg.sample +24 -0
  12. package/.git/hooks/fsmonitor-watchman.sample +174 -0
  13. package/.git/hooks/post-update.sample +8 -0
  14. package/.git/hooks/pre-applypatch.sample +14 -0
  15. package/.git/hooks/pre-commit.sample +49 -0
  16. package/.git/hooks/pre-merge-commit.sample +13 -0
  17. package/.git/hooks/pre-push.sample +53 -0
  18. package/.git/hooks/pre-rebase.sample +169 -0
  19. package/.git/hooks/pre-receive.sample +24 -0
  20. package/.git/hooks/prepare-commit-msg.sample +42 -0
  21. package/.git/hooks/push-to-checkout.sample +78 -0
  22. package/.git/hooks/sendemail-validate.sample +77 -0
  23. package/.git/hooks/update.sample +128 -0
  24. package/.git/index +0 -0
  25. package/.git/info/exclude +6 -0
  26. package/.git/logs/HEAD +2 -0
  27. package/.git/logs/refs/heads/develop +2 -0
  28. package/.git/logs/refs/remotes/origin/develop +2 -0
  29. package/.git/objects/07/c0af7cd711cab6a55ad3dc349ac8c70775623c +0 -0
  30. package/.git/objects/09/8fb5a5ff070a1ee3ea11db1a3568af3fea6fa2 +0 -0
  31. package/.git/objects/0d/698432e2c44311c17b845cc63093a898972b95 +0 -0
  32. package/.git/objects/10/ba4a7d64968326293182d571a9c73f5e041fb6 +3 -0
  33. package/.git/objects/12/069a5aa45479564e00749f730582627a276a55 +3 -0
  34. package/.git/objects/14/5ab9cf82c40696a07ab42f117ba199acb2a50b +4 -0
  35. package/.git/objects/17/7b0dc4bf884f8ae0403b4aad053e76baafd632 +2 -0
  36. package/.git/objects/1d/a517ce3527df45a4f28e52ff2c0d9d1c8179f6 +0 -0
  37. package/.git/objects/26/d9a4912af870ce319f5cb5102651d49baac4ab +1 -0
  38. package/.git/objects/27/50076ed23b5211a52ef834f40f183ddecb917a +0 -0
  39. package/.git/objects/2a/96e4bb57fa4bd69c719dca224b17b569e94e82 +2 -0
  40. package/.git/objects/2b/38c26b4ec43b8f5574acb164d2ba64bca8e230 +0 -0
  41. package/.git/objects/2c/61d463bee185f04e7c2bd1d2a15ad1117c589e +0 -0
  42. package/.git/objects/2d/22dbc836cfd75c8d7640ebe5a4fe90bd2c23c6 +0 -0
  43. package/.git/objects/38/0be191ee415827a1217f46626fea4fefba48e5 +0 -0
  44. package/.git/objects/4c/bb28de66d7aaeb4d7737cc2be955adc0c886b5 +0 -0
  45. package/.git/objects/50/150b739272269be2ede552448013eba65323da +0 -0
  46. package/.git/objects/53/2b7b796ffd3223f913a5a5e1e17743ee3591fe +0 -0
  47. package/.git/objects/54/f13d9d62fbedd19b41134ba17153c4328de95b +0 -0
  48. package/.git/objects/5d/4aa0709f62f1bc1fa80251208b570cb3b89d9c +0 -0
  49. package/.git/objects/63/1c43e00d4c34ba914c510f4fe2e6df15b8b06e +0 -0
  50. package/.git/objects/63/9900d13c6182e452e33a3bd638e70a0146c785 +2 -0
  51. package/.git/objects/64/3fa02661c3a1b54205729a75d2fb5f013833af +0 -0
  52. package/.git/objects/6c/59086d862516d2fffa5da2035e5003100fb5c7 +0 -0
  53. package/.git/objects/6c/b74f90a0c799eea1c54a04d8d6a8a9e9691cca +2 -0
  54. package/.git/objects/6d/f39e776d6a89628ce4a005a011911298651635 +0 -0
  55. package/.git/objects/70/0e093acb1c1e55d523507411b7940a01a3bb65 +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 +1 -0
  64. package/.git/objects/87/f31d3df8e7edbf96e45d80126f878b8e0c243f +0 -0
  65. package/.git/objects/8d/d819967bdc8457f04c1b5498bce89380d6552b +7 -0
  66. package/.git/objects/92/608c4e069a4301d466d8d18daecbe7abc9500e +0 -0
  67. package/.git/objects/94/a25f7f4cb416c083d265558da75d457237d671 +0 -0
  68. package/.git/objects/9c/69411050eac81b5dce09314516a30b38c41a20 +3 -0
  69. package/.git/objects/9f/54b5b21769da383f12fb9c7bd364bdb05e13a9 +0 -0
  70. package/.git/objects/a5/886c22eb68b152bb95ec5151504676d8e78ae1 +0 -0
  71. package/.git/objects/a6/582c9510e264f3b46fc3b20597a16923a03523 +0 -0
  72. package/.git/objects/a9/d7db9c0a81b2db47ca92e4e180b30090b27632 +0 -0
  73. package/.git/objects/aa/8ae6a0af7014d738cc551d1ffebeb4e19e6b73 +0 -0
  74. package/.git/objects/ad/c418f9105db9ec488de6831584b82e3929eaef +0 -0
  75. package/.git/objects/ae/14b04cdf65ade0f70577cdea2f85203f4c1bde +0 -0
  76. package/.git/objects/b0/c1c68fbbad6b190434cd2bb0e807796bd56fca +0 -0
  77. package/.git/objects/b1/0f0d0ef3bc5aaf3a91be0b991cb6fe0fcadc40 +0 -0
  78. package/.git/objects/b1/3c15806ef3856ecd8660b0bb36f39830daa3c2 +0 -0
  79. package/.git/objects/b6/3b642cfb4254fc0f7058903abc5b481895c4ef +0 -0
  80. package/.git/objects/b8/a2c461d7ffed9d4ba242c58a52341832b99e0a +0 -0
  81. package/.git/objects/bc/91e0079eb00d56dcde16714748f36a10dbd525 +0 -0
  82. package/.git/objects/c1/beeb895b71b709e48560460199db11b3fc18af +0 -0
  83. package/.git/objects/c5/166c2aeebaeb0a0f7654223c843c50cd4c8953 +0 -0
  84. package/.git/objects/d4/0a2096fc36c1fd9c7a9263c458d5e8a4a5bee7 +0 -0
  85. package/.git/objects/e8/019be9e978a8e2f094e748cbb6ce0c7163adee +0 -0
  86. package/.git/objects/eb/1d744c4e9b47bc902647298424320078e32980 +0 -0
  87. package/.git/objects/ee/15af38be7f3c3862229e59c6b5688f8e0f6099 +0 -0
  88. package/.git/objects/f1/9e0f429f231c34432784f9e33b92ac1d598c17 +0 -0
  89. package/.git/objects/f9/86f2fe82493e85651396b6d5886316d1c890dd +0 -0
  90. package/.git/refs/heads/develop +1 -0
  91. package/.git/refs/remotes/origin/develop +1 -0
  92. package/.git/shallow +1 -0
  93. package/.github/dependabot.yml +10 -0
  94. package/.github/workflows/ci.yml +12 -0
  95. package/.github/workflows/issues.yml +13 -0
  96. package/.github/workflows/publish.yml +20 -0
  97. package/.gitignore +13 -0
  98. package/.idea/.gitignore +10 -0
  99. package/.idea/aws.xml +11 -0
  100. package/.idea/codeStyles/Project.xml +58 -0
  101. package/.idea/codeStyles/codeStyleConfig.xml +5 -0
  102. package/.idea/commons-js.iml +14 -0
  103. package/.idea/inspectionProfiles/Project_Default.xml +7 -0
  104. package/.idea/misc.xml +6 -0
  105. package/.idea/modules.xml +8 -0
  106. package/.idea/prettier.xml +6 -0
  107. package/.idea/vcs.xml +6 -0
  108. package/.npmrc +1 -0
  109. package/.prettierignore +7 -0
  110. package/.prettierrc.cjs +3 -0
  111. package/LICENSE +26 -0
  112. package/README.md +14 -0
  113. package/coverage/base.css +224 -0
  114. package/coverage/bitsnbytes/b64.mts.html +559 -0
  115. package/coverage/bitsnbytes/index.html +131 -0
  116. package/coverage/bitsnbytes/index.mts.html +88 -0
  117. package/coverage/clover.xml +1003 -0
  118. package/coverage/coverage-final.json +15 -0
  119. package/coverage/errors/errors.mts.html +898 -0
  120. package/coverage/errors/index.html +131 -0
  121. package/coverage/errors/index.mts.html +88 -0
  122. package/coverage/favicon.png +0 -0
  123. package/coverage/http/http-method.mts.html +112 -0
  124. package/coverage/http/http-status-code.mts.html +211 -0
  125. package/coverage/http/index.html +146 -0
  126. package/coverage/http/index.mts.html +91 -0
  127. package/coverage/index.html +191 -0
  128. package/coverage/lang/index.html +146 -0
  129. package/coverage/lang/index.mts.html +91 -0
  130. package/coverage/lang/sleep.mts.html +109 -0
  131. package/coverage/lang/type-functions.mts.html +124 -0
  132. package/coverage/oauth/crypto-functions.mts.html +217 -0
  133. package/coverage/oauth/index.html +131 -0
  134. package/coverage/oauth/index.mts.html +88 -0
  135. package/coverage/prettify.css +1 -0
  136. package/coverage/sort-arrow-sprite.png +0 -0
  137. package/coverage/validator/index.html +131 -0
  138. package/coverage/validator/index.mts.html +88 -0
  139. package/coverage/validator/validators.mts.html +1237 -0
  140. package/dist/package.json +72 -0
  141. package/node_modules/@eslint/eslintrc/LICENSE +19 -0
  142. package/node_modules/@eslint/eslintrc/README.md +115 -0
  143. package/node_modules/@eslint/eslintrc/dist/eslintrc-universal.cjs +1104 -0
  144. package/node_modules/@eslint/eslintrc/dist/eslintrc-universal.cjs.map +1 -0
  145. package/node_modules/@eslint/eslintrc/dist/eslintrc.cjs +4344 -0
  146. package/node_modules/@eslint/eslintrc/dist/eslintrc.cjs.map +1 -0
  147. package/node_modules/@eslint/eslintrc/package.json +82 -0
  148. package/node_modules/@eslint/eslintrc/universal.js +9 -0
  149. package/node_modules/@eslint/js/LICENSE +19 -0
  150. package/node_modules/@eslint/js/README.md +57 -0
  151. package/node_modules/@eslint/js/package.json +31 -0
  152. package/node_modules/@eslint/js/src/index.js +17 -0
  153. package/node_modules/@eslint-community/eslint-utils/LICENSE +21 -0
  154. package/node_modules/@eslint-community/eslint-utils/README.md +37 -0
  155. package/node_modules/@eslint-community/eslint-utils/index.js +2068 -0
  156. package/node_modules/@eslint-community/eslint-utils/index.js.map +1 -0
  157. package/node_modules/@eslint-community/eslint-utils/index.mjs +2027 -0
  158. package/node_modules/@eslint-community/eslint-utils/index.mjs.map +1 -0
  159. package/node_modules/@eslint-community/eslint-utils/package.json +73 -0
  160. package/node_modules/@eslint-community/regexpp/LICENSE +21 -0
  161. package/node_modules/@eslint-community/regexpp/README.md +177 -0
  162. package/node_modules/@eslint-community/regexpp/index.d.ts +1065 -0
  163. package/node_modules/@eslint-community/regexpp/index.js +2747 -0
  164. package/node_modules/@eslint-community/regexpp/index.js.map +1 -0
  165. package/node_modules/@eslint-community/regexpp/index.mjs +2737 -0
  166. package/node_modules/@eslint-community/regexpp/index.mjs.map +1 -0
  167. package/node_modules/@eslint-community/regexpp/package.json +93 -0
  168. package/node_modules/@types/node/LICENSE +21 -0
  169. package/node_modules/@types/node/README.md +15 -0
  170. package/node_modules/@types/node/package.json +217 -0
  171. package/node_modules/@typescript-eslint/eslint-plugin/LICENSE +21 -0
  172. package/node_modules/@typescript-eslint/eslint-plugin/README.md +10 -0
  173. package/node_modules/@typescript-eslint/eslint-plugin/dist/index.js +23 -0
  174. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/README.md +23 -0
  175. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/TEMPLATE.md +26 -0
  176. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/adjacent-overload-signatures.md +93 -0
  177. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/array-type.md +103 -0
  178. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/await-thenable.md +40 -0
  179. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/ban-ts-comment.md +148 -0
  180. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/ban-tslint-comment.md +39 -0
  181. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/ban-types.md +183 -0
  182. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/block-spacing.md +12 -0
  183. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/brace-style.md +12 -0
  184. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/camelcase.md +10 -0
  185. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/class-literal-property-style.md +114 -0
  186. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/comma-dangle.md +22 -0
  187. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/comma-spacing.md +12 -0
  188. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/consistent-generic-constructors.md +73 -0
  189. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/consistent-indexed-object-style.md +80 -0
  190. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/consistent-type-assertions.md +108 -0
  191. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/consistent-type-definitions.md +82 -0
  192. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/consistent-type-exports.md +100 -0
  193. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/consistent-type-imports.md +105 -0
  194. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/default-param-last.md +48 -0
  195. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/dot-notation.md +77 -0
  196. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/explicit-function-return-type.md +319 -0
  197. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/explicit-member-accessibility.md +331 -0
  198. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/explicit-module-boundary-types.md +250 -0
  199. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/func-call-spacing.md +12 -0
  200. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/indent.md +20 -0
  201. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/init-declarations.md +12 -0
  202. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/key-spacing.md +12 -0
  203. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/keyword-spacing.md +12 -0
  204. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/lines-around-comment.md +37 -0
  205. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/lines-between-class-members.md +63 -0
  206. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/member-delimiter-style.md +161 -0
  207. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/member-ordering.md +1360 -0
  208. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/method-signature-style.md +110 -0
  209. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/naming-convention.md +706 -0
  210. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-array-constructor.md +35 -0
  211. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-base-to-string.md +88 -0
  212. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-confusing-non-null-assertion.md +56 -0
  213. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-confusing-void-expression.md +116 -0
  214. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-dupe-class-members.md +12 -0
  215. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-duplicate-enum-values.md +50 -0
  216. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-duplicate-imports.md +12 -0
  217. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-duplicate-type-constituents.md +61 -0
  218. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-dynamic-delete.md +53 -0
  219. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-empty-function.md +88 -0
  220. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-empty-interface.md +70 -0
  221. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-explicit-any.md +174 -0
  222. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-extra-non-null-assertion.md +52 -0
  223. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-extra-parens.md +12 -0
  224. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-extra-semi.md +12 -0
  225. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-extraneous-class.md +294 -0
  226. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-floating-promises.md +106 -0
  227. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-for-in-array.md +56 -0
  228. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-implicit-any-catch.md +73 -0
  229. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-implied-eval.md +101 -0
  230. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-import-type-side-effects.md +75 -0
  231. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-inferrable-types.md +103 -0
  232. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-invalid-this.md +12 -0
  233. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-invalid-void-type.md +113 -0
  234. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-loop-func.md +12 -0
  235. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-loss-of-precision.md +12 -0
  236. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-magic-numbers.md +131 -0
  237. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-meaningless-void-operator.md +47 -0
  238. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-misused-new.md +46 -0
  239. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-misused-promises.md +245 -0
  240. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-mixed-enums.md +88 -0
  241. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-namespace.md +129 -0
  242. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-non-null-asserted-nullish-coalescing.md +49 -0
  243. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-non-null-asserted-optional-chain.md +35 -0
  244. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-non-null-assertion.md +42 -0
  245. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-parameter-properties.md +406 -0
  246. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-redeclare.md +73 -0
  247. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-redundant-type-constituents.md +78 -0
  248. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-require-imports.md +37 -0
  249. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-restricted-imports.md +63 -0
  250. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-shadow.md +101 -0
  251. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-this-alias.md +38 -0
  252. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-throw-literal.md +111 -0
  253. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-type-alias.md +602 -0
  254. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unnecessary-boolean-literal-compare.md +133 -0
  255. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unnecessary-condition.md +103 -0
  256. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unnecessary-qualifier.md +51 -0
  257. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unnecessary-type-arguments.md +73 -0
  258. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unnecessary-type-assertion.md +77 -0
  259. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unnecessary-type-constraint.md +55 -0
  260. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unsafe-argument.md +83 -0
  261. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unsafe-assignment.md +86 -0
  262. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unsafe-call.md +58 -0
  263. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unsafe-declaration-merging.md +54 -0
  264. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unsafe-enum-comparison.md +75 -0
  265. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unsafe-member-access.md +64 -0
  266. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unsafe-return.md +103 -0
  267. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unused-expressions.md +12 -0
  268. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unused-vars.md +12 -0
  269. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-use-before-define.md +97 -0
  270. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-useless-constructor.md +21 -0
  271. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-useless-empty-export.md +43 -0
  272. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-var-requires.md +37 -0
  273. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/non-nullable-type-assertion-style.md +41 -0
  274. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/object-curly-spacing.md +12 -0
  275. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/padding-line-between-statements.md +35 -0
  276. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/parameter-properties.md +485 -0
  277. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-as-const.md +44 -0
  278. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-enum-initializers.md +62 -0
  279. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-for-of.md +46 -0
  280. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-function-type.md +92 -0
  281. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-includes.md +77 -0
  282. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-literal-enum-member.md +101 -0
  283. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-namespace-keyword.md +47 -0
  284. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-nullish-coalescing.md +164 -0
  285. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-optional-chain.md +71 -0
  286. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-readonly-parameter-types.md +268 -0
  287. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-readonly.md +87 -0
  288. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-reduce-type-parameter.md +58 -0
  289. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-regexp-exec.md +46 -0
  290. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-return-this-type.md +87 -0
  291. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-string-starts-ends-with.md +57 -0
  292. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-ts-expect-error.md +69 -0
  293. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/promise-function-async.md +59 -0
  294. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/quotes.md +12 -0
  295. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/require-array-sort-compare.md +78 -0
  296. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/require-await.md +24 -0
  297. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/restrict-plus-operands.md +208 -0
  298. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/restrict-template-expressions.md +117 -0
  299. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/return-await.md +216 -0
  300. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/semi.md +16 -0
  301. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/sort-type-constituents.md +101 -0
  302. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/sort-type-union-intersection-members.md +106 -0
  303. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/space-before-blocks.md +42 -0
  304. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/space-before-function-paren.md +12 -0
  305. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/space-infix-ops.md +16 -0
  306. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/strict-boolean-expressions.md +183 -0
  307. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/switch-exhaustiveness-check.md +106 -0
  308. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/triple-slash-reference.md +61 -0
  309. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/type-annotation-spacing.md +303 -0
  310. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/typedef.md +320 -0
  311. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/unbound-method.md +103 -0
  312. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/unified-signatures.md +70 -0
  313. package/node_modules/@typescript-eslint/eslint-plugin/index.d.ts +4 -0
  314. package/node_modules/@typescript-eslint/eslint-plugin/package.json +87 -0
  315. package/node_modules/@typescript-eslint/parser/LICENSE +22 -0
  316. package/node_modules/@typescript-eslint/parser/README.md +10 -0
  317. package/node_modules/@typescript-eslint/parser/dist/index.js +17 -0
  318. package/node_modules/@typescript-eslint/parser/package.json +75 -0
  319. package/node_modules/@typescript-eslint/scope-manager/LICENSE +21 -0
  320. package/node_modules/@typescript-eslint/scope-manager/README.md +8 -0
  321. package/node_modules/@typescript-eslint/scope-manager/dist/index.js +31 -0
  322. package/node_modules/@typescript-eslint/scope-manager/package.json +67 -0
  323. package/node_modules/@typescript-eslint/type-utils/LICENSE +21 -0
  324. package/node_modules/@typescript-eslint/type-utils/README.md +12 -0
  325. package/node_modules/@typescript-eslint/type-utils/dist/index.js +36 -0
  326. package/node_modules/@typescript-eslint/type-utils/package.json +71 -0
  327. package/node_modules/@typescript-eslint/types/LICENSE +21 -0
  328. package/node_modules/@typescript-eslint/types/README.md +12 -0
  329. package/node_modules/@typescript-eslint/types/dist/index.js +24 -0
  330. package/node_modules/@typescript-eslint/types/package.json +84 -0
  331. package/node_modules/@typescript-eslint/typescript-estree/LICENSE +26 -0
  332. package/node_modules/@typescript-eslint/typescript-estree/README.md +10 -0
  333. package/node_modules/@typescript-eslint/typescript-estree/dist/index.js +38 -0
  334. package/node_modules/@typescript-eslint/typescript-estree/package.json +85 -0
  335. package/node_modules/@typescript-eslint/utils/LICENSE +21 -0
  336. package/node_modules/@typescript-eslint/utils/README.md +10 -0
  337. package/node_modules/@typescript-eslint/utils/dist/index.js +41 -0
  338. package/node_modules/@typescript-eslint/utils/package.json +70 -0
  339. package/node_modules/@typescript-eslint/visitor-keys/LICENSE +21 -0
  340. package/node_modules/@typescript-eslint/visitor-keys/README.md +10 -0
  341. package/node_modules/@typescript-eslint/visitor-keys/dist/index.js +8 -0
  342. package/node_modules/@typescript-eslint/visitor-keys/package.json +60 -0
  343. package/node_modules/@vitest/coverage-v8/LICENSE +21 -0
  344. package/node_modules/@vitest/coverage-v8/dist/index.js +54 -0
  345. package/node_modules/@vitest/coverage-v8/package.json +72 -0
  346. package/package.json +6 -6
  347. package/pnpm-lock.yaml +3277 -0
  348. package/src/bitsnbytes/b64.mts +158 -0
  349. package/src/bitsnbytes/b64.test.mts +78 -0
  350. package/src/bitsnbytes/index.mts +1 -0
  351. package/src/errors/errors.mts +271 -0
  352. package/src/errors/errors.test.mts +74 -0
  353. package/src/errors/index.mts +1 -0
  354. package/src/http/http-method.mts +9 -0
  355. package/src/http/http-status-code.mts +42 -0
  356. package/src/http/index.mts +2 -0
  357. package/src/lang/index.mts +2 -0
  358. package/src/lang/sleep.mts +8 -0
  359. package/src/lang/type-functions.mts +13 -0
  360. package/src/oauth/crypto-functions.mts +44 -0
  361. package/src/oauth/crypto-functions.test.mts +48 -0
  362. package/src/oauth/index.mts +1 -0
  363. package/src/validator/index.mts +1 -0
  364. package/src/validator/validators.mts +384 -0
  365. package/src/validator/validators.test.mts +245 -0
  366. package/tsconfig.json +18 -0
  367. /package/{bitsnbytes → dist/bitsnbytes}/b64.d.mts +0 -0
  368. /package/{bitsnbytes → dist/bitsnbytes}/b64.d.mts.map +0 -0
  369. /package/{bitsnbytes → dist/bitsnbytes}/b64.mjs +0 -0
  370. /package/{bitsnbytes → dist/bitsnbytes}/b64.mjs.map +0 -0
  371. /package/{bitsnbytes → dist/bitsnbytes}/b64.test.d.mts +0 -0
  372. /package/{bitsnbytes → dist/bitsnbytes}/b64.test.d.mts.map +0 -0
  373. /package/{bitsnbytes → dist/bitsnbytes}/b64.test.mjs +0 -0
  374. /package/{bitsnbytes → dist/bitsnbytes}/b64.test.mjs.map +0 -0
  375. /package/{bitsnbytes → dist/bitsnbytes}/index.d.mts +0 -0
  376. /package/{bitsnbytes → dist/bitsnbytes}/index.d.mts.map +0 -0
  377. /package/{bitsnbytes → dist/bitsnbytes}/index.mjs +0 -0
  378. /package/{bitsnbytes → dist/bitsnbytes}/index.mjs.map +0 -0
  379. /package/{errors → dist/errors}/errors.d.mts +0 -0
  380. /package/{errors → dist/errors}/errors.d.mts.map +0 -0
  381. /package/{errors → dist/errors}/errors.mjs +0 -0
  382. /package/{errors → dist/errors}/errors.mjs.map +0 -0
  383. /package/{errors → dist/errors}/errors.test.d.mts +0 -0
  384. /package/{errors → dist/errors}/errors.test.d.mts.map +0 -0
  385. /package/{errors → dist/errors}/errors.test.mjs +0 -0
  386. /package/{errors → dist/errors}/errors.test.mjs.map +0 -0
  387. /package/{errors → dist/errors}/index.d.mts +0 -0
  388. /package/{errors → dist/errors}/index.d.mts.map +0 -0
  389. /package/{errors → dist/errors}/index.mjs +0 -0
  390. /package/{errors → dist/errors}/index.mjs.map +0 -0
  391. /package/{http → dist/http}/http-method.d.mts +0 -0
  392. /package/{http → dist/http}/http-method.d.mts.map +0 -0
  393. /package/{http → dist/http}/http-method.mjs +0 -0
  394. /package/{http → dist/http}/http-method.mjs.map +0 -0
  395. /package/{http → dist/http}/http-status-code.d.mts +0 -0
  396. /package/{http → dist/http}/http-status-code.d.mts.map +0 -0
  397. /package/{http → dist/http}/http-status-code.mjs +0 -0
  398. /package/{http → dist/http}/http-status-code.mjs.map +0 -0
  399. /package/{http → dist/http}/index.d.mts +0 -0
  400. /package/{http → dist/http}/index.d.mts.map +0 -0
  401. /package/{http → dist/http}/index.mjs +0 -0
  402. /package/{http → dist/http}/index.mjs.map +0 -0
  403. /package/{lang → dist/lang}/index.d.mts +0 -0
  404. /package/{lang → dist/lang}/index.d.mts.map +0 -0
  405. /package/{lang → dist/lang}/index.mjs +0 -0
  406. /package/{lang → dist/lang}/index.mjs.map +0 -0
  407. /package/{lang → dist/lang}/sleep.d.mts +0 -0
  408. /package/{lang → dist/lang}/sleep.d.mts.map +0 -0
  409. /package/{lang → dist/lang}/sleep.mjs +0 -0
  410. /package/{lang → dist/lang}/sleep.mjs.map +0 -0
  411. /package/{lang → dist/lang}/type-functions.d.mts +0 -0
  412. /package/{lang → dist/lang}/type-functions.d.mts.map +0 -0
  413. /package/{lang → dist/lang}/type-functions.mjs +0 -0
  414. /package/{lang → dist/lang}/type-functions.mjs.map +0 -0
  415. /package/{oauth → dist/oauth}/crypto-functions.d.mts +0 -0
  416. /package/{oauth → dist/oauth}/crypto-functions.d.mts.map +0 -0
  417. /package/{oauth → dist/oauth}/crypto-functions.mjs +0 -0
  418. /package/{oauth → dist/oauth}/crypto-functions.mjs.map +0 -0
  419. /package/{oauth → dist/oauth}/crypto-functions.test.d.mts +0 -0
  420. /package/{oauth → dist/oauth}/crypto-functions.test.d.mts.map +0 -0
  421. /package/{oauth → dist/oauth}/crypto-functions.test.mjs +0 -0
  422. /package/{oauth → dist/oauth}/crypto-functions.test.mjs.map +0 -0
  423. /package/{oauth → dist/oauth}/index.d.mts +0 -0
  424. /package/{oauth → dist/oauth}/index.d.mts.map +0 -0
  425. /package/{oauth → dist/oauth}/index.mjs +0 -0
  426. /package/{oauth → dist/oauth}/index.mjs.map +0 -0
  427. /package/{validator → dist/validator}/index.d.mts +0 -0
  428. /package/{validator → dist/validator}/index.d.mts.map +0 -0
  429. /package/{validator → dist/validator}/index.mjs +0 -0
  430. /package/{validator → dist/validator}/index.mjs.map +0 -0
  431. /package/{validator → dist/validator}/validators.d.mts +0 -0
  432. /package/{validator → dist/validator}/validators.d.mts.map +0 -0
  433. /package/{validator → dist/validator}/validators.mjs +0 -0
  434. /package/{validator → dist/validator}/validators.mjs.map +0 -0
  435. /package/{validator → dist/validator}/validators.test.d.mts +0 -0
  436. /package/{validator → dist/validator}/validators.test.d.mts.map +0 -0
  437. /package/{validator → dist/validator}/validators.test.mjs +0 -0
  438. /package/{validator → dist/validator}/validators.test.mjs.map +0 -0
@@ -0,0 +1,485 @@
1
+ ---
2
+ description: 'Require or disallow parameter properties in class constructors.'
3
+ ---
4
+
5
+ > 🛑 This file is source code, not the primary documentation location! 🛑
6
+ >
7
+ > See **https://typescript-eslint.io/rules/parameter-properties** for documentation.
8
+
9
+ TypeScript includes a "parameter properties" shorthand for declaring a class constructor parameter and class property in one location.
10
+ Parameter properties can be confusing to those new to TypeScript as they are less explicit than other ways of declaring and initializing class members.
11
+
12
+ This rule can be configured to always disallow the use of parameter properties or enforce their usage when possible.
13
+
14
+ ## Options
15
+
16
+ This rule, in its default state, does not require any argument and would completely disallow the use of parameter properties.
17
+ It may take an options object containing either or both of:
18
+
19
+ - `"allow"`: allowing certain kinds of properties to be ignored
20
+ - `"prefer"`: either `"class-property"` _(default)_ or `"parameter-property"`
21
+
22
+ ### `"allow"`
23
+
24
+ If you would like to ignore certain kinds of properties then you may pass an object containing `"allow"` as an array of any of the following options:
25
+
26
+ - `allow`, an array containing one or more of the allowed modifiers. Valid values are:
27
+ - `readonly`, allows **readonly** parameter properties.
28
+ - `private`, allows **private** parameter properties.
29
+ - `protected`, allows **protected** parameter properties.
30
+ - `public`, allows **public** parameter properties.
31
+ - `private readonly`, allows **private readonly** parameter properties.
32
+ - `protected readonly`, allows **protected readonly** parameter properties.
33
+ - `public readonly`, allows **public readonly** parameter properties.
34
+
35
+ For example, to ignore `public` properties:
36
+
37
+ ```json
38
+ {
39
+ "@typescript-eslint/parameter-properties": [
40
+ true,
41
+ {
42
+ "allow": ["public"]
43
+ }
44
+ ]
45
+ }
46
+ ```
47
+
48
+ ### `"prefer"`
49
+
50
+ By default, the rule prefers class property (`"class-property"`).
51
+ You can switch it to instead preferring parameter property with (`"parameter-property"`).
52
+
53
+ In `"parameter-property"` mode, the rule will issue a report when:
54
+
55
+ - A class property and constructor parameter have the same name and type
56
+ - The constructor parameter is assigned to the class property at the beginning of the constructor
57
+
58
+ ### default
59
+
60
+ Examples of code for this rule with no options at all:
61
+
62
+ <!--tabs-->
63
+
64
+ #### ❌ Incorrect
65
+
66
+ ```ts
67
+ class Foo {
68
+ constructor(readonly name: string) {}
69
+ }
70
+
71
+ class Foo {
72
+ constructor(private name: string) {}
73
+ }
74
+
75
+ class Foo {
76
+ constructor(protected name: string) {}
77
+ }
78
+
79
+ class Foo {
80
+ constructor(public name: string) {}
81
+ }
82
+
83
+ class Foo {
84
+ constructor(private readonly name: string) {}
85
+ }
86
+
87
+ class Foo {
88
+ constructor(protected readonly name: string) {}
89
+ }
90
+
91
+ class Foo {
92
+ constructor(public readonly name: string) {}
93
+ }
94
+ ```
95
+
96
+ #### ✅ Correct
97
+
98
+ ```ts
99
+ class Foo {
100
+ constructor(name: string) {}
101
+ }
102
+ ```
103
+
104
+ ### readonly
105
+
106
+ Examples of code for the `{ "allow": ["readonly"] }` options:
107
+
108
+ <!--tabs-->
109
+
110
+ #### ❌ Incorrect
111
+
112
+ ```ts
113
+ class Foo {
114
+ constructor(private name: string) {}
115
+ }
116
+
117
+ class Foo {
118
+ constructor(protected name: string) {}
119
+ }
120
+
121
+ class Foo {
122
+ constructor(public name: string) {}
123
+ }
124
+
125
+ class Foo {
126
+ constructor(private readonly name: string) {}
127
+ }
128
+
129
+ class Foo {
130
+ constructor(protected readonly name: string) {}
131
+ }
132
+
133
+ class Foo {
134
+ constructor(public readonly name: string) {}
135
+ }
136
+ ```
137
+
138
+ #### ✅ Correct
139
+
140
+ ```ts
141
+ class Foo {
142
+ constructor(name: string) {}
143
+ }
144
+
145
+ class Foo {
146
+ constructor(readonly name: string) {}
147
+ }
148
+ ```
149
+
150
+ ### private
151
+
152
+ Examples of code for the `{ "allow": ["private"] }` options:
153
+
154
+ <!--tabs-->
155
+
156
+ #### ❌ Incorrect
157
+
158
+ ```ts
159
+ class Foo {
160
+ constructor(readonly name: string) {}
161
+ }
162
+
163
+ class Foo {
164
+ constructor(protected name: string) {}
165
+ }
166
+
167
+ class Foo {
168
+ constructor(public name: string) {}
169
+ }
170
+
171
+ class Foo {
172
+ constructor(private readonly name: string) {}
173
+ }
174
+
175
+ class Foo {
176
+ constructor(protected readonly name: string) {}
177
+ }
178
+
179
+ class Foo {
180
+ constructor(public readonly name: string) {}
181
+ }
182
+ ```
183
+
184
+ #### ✅ Correct
185
+
186
+ ```ts
187
+ class Foo {
188
+ constructor(name: string) {}
189
+ }
190
+
191
+ class Foo {
192
+ constructor(private name: string) {}
193
+ }
194
+ ```
195
+
196
+ ### protected
197
+
198
+ Examples of code for the `{ "allow": ["protected"] }` options:
199
+
200
+ <!--tabs-->
201
+
202
+ #### ❌ Incorrect
203
+
204
+ ```ts
205
+ class Foo {
206
+ constructor(readonly name: string) {}
207
+ }
208
+
209
+ class Foo {
210
+ constructor(private name: string) {}
211
+ }
212
+
213
+ class Foo {
214
+ constructor(public name: string) {}
215
+ }
216
+
217
+ class Foo {
218
+ constructor(private readonly name: string) {}
219
+ }
220
+
221
+ class Foo {
222
+ constructor(protected readonly name: string) {}
223
+ }
224
+
225
+ class Foo {
226
+ constructor(public readonly name: string) {}
227
+ }
228
+ ```
229
+
230
+ #### ✅ Correct
231
+
232
+ ```ts
233
+ class Foo {
234
+ constructor(name: string) {}
235
+ }
236
+
237
+ class Foo {
238
+ constructor(protected name: string) {}
239
+ }
240
+ ```
241
+
242
+ ### public
243
+
244
+ Examples of code for the `{ "allow": ["public"] }` options:
245
+
246
+ <!--tabs-->
247
+
248
+ #### ❌ Incorrect
249
+
250
+ ```ts
251
+ class Foo {
252
+ constructor(readonly name: string) {}
253
+ }
254
+
255
+ class Foo {
256
+ constructor(private name: string) {}
257
+ }
258
+
259
+ class Foo {
260
+ constructor(protected name: string) {}
261
+ }
262
+
263
+ class Foo {
264
+ constructor(private readonly name: string) {}
265
+ }
266
+
267
+ class Foo {
268
+ constructor(protected readonly name: string) {}
269
+ }
270
+
271
+ class Foo {
272
+ constructor(public readonly name: string) {}
273
+ }
274
+ ```
275
+
276
+ #### ✅ Correct
277
+
278
+ ```ts
279
+ class Foo {
280
+ constructor(name: string) {}
281
+ }
282
+
283
+ class Foo {
284
+ constructor(public name: string) {}
285
+ }
286
+ ```
287
+
288
+ ### private readonly
289
+
290
+ Examples of code for the `{ "allow": ["private readonly"] }` options:
291
+
292
+ <!--tabs-->
293
+
294
+ #### ❌ Incorrect
295
+
296
+ ```ts
297
+ class Foo {
298
+ constructor(readonly name: string) {}
299
+ }
300
+
301
+ class Foo {
302
+ constructor(private name: string) {}
303
+ }
304
+
305
+ class Foo {
306
+ constructor(protected name: string) {}
307
+ }
308
+
309
+ class Foo {
310
+ constructor(public name: string) {}
311
+ }
312
+
313
+ class Foo {
314
+ constructor(protected readonly name: string) {}
315
+ }
316
+
317
+ class Foo {
318
+ constructor(public readonly name: string) {}
319
+ }
320
+ ```
321
+
322
+ #### ✅ Correct
323
+
324
+ ```ts
325
+ class Foo {
326
+ constructor(name: string) {}
327
+ }
328
+
329
+ class Foo {
330
+ constructor(private readonly name: string) {}
331
+ }
332
+ ```
333
+
334
+ ### protected readonly
335
+
336
+ Examples of code for the `{ "allow": ["protected readonly"] }` options:
337
+
338
+ <!--tabs-->
339
+
340
+ #### ❌ Incorrect
341
+
342
+ ```ts
343
+ class Foo {
344
+ constructor(readonly name: string) {}
345
+ }
346
+
347
+ class Foo {
348
+ constructor(private name: string) {}
349
+ }
350
+
351
+ class Foo {
352
+ constructor(protected name: string) {}
353
+ }
354
+
355
+ class Foo {
356
+ constructor(public name: string) {}
357
+ }
358
+
359
+ class Foo {
360
+ constructor(private readonly name: string) {}
361
+ }
362
+
363
+ class Foo {
364
+ constructor(public readonly name: string) {}
365
+ }
366
+ ```
367
+
368
+ #### ✅ Correct
369
+
370
+ ```ts
371
+ class Foo {
372
+ constructor(name: string) {}
373
+ }
374
+
375
+ class Foo {
376
+ constructor(protected readonly name: string) {}
377
+ }
378
+ ```
379
+
380
+ ### public readonly
381
+
382
+ Examples of code for the `{ "allow": ["public readonly"] }` options:
383
+
384
+ <!--tabs-->
385
+
386
+ #### ❌ Incorrect
387
+
388
+ ```ts
389
+ class Foo {
390
+ constructor(readonly name: string) {}
391
+ }
392
+
393
+ class Foo {
394
+ constructor(private name: string) {}
395
+ }
396
+
397
+ class Foo {
398
+ constructor(protected name: string) {}
399
+ }
400
+
401
+ class Foo {
402
+ constructor(public name: string) {}
403
+ }
404
+
405
+ class Foo {
406
+ constructor(private readonly name: string) {}
407
+ }
408
+
409
+ class Foo {
410
+ constructor(protected readonly name: string) {}
411
+ }
412
+ ```
413
+
414
+ #### ✅ Correct
415
+
416
+ ```ts
417
+ class Foo {
418
+ constructor(name: string) {}
419
+ }
420
+
421
+ class Foo {
422
+ constructor(public readonly name: string) {}
423
+ }
424
+ ```
425
+
426
+ ### `"parameter-property"`
427
+
428
+ Examples of code for the `{ "prefer": "parameter-property" }` option:
429
+
430
+ <!--tabs-->
431
+
432
+ #### ❌ Incorrect
433
+
434
+ ```ts
435
+ class Foo {
436
+ private name: string;
437
+ constructor(name: string) {
438
+ this.name = name;
439
+ }
440
+ }
441
+
442
+ class Foo {
443
+ public readonly name: string;
444
+ constructor(name: string) {
445
+ this.name = name;
446
+ }
447
+ }
448
+
449
+ class Foo {
450
+ constructor(name: string) {
451
+ this.name = name;
452
+ }
453
+ name: string;
454
+ }
455
+ ```
456
+
457
+ #### ✅ Correct
458
+
459
+ ```ts
460
+ class Foo {
461
+ private differentName: string;
462
+ constructor(name: string) {
463
+ this.differentName = name;
464
+ }
465
+ }
466
+
467
+ class Foo {
468
+ private differentType: number | undefined;
469
+ constructor(differentType: number) {
470
+ this.differentType = differentType;
471
+ }
472
+ }
473
+
474
+ class Foo {
475
+ protected logicInConstructor: string;
476
+ constructor(logicInConstructor: string) {
477
+ console.log('Hello, world!');
478
+ this.logicInConstructor = logicInConstructor;
479
+ }
480
+ }
481
+ ```
482
+
483
+ ## When Not To Use It
484
+
485
+ If you don't care about the using parameter properties in constructors, then you will not need this rule.
@@ -0,0 +1,44 @@
1
+ ---
2
+ description: 'Enforce the use of `as const` over literal type.'
3
+ ---
4
+
5
+ > 🛑 This file is source code, not the primary documentation location! 🛑
6
+ >
7
+ > See **https://typescript-eslint.io/rules/prefer-as-const** for documentation.
8
+
9
+ There are two common ways to tell TypeScript that a literal value should be interpreted as its literal type (e.g. `2`) rather than general primitive type (e.g. `number`);
10
+
11
+ - `as const`: telling TypeScript to infer the literal type automatically
12
+ - `as` with the literal type: explicitly telling the literal type to TypeScript
13
+
14
+ `as const` is generally preferred, as it doesn't require re-typing the literal value.
15
+ This rule reports when an `as` with an explicit literal type can be replaced with an `as const`.
16
+
17
+ ## Examples
18
+
19
+ <!--tabs-->
20
+
21
+ ### ❌ Incorrect
22
+
23
+ ```ts
24
+ let bar: 2 = 2;
25
+ let foo = <'bar'>'bar';
26
+ let foo = { bar: 'baz' as 'baz' };
27
+ ```
28
+
29
+ ### ✅ Correct
30
+
31
+ ```ts
32
+ let foo = 'bar';
33
+ let foo = 'bar' as const;
34
+ let foo: 'bar' = 'bar' as const;
35
+ let bar = 'bar' as string;
36
+ let foo = <string>'bar';
37
+ let foo = { bar: 'baz' };
38
+ ```
39
+
40
+ <!--/tabs-->
41
+
42
+ ## When Not To Use It
43
+
44
+ If you are using TypeScript < 3.4
@@ -0,0 +1,62 @@
1
+ ---
2
+ description: 'Require each enum member value to be explicitly initialized.'
3
+ ---
4
+
5
+ > 🛑 This file is source code, not the primary documentation location! 🛑
6
+ >
7
+ > See **https://typescript-eslint.io/rules/prefer-enum-initializers** for documentation.
8
+
9
+ TypeScript `enum`s are a practical way to organize semantically related constant values.
10
+ Members of `enum`s that don't have explicit values are by default given sequentially increasing numbers.
11
+
12
+ In projects where the value of `enum` members are important, allowing implicit values for enums can cause bugs if `enum`s are modified over time.
13
+
14
+ This rule recommends having each `enum` member value explicitly initialized.
15
+
16
+ ## Examples
17
+
18
+ <!--tabs-->
19
+
20
+ ### ❌ Incorrect
21
+
22
+ ```ts
23
+ enum Status {
24
+ Open = 1,
25
+ Close,
26
+ }
27
+
28
+ enum Direction {
29
+ Up,
30
+ Down,
31
+ }
32
+
33
+ enum Color {
34
+ Red,
35
+ Green = 'Green'
36
+ Blue = 'Blue',
37
+ }
38
+ ```
39
+
40
+ ### ✅ Correct
41
+
42
+ ```ts
43
+ enum Status {
44
+ Open = 'Open',
45
+ Close = 'Close',
46
+ }
47
+
48
+ enum Direction {
49
+ Up = 1,
50
+ Down = 2,
51
+ }
52
+
53
+ enum Color {
54
+ Red = 'Red',
55
+ Green = 'Green',
56
+ Blue = 'Blue',
57
+ }
58
+ ```
59
+
60
+ ## When Not To Use It
61
+
62
+ If you don't care about `enum`s having implicit values you can safely disable this rule.
@@ -0,0 +1,46 @@
1
+ ---
2
+ description: 'Enforce the use of `for-of` loop over the standard `for` loop where possible.'
3
+ ---
4
+
5
+ > 🛑 This file is source code, not the primary documentation location! 🛑
6
+ >
7
+ > See **https://typescript-eslint.io/rules/prefer-for-of** for documentation.
8
+
9
+ Many developers default to writing `for (let i = 0; i < ...` loops to iterate over arrays.
10
+ However, in many of those arrays, the loop iterator variable (e.g. `i`) is only used to access the respective element of the array.
11
+ In those cases, a `for-of` loop is easier to read and write.
12
+
13
+ This rule recommends a for-of loop when the loop index is only used to read from an array that is being iterated.
14
+
15
+ ## Examples
16
+
17
+ <!--tabs-->
18
+
19
+ ### ❌ Incorrect
20
+
21
+ ```js
22
+ declare const array: string[];
23
+
24
+ for (let i = 0; i < array.length; i++) {
25
+ console.log(array[i]);
26
+ }
27
+ ```
28
+
29
+ ### ✅ Correct
30
+
31
+ ```js
32
+ declare const array: string[];
33
+
34
+ for (const x of array) {
35
+ console.log(x);
36
+ }
37
+
38
+ for (let i = 0; i < array.length; i++) {
39
+ // i is used, so for-of could not be used.
40
+ console.log(i, array[i]);
41
+ }
42
+ ```
43
+
44
+ ## When Not To Use It
45
+
46
+ If you transpile for browsers that do not support for-of loops, you may wish to use traditional for loops that produce more compact code.
@@ -0,0 +1,92 @@
1
+ ---
2
+ description: 'Enforce using function types instead of interfaces with call signatures.'
3
+ ---
4
+
5
+ > 🛑 This file is source code, not the primary documentation location! 🛑
6
+ >
7
+ > See **https://typescript-eslint.io/rules/prefer-function-type** for documentation.
8
+
9
+ TypeScript allows for two common ways to declare a type for a function:
10
+
11
+ - Function type: `() => string`
12
+ - Object type with a signature: `{ (): string }`
13
+
14
+ The function type form is generally preferred when possible for being more succinct.
15
+
16
+ This rule suggests using a function type instead of an interface or object type literal with a single call signature.
17
+
18
+ ## Examples
19
+
20
+ <!--tabs-->
21
+
22
+ ### ❌ Incorrect
23
+
24
+ ```ts
25
+ interface Example {
26
+ (): string;
27
+ }
28
+ ```
29
+
30
+ ```ts
31
+ function foo(example: { (): number }): number {
32
+ return example();
33
+ }
34
+ ```
35
+
36
+ ```ts
37
+ interface ReturnsSelf {
38
+ // returns the function itself, not the `this` argument.
39
+ (arg: string): this;
40
+ }
41
+ ```
42
+
43
+ ### ✅ Correct
44
+
45
+ ```ts
46
+ type Example = () => string;
47
+ ```
48
+
49
+ ```ts
50
+ function foo(example: () => number): number {
51
+ return bar();
52
+ }
53
+ ```
54
+
55
+ ```ts
56
+ // returns the function itself, not the `this` argument.
57
+ type ReturnsSelf = (arg: string) => ReturnsSelf;
58
+ ```
59
+
60
+ ```ts
61
+ function foo(bar: { (): string; baz: number }): string {
62
+ return bar();
63
+ }
64
+ ```
65
+
66
+ ```ts
67
+ interface Foo {
68
+ bar: string;
69
+ }
70
+ interface Bar extends Foo {
71
+ (): void;
72
+ }
73
+ ```
74
+
75
+ ```ts
76
+ // multiple call signatures (overloads) is allowed:
77
+ interface Overloaded {
78
+ (data: string): number;
79
+ (id: number): string;
80
+ }
81
+ // this is equivelent to Overloaded interface.
82
+ type Intersection = ((data: string) => number) & ((id: number) => string);
83
+ ```
84
+
85
+ ## When Not To Use It
86
+
87
+ If you specifically want to use an interface or type literal with a single call signature for stylistic reasons, you can disable this rule.
88
+
89
+ This rule has a known edge case of sometimes triggering on global augmentations such as `interface Function`.
90
+ These edge cases are rare and often symptomatic of odd code.
91
+ We recommend you use an [inline ESLint disable comment](https://eslint.org/docs/latest/use/configure/rules#using-configuration-comments-1).
92
+ See [#454](https://github.com/typescript-eslint/typescript-eslint/issues/454) for details.