@nr1e/commons 0.1.1 → 0.1.3-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.
- package/package.json +1 -1
- package/.editorconfig +0 -19
- package/.eslintignore +0 -3
- package/.eslintrc.json +0 -4
- package/.git/COMMIT_EDITMSG +0 -5
- package/.git/FETCH_HEAD +0 -1
- package/.git/HEAD +0 -1
- package/.git/config +0 -18
- package/.git/config.worktree +0 -5
- package/.git/description +0 -1
- package/.git/hooks/applypatch-msg.sample +0 -15
- package/.git/hooks/commit-msg.sample +0 -24
- package/.git/hooks/fsmonitor-watchman.sample +0 -174
- package/.git/hooks/post-update.sample +0 -8
- package/.git/hooks/pre-applypatch.sample +0 -14
- package/.git/hooks/pre-commit.sample +0 -49
- package/.git/hooks/pre-merge-commit.sample +0 -13
- package/.git/hooks/pre-push.sample +0 -53
- package/.git/hooks/pre-rebase.sample +0 -169
- package/.git/hooks/pre-receive.sample +0 -24
- package/.git/hooks/prepare-commit-msg.sample +0 -42
- package/.git/hooks/push-to-checkout.sample +0 -78
- package/.git/hooks/sendemail-validate.sample +0 -77
- package/.git/hooks/update.sample +0 -128
- package/.git/index +0 -0
- package/.git/info/exclude +0 -6
- package/.git/logs/HEAD +0 -2
- package/.git/logs/refs/heads/main +0 -2
- package/.git/logs/refs/remotes/origin/main +0 -2
- package/.git/objects/07/c0af7cd711cab6a55ad3dc349ac8c70775623c +0 -0
- package/.git/objects/0d/698432e2c44311c17b845cc63093a898972b95 +0 -0
- package/.git/objects/10/ba4a7d64968326293182d571a9c73f5e041fb6 +0 -3
- package/.git/objects/12/069a5aa45479564e00749f730582627a276a55 +0 -3
- package/.git/objects/14/5ab9cf82c40696a07ab42f117ba199acb2a50b +0 -4
- package/.git/objects/17/7b0dc4bf884f8ae0403b4aad053e76baafd632 +0 -2
- package/.git/objects/1d/a517ce3527df45a4f28e52ff2c0d9d1c8179f6 +0 -0
- package/.git/objects/27/50076ed23b5211a52ef834f40f183ddecb917a +0 -0
- package/.git/objects/2a/96e4bb57fa4bd69c719dca224b17b569e94e82 +0 -2
- package/.git/objects/2b/38c26b4ec43b8f5574acb164d2ba64bca8e230 +0 -0
- package/.git/objects/2c/61d463bee185f04e7c2bd1d2a15ad1117c589e +0 -0
- package/.git/objects/2d/22dbc836cfd75c8d7640ebe5a4fe90bd2c23c6 +0 -0
- package/.git/objects/2e/58414df7b4d5c972167a83270f78fc4ed508f5 +0 -0
- package/.git/objects/38/0be191ee415827a1217f46626fea4fefba48e5 +0 -0
- package/.git/objects/3a/93aa29cd19bdc95a87d15910baec8455f8b7b7 +0 -0
- package/.git/objects/50/150b739272269be2ede552448013eba65323da +0 -0
- package/.git/objects/53/2b7b796ffd3223f913a5a5e1e17743ee3591fe +0 -0
- package/.git/objects/54/a8535f50287f6a7a8c00aed143ca6e5ee5f5d1 +0 -0
- package/.git/objects/5d/4aa0709f62f1bc1fa80251208b570cb3b89d9c +0 -0
- package/.git/objects/63/1c43e00d4c34ba914c510f4fe2e6df15b8b06e +0 -0
- package/.git/objects/63/9900d13c6182e452e33a3bd638e70a0146c785 +0 -2
- package/.git/objects/64/3fa02661c3a1b54205729a75d2fb5f013833af +0 -0
- package/.git/objects/6c/59086d862516d2fffa5da2035e5003100fb5c7 +0 -0
- package/.git/objects/6c/b74f90a0c799eea1c54a04d8d6a8a9e9691cca +0 -2
- package/.git/objects/70/0e093acb1c1e55d523507411b7940a01a3bb65 +0 -0
- package/.git/objects/71/1ba2014bc137dece4c4156ff5e77e6abaeb95c +0 -0
- package/.git/objects/74/c82ffe8eb71efecbccfdf67b590949c944dd1a +0 -0
- package/.git/objects/76/1413a07839108abb46ef0e4490bd1c1444b4fc +0 -0
- package/.git/objects/77/96f8282f2c553ecdde72bc976478eb3a8a948e +0 -0
- package/.git/objects/79/ee123c2b23e069e35ed634d687e17f731cc702 +0 -0
- package/.git/objects/7d/80af9735f0527db35ecc79ae3c887e445cb3e0 +0 -0
- package/.git/objects/85/1d8d26c2a946ccfd5461a2573665c1fb7d71f7 +0 -0
- package/.git/objects/85/c5f24b8c55496f82a2680f94a7d3fa32887ea0 +0 -0
- package/.git/objects/87/00b3833597b600e6f0ffcfbaf622fd8cfaa9c3 +0 -1
- package/.git/objects/87/f31d3df8e7edbf96e45d80126f878b8e0c243f +0 -0
- package/.git/objects/8b/cc95b71b20c79513e9157b921238ca2c79f906 +0 -0
- package/.git/objects/8d/d819967bdc8457f04c1b5498bce89380d6552b +0 -7
- package/.git/objects/91/b0fba96bf994b6232bb923f2a9929fc258a05f +0 -0
- package/.git/objects/92/608c4e069a4301d466d8d18daecbe7abc9500e +0 -0
- package/.git/objects/94/a25f7f4cb416c083d265558da75d457237d671 +0 -0
- package/.git/objects/9c/69411050eac81b5dce09314516a30b38c41a20 +0 -3
- package/.git/objects/9f/54b5b21769da383f12fb9c7bd364bdb05e13a9 +0 -0
- package/.git/objects/a5/886c22eb68b152bb95ec5151504676d8e78ae1 +0 -0
- package/.git/objects/a6/582c9510e264f3b46fc3b20597a16923a03523 +0 -0
- package/.git/objects/a9/d7db9c0a81b2db47ca92e4e180b30090b27632 +0 -0
- package/.git/objects/ad/c418f9105db9ec488de6831584b82e3929eaef +0 -0
- package/.git/objects/b0/c1c68fbbad6b190434cd2bb0e807796bd56fca +0 -0
- package/.git/objects/b1/0f0d0ef3bc5aaf3a91be0b991cb6fe0fcadc40 +0 -0
- package/.git/objects/b6/3b642cfb4254fc0f7058903abc5b481895c4ef +0 -0
- package/.git/objects/b8/a2c461d7ffed9d4ba242c58a52341832b99e0a +0 -0
- package/.git/objects/ba/5b53857ced8d97f6d6e3fb3538b3273743dafc +0 -2
- package/.git/objects/ba/5ef7104c0d019a9692cd2d78261d96f29e916f +0 -0
- package/.git/objects/bc/91e0079eb00d56dcde16714748f36a10dbd525 +0 -0
- package/.git/objects/c1/beeb895b71b709e48560460199db11b3fc18af +0 -0
- package/.git/objects/c5/166c2aeebaeb0a0f7654223c843c50cd4c8953 +0 -0
- package/.git/objects/d4/0a2096fc36c1fd9c7a9263c458d5e8a4a5bee7 +0 -0
- package/.git/objects/e1/b744bc6076ebeb02fa86af98583ac22e070ec0 +0 -0
- package/.git/objects/e8/019be9e978a8e2f094e748cbb6ce0c7163adee +0 -0
- package/.git/objects/eb/1d744c4e9b47bc902647298424320078e32980 +0 -0
- package/.git/objects/ee/15af38be7f3c3862229e59c6b5688f8e0f6099 +0 -0
- package/.git/objects/f1/9e0f429f231c34432784f9e33b92ac1d598c17 +0 -0
- package/.git/objects/f9/86f2fe82493e85651396b6d5886316d1c890dd +0 -0
- package/.git/refs/heads/main +0 -1
- package/.git/refs/remotes/origin/main +0 -1
- package/.git/refs/tags/v0.1.1 +0 -1
- package/.git/shallow +0 -1
- package/.github/dependabot.yml +0 -10
- package/.github/workflows/ci.yml +0 -12
- package/.github/workflows/issues.yml +0 -13
- package/.github/workflows/publish.yml +0 -21
- package/.gitignore +0 -13
- package/.idea/.gitignore +0 -10
- package/.idea/aws.xml +0 -11
- package/.idea/codeStyles/Project.xml +0 -58
- package/.idea/codeStyles/codeStyleConfig.xml +0 -5
- package/.idea/commons-js.iml +0 -14
- package/.idea/inspectionProfiles/Project_Default.xml +0 -7
- package/.idea/misc.xml +0 -6
- package/.idea/modules.xml +0 -8
- package/.idea/prettier.xml +0 -6
- package/.idea/vcs.xml +0 -6
- package/.npmrc +0 -1
- package/.prettierignore +0 -7
- package/.prettierrc.cjs +0 -3
- package/LICENSE +0 -26
- package/README.md +0 -14
- package/coverage/base.css +0 -224
- package/coverage/bitsnbytes/b64.mts.html +0 -559
- package/coverage/bitsnbytes/index.html +0 -131
- package/coverage/bitsnbytes/index.mts.html +0 -88
- package/coverage/clover.xml +0 -1003
- package/coverage/coverage-final.json +0 -15
- package/coverage/errors/errors.mts.html +0 -898
- package/coverage/errors/index.html +0 -131
- package/coverage/errors/index.mts.html +0 -88
- package/coverage/favicon.png +0 -0
- package/coverage/http/http-method.mts.html +0 -112
- package/coverage/http/http-status-code.mts.html +0 -211
- package/coverage/http/index.html +0 -146
- package/coverage/http/index.mts.html +0 -91
- package/coverage/index.html +0 -191
- package/coverage/lang/index.html +0 -146
- package/coverage/lang/index.mts.html +0 -91
- package/coverage/lang/sleep.mts.html +0 -109
- package/coverage/lang/type-functions.mts.html +0 -124
- package/coverage/oauth/crypto-functions.mts.html +0 -217
- package/coverage/oauth/index.html +0 -131
- package/coverage/oauth/index.mts.html +0 -88
- package/coverage/prettify.css +0 -1
- package/coverage/sort-arrow-sprite.png +0 -0
- package/coverage/validator/index.html +0 -131
- package/coverage/validator/index.mts.html +0 -88
- package/coverage/validator/validators.mts.html +0 -1237
- package/dist/bitsnbytes/b64.test.d.mts +0 -2
- package/dist/bitsnbytes/b64.test.d.mts.map +0 -1
- package/dist/bitsnbytes/b64.test.mjs +0 -71
- package/dist/bitsnbytes/b64.test.mjs.map +0 -1
- package/dist/errors/errors.test.d.mts +0 -2
- package/dist/errors/errors.test.d.mts.map +0 -1
- package/dist/errors/errors.test.mjs +0 -45
- package/dist/errors/errors.test.mjs.map +0 -1
- package/dist/oauth/crypto-functions.test.d.mts +0 -2
- package/dist/oauth/crypto-functions.test.d.mts.map +0 -1
- package/dist/oauth/crypto-functions.test.mjs +0 -36
- package/dist/oauth/crypto-functions.test.mjs.map +0 -1
- package/dist/package.json +0 -72
- package/dist/validator/validators.test.d.mts +0 -2
- package/dist/validator/validators.test.d.mts.map +0 -1
- package/dist/validator/validators.test.mjs +0 -177
- package/dist/validator/validators.test.mjs.map +0 -1
- package/node_modules/@eslint/eslintrc/LICENSE +0 -19
- package/node_modules/@eslint/eslintrc/README.md +0 -115
- package/node_modules/@eslint/eslintrc/dist/eslintrc-universal.cjs +0 -1104
- package/node_modules/@eslint/eslintrc/dist/eslintrc-universal.cjs.map +0 -1
- package/node_modules/@eslint/eslintrc/dist/eslintrc.cjs +0 -4344
- package/node_modules/@eslint/eslintrc/dist/eslintrc.cjs.map +0 -1
- package/node_modules/@eslint/eslintrc/package.json +0 -82
- package/node_modules/@eslint/eslintrc/universal.js +0 -9
- package/node_modules/@eslint/js/LICENSE +0 -19
- package/node_modules/@eslint/js/README.md +0 -57
- package/node_modules/@eslint/js/package.json +0 -31
- package/node_modules/@eslint/js/src/index.js +0 -17
- package/node_modules/@eslint-community/eslint-utils/LICENSE +0 -21
- package/node_modules/@eslint-community/eslint-utils/README.md +0 -37
- package/node_modules/@eslint-community/eslint-utils/index.js +0 -2068
- package/node_modules/@eslint-community/eslint-utils/index.js.map +0 -1
- package/node_modules/@eslint-community/eslint-utils/index.mjs +0 -2027
- package/node_modules/@eslint-community/eslint-utils/index.mjs.map +0 -1
- package/node_modules/@eslint-community/eslint-utils/package.json +0 -73
- package/node_modules/@eslint-community/regexpp/LICENSE +0 -21
- package/node_modules/@eslint-community/regexpp/README.md +0 -177
- package/node_modules/@eslint-community/regexpp/index.d.ts +0 -1065
- package/node_modules/@eslint-community/regexpp/index.js +0 -2747
- package/node_modules/@eslint-community/regexpp/index.js.map +0 -1
- package/node_modules/@eslint-community/regexpp/index.mjs +0 -2737
- package/node_modules/@eslint-community/regexpp/index.mjs.map +0 -1
- package/node_modules/@eslint-community/regexpp/package.json +0 -93
- package/node_modules/@types/node/LICENSE +0 -21
- package/node_modules/@types/node/README.md +0 -15
- package/node_modules/@types/node/package.json +0 -217
- package/node_modules/@typescript-eslint/eslint-plugin/LICENSE +0 -21
- package/node_modules/@typescript-eslint/eslint-plugin/README.md +0 -10
- package/node_modules/@typescript-eslint/eslint-plugin/dist/index.js +0 -23
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/README.md +0 -23
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/TEMPLATE.md +0 -26
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/adjacent-overload-signatures.md +0 -93
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/array-type.md +0 -103
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/await-thenable.md +0 -40
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/ban-ts-comment.md +0 -148
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/ban-tslint-comment.md +0 -39
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/ban-types.md +0 -183
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/block-spacing.md +0 -12
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/brace-style.md +0 -12
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/camelcase.md +0 -10
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/class-literal-property-style.md +0 -114
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/comma-dangle.md +0 -22
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/comma-spacing.md +0 -12
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/consistent-generic-constructors.md +0 -73
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/consistent-indexed-object-style.md +0 -80
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/consistent-type-assertions.md +0 -108
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/consistent-type-definitions.md +0 -82
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/consistent-type-exports.md +0 -100
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/consistent-type-imports.md +0 -105
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/default-param-last.md +0 -48
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/dot-notation.md +0 -77
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/explicit-function-return-type.md +0 -319
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/explicit-member-accessibility.md +0 -331
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/explicit-module-boundary-types.md +0 -250
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/func-call-spacing.md +0 -12
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/indent.md +0 -20
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/init-declarations.md +0 -12
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/key-spacing.md +0 -12
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/keyword-spacing.md +0 -12
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/lines-around-comment.md +0 -37
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/lines-between-class-members.md +0 -63
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/member-delimiter-style.md +0 -161
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/member-ordering.md +0 -1360
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/method-signature-style.md +0 -110
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/naming-convention.md +0 -706
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-array-constructor.md +0 -35
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-base-to-string.md +0 -88
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-confusing-non-null-assertion.md +0 -56
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-confusing-void-expression.md +0 -116
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-dupe-class-members.md +0 -12
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-duplicate-enum-values.md +0 -50
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-duplicate-imports.md +0 -12
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-duplicate-type-constituents.md +0 -61
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-dynamic-delete.md +0 -53
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-empty-function.md +0 -88
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-empty-interface.md +0 -70
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-explicit-any.md +0 -174
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-extra-non-null-assertion.md +0 -52
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-extra-parens.md +0 -12
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-extra-semi.md +0 -12
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-extraneous-class.md +0 -294
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-floating-promises.md +0 -106
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-for-in-array.md +0 -56
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-implicit-any-catch.md +0 -73
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-implied-eval.md +0 -101
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-import-type-side-effects.md +0 -75
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-inferrable-types.md +0 -103
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-invalid-this.md +0 -12
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-invalid-void-type.md +0 -113
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-loop-func.md +0 -12
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-loss-of-precision.md +0 -12
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-magic-numbers.md +0 -131
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-meaningless-void-operator.md +0 -47
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-misused-new.md +0 -46
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-misused-promises.md +0 -245
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-mixed-enums.md +0 -88
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-namespace.md +0 -129
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-non-null-asserted-nullish-coalescing.md +0 -49
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-non-null-asserted-optional-chain.md +0 -35
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-non-null-assertion.md +0 -42
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-parameter-properties.md +0 -406
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-redeclare.md +0 -73
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-redundant-type-constituents.md +0 -78
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-require-imports.md +0 -37
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-restricted-imports.md +0 -63
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-shadow.md +0 -101
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-this-alias.md +0 -38
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-throw-literal.md +0 -111
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-type-alias.md +0 -602
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unnecessary-boolean-literal-compare.md +0 -133
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unnecessary-condition.md +0 -103
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unnecessary-qualifier.md +0 -51
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unnecessary-type-arguments.md +0 -73
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unnecessary-type-assertion.md +0 -77
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unnecessary-type-constraint.md +0 -55
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unsafe-argument.md +0 -83
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unsafe-assignment.md +0 -86
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unsafe-call.md +0 -58
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unsafe-declaration-merging.md +0 -54
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unsafe-enum-comparison.md +0 -75
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unsafe-member-access.md +0 -64
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unsafe-return.md +0 -103
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unused-expressions.md +0 -12
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unused-vars.md +0 -12
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-use-before-define.md +0 -97
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-useless-constructor.md +0 -21
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-useless-empty-export.md +0 -43
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-var-requires.md +0 -37
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/non-nullable-type-assertion-style.md +0 -41
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/object-curly-spacing.md +0 -12
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/padding-line-between-statements.md +0 -35
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/parameter-properties.md +0 -485
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-as-const.md +0 -44
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-enum-initializers.md +0 -62
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-for-of.md +0 -46
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-function-type.md +0 -92
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-includes.md +0 -77
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-literal-enum-member.md +0 -101
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-namespace-keyword.md +0 -47
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-nullish-coalescing.md +0 -164
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-optional-chain.md +0 -71
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-readonly-parameter-types.md +0 -268
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-readonly.md +0 -87
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-reduce-type-parameter.md +0 -58
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-regexp-exec.md +0 -46
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-return-this-type.md +0 -87
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-string-starts-ends-with.md +0 -57
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-ts-expect-error.md +0 -69
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/promise-function-async.md +0 -59
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/quotes.md +0 -12
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/require-array-sort-compare.md +0 -78
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/require-await.md +0 -24
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/restrict-plus-operands.md +0 -208
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/restrict-template-expressions.md +0 -117
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/return-await.md +0 -216
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/semi.md +0 -16
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/sort-type-constituents.md +0 -101
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/sort-type-union-intersection-members.md +0 -106
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/space-before-blocks.md +0 -42
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/space-before-function-paren.md +0 -12
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/space-infix-ops.md +0 -16
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/strict-boolean-expressions.md +0 -183
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/switch-exhaustiveness-check.md +0 -106
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/triple-slash-reference.md +0 -61
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/type-annotation-spacing.md +0 -303
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/typedef.md +0 -320
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/unbound-method.md +0 -103
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/unified-signatures.md +0 -70
- package/node_modules/@typescript-eslint/eslint-plugin/index.d.ts +0 -4
- package/node_modules/@typescript-eslint/eslint-plugin/package.json +0 -87
- package/node_modules/@typescript-eslint/parser/LICENSE +0 -22
- package/node_modules/@typescript-eslint/parser/README.md +0 -10
- package/node_modules/@typescript-eslint/parser/dist/index.js +0 -17
- package/node_modules/@typescript-eslint/parser/package.json +0 -75
- package/node_modules/@typescript-eslint/scope-manager/LICENSE +0 -21
- package/node_modules/@typescript-eslint/scope-manager/README.md +0 -8
- package/node_modules/@typescript-eslint/scope-manager/dist/index.js +0 -31
- package/node_modules/@typescript-eslint/scope-manager/package.json +0 -67
- package/node_modules/@typescript-eslint/type-utils/LICENSE +0 -21
- package/node_modules/@typescript-eslint/type-utils/README.md +0 -12
- package/node_modules/@typescript-eslint/type-utils/dist/index.js +0 -36
- package/node_modules/@typescript-eslint/type-utils/package.json +0 -71
- package/node_modules/@typescript-eslint/types/LICENSE +0 -21
- package/node_modules/@typescript-eslint/types/README.md +0 -12
- package/node_modules/@typescript-eslint/types/dist/index.js +0 -24
- package/node_modules/@typescript-eslint/types/package.json +0 -84
- package/node_modules/@typescript-eslint/typescript-estree/LICENSE +0 -26
- package/node_modules/@typescript-eslint/typescript-estree/README.md +0 -10
- package/node_modules/@typescript-eslint/typescript-estree/dist/index.js +0 -38
- package/node_modules/@typescript-eslint/typescript-estree/package.json +0 -85
- package/node_modules/@typescript-eslint/utils/LICENSE +0 -21
- package/node_modules/@typescript-eslint/utils/README.md +0 -10
- package/node_modules/@typescript-eslint/utils/dist/index.js +0 -41
- package/node_modules/@typescript-eslint/utils/package.json +0 -70
- package/node_modules/@typescript-eslint/visitor-keys/LICENSE +0 -21
- package/node_modules/@typescript-eslint/visitor-keys/README.md +0 -10
- package/node_modules/@typescript-eslint/visitor-keys/dist/index.js +0 -8
- package/node_modules/@typescript-eslint/visitor-keys/package.json +0 -60
- package/node_modules/@vitest/coverage-v8/LICENSE +0 -21
- package/node_modules/@vitest/coverage-v8/dist/index.js +0 -54
- package/node_modules/@vitest/coverage-v8/package.json +0 -72
- package/pnpm-lock.yaml +0 -3277
- package/src/bitsnbytes/b64.mts +0 -158
- package/src/bitsnbytes/b64.test.mts +0 -78
- package/src/bitsnbytes/index.mts +0 -1
- package/src/errors/errors.mts +0 -271
- package/src/errors/errors.test.mts +0 -74
- package/src/errors/index.mts +0 -1
- package/src/http/http-method.mts +0 -9
- package/src/http/http-status-code.mts +0 -42
- package/src/http/index.mts +0 -2
- package/src/lang/index.mts +0 -2
- package/src/lang/sleep.mts +0 -8
- package/src/lang/type-functions.mts +0 -13
- package/src/oauth/crypto-functions.mts +0 -44
- package/src/oauth/crypto-functions.test.mts +0 -48
- package/src/oauth/index.mts +0 -1
- package/src/validator/index.mts +0 -1
- package/src/validator/validators.mts +0 -384
- package/src/validator/validators.test.mts +0 -245
- package/tsconfig.json +0 -18
- /package/{dist/bitsnbytes → bitsnbytes}/b64.d.mts +0 -0
- /package/{dist/bitsnbytes → bitsnbytes}/b64.d.mts.map +0 -0
- /package/{dist/bitsnbytes → bitsnbytes}/b64.mjs +0 -0
- /package/{dist/bitsnbytes → bitsnbytes}/b64.mjs.map +0 -0
- /package/{dist/bitsnbytes → bitsnbytes}/index.d.mts +0 -0
- /package/{dist/bitsnbytes → bitsnbytes}/index.d.mts.map +0 -0
- /package/{dist/bitsnbytes → bitsnbytes}/index.mjs +0 -0
- /package/{dist/bitsnbytes → bitsnbytes}/index.mjs.map +0 -0
- /package/{dist/errors → errors}/errors.d.mts +0 -0
- /package/{dist/errors → errors}/errors.d.mts.map +0 -0
- /package/{dist/errors → errors}/errors.mjs +0 -0
- /package/{dist/errors → errors}/errors.mjs.map +0 -0
- /package/{dist/errors → errors}/index.d.mts +0 -0
- /package/{dist/errors → errors}/index.d.mts.map +0 -0
- /package/{dist/errors → errors}/index.mjs +0 -0
- /package/{dist/errors → errors}/index.mjs.map +0 -0
- /package/{dist/http → http}/http-method.d.mts +0 -0
- /package/{dist/http → http}/http-method.d.mts.map +0 -0
- /package/{dist/http → http}/http-method.mjs +0 -0
- /package/{dist/http → http}/http-method.mjs.map +0 -0
- /package/{dist/http → http}/http-status-code.d.mts +0 -0
- /package/{dist/http → http}/http-status-code.d.mts.map +0 -0
- /package/{dist/http → http}/http-status-code.mjs +0 -0
- /package/{dist/http → http}/http-status-code.mjs.map +0 -0
- /package/{dist/http → http}/index.d.mts +0 -0
- /package/{dist/http → http}/index.d.mts.map +0 -0
- /package/{dist/http → http}/index.mjs +0 -0
- /package/{dist/http → http}/index.mjs.map +0 -0
- /package/{dist/lang → lang}/index.d.mts +0 -0
- /package/{dist/lang → lang}/index.d.mts.map +0 -0
- /package/{dist/lang → lang}/index.mjs +0 -0
- /package/{dist/lang → lang}/index.mjs.map +0 -0
- /package/{dist/lang → lang}/sleep.d.mts +0 -0
- /package/{dist/lang → lang}/sleep.d.mts.map +0 -0
- /package/{dist/lang → lang}/sleep.mjs +0 -0
- /package/{dist/lang → lang}/sleep.mjs.map +0 -0
- /package/{dist/lang → lang}/type-functions.d.mts +0 -0
- /package/{dist/lang → lang}/type-functions.d.mts.map +0 -0
- /package/{dist/lang → lang}/type-functions.mjs +0 -0
- /package/{dist/lang → lang}/type-functions.mjs.map +0 -0
- /package/{dist/oauth → oauth}/crypto-functions.d.mts +0 -0
- /package/{dist/oauth → oauth}/crypto-functions.d.mts.map +0 -0
- /package/{dist/oauth → oauth}/crypto-functions.mjs +0 -0
- /package/{dist/oauth → oauth}/crypto-functions.mjs.map +0 -0
- /package/{dist/oauth → oauth}/index.d.mts +0 -0
- /package/{dist/oauth → oauth}/index.d.mts.map +0 -0
- /package/{dist/oauth → oauth}/index.mjs +0 -0
- /package/{dist/oauth → oauth}/index.mjs.map +0 -0
- /package/{dist/validator → validator}/index.d.mts +0 -0
- /package/{dist/validator → validator}/index.d.mts.map +0 -0
- /package/{dist/validator → validator}/index.mjs +0 -0
- /package/{dist/validator → validator}/index.mjs.map +0 -0
- /package/{dist/validator → validator}/validators.d.mts +0 -0
- /package/{dist/validator → validator}/validators.d.mts.map +0 -0
- /package/{dist/validator → validator}/validators.mjs +0 -0
- /package/{dist/validator → validator}/validators.mjs.map +0 -0
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: Overview
|
|
3
|
-
sidebar_label: Overview
|
|
4
|
-
pagination_next: null
|
|
5
|
-
pagination_prev: null
|
|
6
|
-
slug: /
|
|
7
|
-
---
|
|
8
|
-
|
|
9
|
-
`@typescript-eslint/eslint-plugin` includes over 100 rules that detect best practice violations, bugs, and/or stylistic issues specifically for TypeScript code.
|
|
10
|
-
See [Configs](/linting/configs) for how to enable recommended rules using configs.
|
|
11
|
-
|
|
12
|
-
## Supported Rules
|
|
13
|
-
|
|
14
|
-
import RulesTable from "@site/src/components/RulesTable";
|
|
15
|
-
|
|
16
|
-
<RulesTable ruleset="supported-rules" />
|
|
17
|
-
|
|
18
|
-
## Extension Rules
|
|
19
|
-
|
|
20
|
-
In some cases, ESLint provides a rule itself, but it doesn't support TypeScript syntax; either it crashes, or it ignores the syntax, or it falsely reports against it.
|
|
21
|
-
In these cases, we create what we call an extension rule; a rule within our plugin that has the same functionality, but also supports TypeScript.
|
|
22
|
-
|
|
23
|
-
<RulesTable ruleset="extension-rules" />
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
> 🛑 This file is source code, not the primary documentation location! 🛑
|
|
2
|
-
>
|
|
3
|
-
> See **https://typescript-eslint.io/rules/your-rule-name** for documentation.
|
|
4
|
-
|
|
5
|
-
## Examples
|
|
6
|
-
|
|
7
|
-
To fill out: tell us more about this rule.
|
|
8
|
-
|
|
9
|
-
<!--tabs-->
|
|
10
|
-
|
|
11
|
-
### ❌ Incorrect
|
|
12
|
-
|
|
13
|
-
```ts
|
|
14
|
-
// To fill out: incorrect code
|
|
15
|
-
```
|
|
16
|
-
|
|
17
|
-
### ✅ Correct
|
|
18
|
-
|
|
19
|
-
```ts
|
|
20
|
-
// To fill out: correct code
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
## When Not To Use It
|
|
24
|
-
|
|
25
|
-
To fill out: why wouldn't you want to use this rule?
|
|
26
|
-
For example if this rule requires a feature released in a certain TS version.
|
package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/adjacent-overload-signatures.md
DELETED
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: 'Require that function overload signatures be consecutive.'
|
|
3
|
-
---
|
|
4
|
-
|
|
5
|
-
> 🛑 This file is source code, not the primary documentation location! 🛑
|
|
6
|
-
>
|
|
7
|
-
> See **https://typescript-eslint.io/rules/adjacent-overload-signatures** for documentation.
|
|
8
|
-
|
|
9
|
-
Function overload signatures represent multiple ways a function can be called, potentially with different return types.
|
|
10
|
-
It's typical for an interface or type alias describing a function to place all overload signatures next to each other.
|
|
11
|
-
If Signatures placed elsewhere in the type are easier to be missed by future developers reading the code.
|
|
12
|
-
|
|
13
|
-
## Examples
|
|
14
|
-
|
|
15
|
-
<!--tabs-->
|
|
16
|
-
|
|
17
|
-
### ❌ Incorrect
|
|
18
|
-
|
|
19
|
-
```ts
|
|
20
|
-
declare namespace Foo {
|
|
21
|
-
export function foo(s: string): void;
|
|
22
|
-
export function foo(n: number): void;
|
|
23
|
-
export function bar(): void;
|
|
24
|
-
export function foo(sn: string | number): void;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
type Foo = {
|
|
28
|
-
foo(s: string): void;
|
|
29
|
-
foo(n: number): void;
|
|
30
|
-
bar(): void;
|
|
31
|
-
foo(sn: string | number): void;
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
interface Foo {
|
|
35
|
-
foo(s: string): void;
|
|
36
|
-
foo(n: number): void;
|
|
37
|
-
bar(): void;
|
|
38
|
-
foo(sn: string | number): void;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
class Foo {
|
|
42
|
-
foo(s: string): void;
|
|
43
|
-
foo(n: number): void;
|
|
44
|
-
bar(): void {}
|
|
45
|
-
foo(sn: string | number): void {}
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
export function foo(s: string): void;
|
|
49
|
-
export function foo(n: number): void;
|
|
50
|
-
export function bar(): void;
|
|
51
|
-
export function foo(sn: string | number): void;
|
|
52
|
-
```
|
|
53
|
-
|
|
54
|
-
### ✅ Correct
|
|
55
|
-
|
|
56
|
-
```ts
|
|
57
|
-
declare namespace Foo {
|
|
58
|
-
export function foo(s: string): void;
|
|
59
|
-
export function foo(n: number): void;
|
|
60
|
-
export function foo(sn: string | number): void;
|
|
61
|
-
export function bar(): void;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
type Foo = {
|
|
65
|
-
foo(s: string): void;
|
|
66
|
-
foo(n: number): void;
|
|
67
|
-
foo(sn: string | number): void;
|
|
68
|
-
bar(): void;
|
|
69
|
-
};
|
|
70
|
-
|
|
71
|
-
interface Foo {
|
|
72
|
-
foo(s: string): void;
|
|
73
|
-
foo(n: number): void;
|
|
74
|
-
foo(sn: string | number): void;
|
|
75
|
-
bar(): void;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
class Foo {
|
|
79
|
-
foo(s: string): void;
|
|
80
|
-
foo(n: number): void;
|
|
81
|
-
foo(sn: string | number): void {}
|
|
82
|
-
bar(): void {}
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
export function bar(): void;
|
|
86
|
-
export function foo(s: string): void;
|
|
87
|
-
export function foo(n: number): void;
|
|
88
|
-
export function foo(sn: string | number): void;
|
|
89
|
-
```
|
|
90
|
-
|
|
91
|
-
## When Not To Use It
|
|
92
|
-
|
|
93
|
-
If you don't care about the general structure of the code, then you will not need this rule.
|
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: 'Require consistently using either `T[]` or `Array<T>` for arrays.'
|
|
3
|
-
---
|
|
4
|
-
|
|
5
|
-
> 🛑 This file is source code, not the primary documentation location! 🛑
|
|
6
|
-
>
|
|
7
|
-
> See **https://typescript-eslint.io/rules/array-type** for documentation.
|
|
8
|
-
|
|
9
|
-
TypeScript provides two equivalent ways to define an array type: `T[]` and `Array<T>`.
|
|
10
|
-
The two styles are functionally equivalent.
|
|
11
|
-
Using the same style consistently across your codebase makes it easier for developers to read and understand array types.
|
|
12
|
-
|
|
13
|
-
## Options
|
|
14
|
-
|
|
15
|
-
The default config will enforce that all mutable and readonly arrays use the `'array'` syntax.
|
|
16
|
-
|
|
17
|
-
### `"array"`
|
|
18
|
-
|
|
19
|
-
Always use `T[]` or `readonly T[]` for all array types.
|
|
20
|
-
|
|
21
|
-
<!--tabs-->
|
|
22
|
-
|
|
23
|
-
#### ❌ Incorrect
|
|
24
|
-
|
|
25
|
-
```ts
|
|
26
|
-
const x: Array<string> = ['a', 'b'];
|
|
27
|
-
const y: ReadonlyArray<string> = ['a', 'b'];
|
|
28
|
-
```
|
|
29
|
-
|
|
30
|
-
#### ✅ Correct
|
|
31
|
-
|
|
32
|
-
```ts
|
|
33
|
-
const x: string[] = ['a', 'b'];
|
|
34
|
-
const y: readonly string[] = ['a', 'b'];
|
|
35
|
-
```
|
|
36
|
-
|
|
37
|
-
### `"generic"`
|
|
38
|
-
|
|
39
|
-
Always use `Array<T>` or `ReadonlyArray<T>` for all array types.
|
|
40
|
-
|
|
41
|
-
<!--tabs-->
|
|
42
|
-
|
|
43
|
-
#### ❌ Incorrect
|
|
44
|
-
|
|
45
|
-
```ts
|
|
46
|
-
const x: string[] = ['a', 'b'];
|
|
47
|
-
const y: readonly string[] = ['a', 'b'];
|
|
48
|
-
```
|
|
49
|
-
|
|
50
|
-
#### ✅ Correct
|
|
51
|
-
|
|
52
|
-
```ts
|
|
53
|
-
const x: Array<string> = ['a', 'b'];
|
|
54
|
-
const y: ReadonlyArray<string> = ['a', 'b'];
|
|
55
|
-
```
|
|
56
|
-
|
|
57
|
-
### `"array-simple"`
|
|
58
|
-
|
|
59
|
-
Use `T[]` or `readonly T[]` for simple types (i.e. types which are just primitive names or type references).
|
|
60
|
-
Use `Array<T>` or `ReadonlyArray<T>` for all other types (union types, intersection types, object types, function types, etc).
|
|
61
|
-
|
|
62
|
-
<!--tabs-->
|
|
63
|
-
|
|
64
|
-
#### ❌ Incorrect
|
|
65
|
-
|
|
66
|
-
```ts
|
|
67
|
-
const a: (string | number)[] = ['a', 'b'];
|
|
68
|
-
const b: { prop: string }[] = [{ prop: 'a' }];
|
|
69
|
-
const c: (() => void)[] = [() => {}];
|
|
70
|
-
const d: Array<MyType> = ['a', 'b'];
|
|
71
|
-
const e: Array<string> = ['a', 'b'];
|
|
72
|
-
const f: ReadonlyArray<string> = ['a', 'b'];
|
|
73
|
-
```
|
|
74
|
-
|
|
75
|
-
#### ✅ Correct
|
|
76
|
-
|
|
77
|
-
```ts
|
|
78
|
-
const a: Array<string | number> = ['a', 'b'];
|
|
79
|
-
const b: Array<{ prop: string }> = [{ prop: 'a' }];
|
|
80
|
-
const c: Array<() => void> = [() => {}];
|
|
81
|
-
const d: MyType[] = ['a', 'b'];
|
|
82
|
-
const e: string[] = ['a', 'b'];
|
|
83
|
-
const f: readonly string[] = ['a', 'b'];
|
|
84
|
-
```
|
|
85
|
-
|
|
86
|
-
## Combination Matrix
|
|
87
|
-
|
|
88
|
-
This matrix lists all possible option combinations and their expected results for different types of Arrays.
|
|
89
|
-
|
|
90
|
-
| defaultOption | readonlyOption | Array with simple type | Array with non simple type | Readonly array with simple type | Readonly array with non simple type |
|
|
91
|
-
| -------------- | -------------- | ---------------------- | -------------------------- | ------------------------------- | ----------------------------------- |
|
|
92
|
-
| `array` | | `number[]` | `(Foo & Bar)[]` | `readonly number[]` | `readonly (Foo & Bar)[]` |
|
|
93
|
-
| `array` | `array` | `number[]` | `(Foo & Bar)[]` | `readonly number[]` | `readonly (Foo & Bar)[]` |
|
|
94
|
-
| `array` | `array-simple` | `number[]` | `(Foo & Bar)[]` | `readonly number[]` | `ReadonlyArray<Foo & Bar>` |
|
|
95
|
-
| `array` | `generic` | `number[]` | `(Foo & Bar)[]` | `ReadonlyArray<number>` | `ReadonlyArray<Foo & Bar>` |
|
|
96
|
-
| `array-simple` | | `number[]` | `Array<Foo & Bar>` | `readonly number[]` | `ReadonlyArray<Foo & Bar>` |
|
|
97
|
-
| `array-simple` | `array` | `number[]` | `Array<Foo & Bar>` | `readonly number[]` | `readonly (Foo & Bar)[]` |
|
|
98
|
-
| `array-simple` | `array-simple` | `number[]` | `Array<Foo & Bar>` | `readonly number[]` | `ReadonlyArray<Foo & Bar>` |
|
|
99
|
-
| `array-simple` | `generic` | `number[]` | `Array<Foo & Bar>` | `ReadonlyArray<number>` | `ReadonlyArray<Foo & Bar>` |
|
|
100
|
-
| `generic` | | `Array<number>` | `Array<Foo & Bar>` | `ReadonlyArray<number>` | `ReadonlyArray<Foo & Bar>` |
|
|
101
|
-
| `generic` | `array` | `Array<number>` | `Array<Foo & Bar>` | `readonly number[]` | `readonly (Foo & Bar)[]` |
|
|
102
|
-
| `generic` | `array-simple` | `Array<number>` | `Array<Foo & Bar>` | `readonly number[]` | `ReadonlyArray<Foo & Bar>` |
|
|
103
|
-
| `generic` | `generic` | `Array<number>` | `Array<Foo & Bar>` | `ReadonlyArray<number>` | `ReadonlyArray<Foo & Bar>` |
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: 'Disallow awaiting a value that is not a Thenable.'
|
|
3
|
-
---
|
|
4
|
-
|
|
5
|
-
> 🛑 This file is source code, not the primary documentation location! 🛑
|
|
6
|
-
>
|
|
7
|
-
> See **https://typescript-eslint.io/rules/await-thenable** for documentation.
|
|
8
|
-
|
|
9
|
-
A "Thenable" value is an object which has a `then` method, such as a Promise.
|
|
10
|
-
The `await` keyword is generally used to retrieve the result of calling a Thenable's `then` method.
|
|
11
|
-
|
|
12
|
-
If the `await` keyword is used on a value that is not a Thenable, the value is directly resolved immediately.
|
|
13
|
-
While doing so is valid JavaScript, it is often a programmer error, such as forgetting to add parenthesis to call a function that returns a Promise.
|
|
14
|
-
|
|
15
|
-
## Examples
|
|
16
|
-
|
|
17
|
-
<!--tabs-->
|
|
18
|
-
|
|
19
|
-
### ❌ Incorrect
|
|
20
|
-
|
|
21
|
-
```ts
|
|
22
|
-
await 'value';
|
|
23
|
-
|
|
24
|
-
const createValue = () => 'value';
|
|
25
|
-
await createValue();
|
|
26
|
-
```
|
|
27
|
-
|
|
28
|
-
### ✅ Correct
|
|
29
|
-
|
|
30
|
-
```ts
|
|
31
|
-
await Promise.resolve('value');
|
|
32
|
-
|
|
33
|
-
const createValue = async () => 'value';
|
|
34
|
-
await createValue();
|
|
35
|
-
```
|
|
36
|
-
|
|
37
|
-
## When Not To Use It
|
|
38
|
-
|
|
39
|
-
If you want to allow code to `await` non-Promise values.
|
|
40
|
-
This is generally not preferred, but can sometimes be useful for visual consistency.
|
|
@@ -1,148 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: 'Disallow `@ts-<directive>` comments or require descriptions after directives.'
|
|
3
|
-
---
|
|
4
|
-
|
|
5
|
-
> 🛑 This file is source code, not the primary documentation location! 🛑
|
|
6
|
-
>
|
|
7
|
-
> See **https://typescript-eslint.io/rules/ban-ts-comment** for documentation.
|
|
8
|
-
|
|
9
|
-
TypeScript provides several directive comments that can be used to alter how it processes files.
|
|
10
|
-
Using these to suppress TypeScript compiler errors reduces the effectiveness of TypeScript overall.
|
|
11
|
-
Instead, it's generally better to correct the types of code, to make directives unnecessary.
|
|
12
|
-
|
|
13
|
-
The directive comments supported by TypeScript are:
|
|
14
|
-
|
|
15
|
-
```ts
|
|
16
|
-
// @ts-expect-error
|
|
17
|
-
// @ts-ignore
|
|
18
|
-
// @ts-nocheck
|
|
19
|
-
// @ts-check
|
|
20
|
-
```
|
|
21
|
-
|
|
22
|
-
This rule lets you set which directive comments you want to allow in your codebase.
|
|
23
|
-
|
|
24
|
-
## Options
|
|
25
|
-
|
|
26
|
-
By default, only `@ts-check` is allowed, as it enables rather than suppresses errors.
|
|
27
|
-
|
|
28
|
-
### `ts-expect-error`, `ts-ignore`, `ts-nocheck`, `ts-check` directives
|
|
29
|
-
|
|
30
|
-
A value of `true` for a particular directive means that this rule will report if it finds any usage of said directive.
|
|
31
|
-
|
|
32
|
-
<!--tabs-->
|
|
33
|
-
|
|
34
|
-
#### ❌ Incorrect
|
|
35
|
-
|
|
36
|
-
```ts
|
|
37
|
-
if (false) {
|
|
38
|
-
// @ts-ignore: Unreachable code error
|
|
39
|
-
console.log('hello');
|
|
40
|
-
}
|
|
41
|
-
if (false) {
|
|
42
|
-
/*
|
|
43
|
-
@ts-ignore: Unreachable code error
|
|
44
|
-
*/
|
|
45
|
-
console.log('hello');
|
|
46
|
-
}
|
|
47
|
-
```
|
|
48
|
-
|
|
49
|
-
#### ✅ Correct
|
|
50
|
-
|
|
51
|
-
```ts
|
|
52
|
-
if (false) {
|
|
53
|
-
// Compiler warns about unreachable code error
|
|
54
|
-
console.log('hello');
|
|
55
|
-
}
|
|
56
|
-
```
|
|
57
|
-
|
|
58
|
-
### `allow-with-description`
|
|
59
|
-
|
|
60
|
-
A value of `'allow-with-description'` for a particular directive means that this rule will report if it finds a directive that does not have a description following the directive (on the same line).
|
|
61
|
-
|
|
62
|
-
For example, with `{ 'ts-expect-error': 'allow-with-description' }`:
|
|
63
|
-
|
|
64
|
-
<!--tabs-->
|
|
65
|
-
|
|
66
|
-
#### ❌ Incorrect
|
|
67
|
-
|
|
68
|
-
```ts
|
|
69
|
-
if (false) {
|
|
70
|
-
// @ts-expect-error
|
|
71
|
-
console.log('hello');
|
|
72
|
-
}
|
|
73
|
-
if (false) {
|
|
74
|
-
/* @ts-expect-error */
|
|
75
|
-
console.log('hello');
|
|
76
|
-
}
|
|
77
|
-
```
|
|
78
|
-
|
|
79
|
-
#### ✅ Correct
|
|
80
|
-
|
|
81
|
-
```ts
|
|
82
|
-
if (false) {
|
|
83
|
-
// @ts-expect-error: Unreachable code error
|
|
84
|
-
console.log('hello');
|
|
85
|
-
}
|
|
86
|
-
if (false) {
|
|
87
|
-
/*
|
|
88
|
-
@ts-expect-error: Unreachable code error
|
|
89
|
-
*/
|
|
90
|
-
console.log('hello');
|
|
91
|
-
}
|
|
92
|
-
```
|
|
93
|
-
|
|
94
|
-
### `descriptionFormat`
|
|
95
|
-
|
|
96
|
-
For each directive type, you can specify a custom format in the form of a regular expression. Only description that matches the pattern will be allowed.
|
|
97
|
-
|
|
98
|
-
For example, with `{ 'ts-expect-error': { descriptionFormat: '^: TS\\d+ because .+$' } }`:
|
|
99
|
-
|
|
100
|
-
<!--tabs-->
|
|
101
|
-
|
|
102
|
-
#### ❌ Incorrect
|
|
103
|
-
|
|
104
|
-
```ts
|
|
105
|
-
// @ts-expect-error: the library definition is wrong
|
|
106
|
-
const a = doSomething('hello');
|
|
107
|
-
```
|
|
108
|
-
|
|
109
|
-
#### ✅ Correct
|
|
110
|
-
|
|
111
|
-
```ts
|
|
112
|
-
// @ts-expect-error: TS1234 because the library definition is wrong
|
|
113
|
-
const a = doSomething('hello');
|
|
114
|
-
```
|
|
115
|
-
|
|
116
|
-
### `minimumDescriptionLength`
|
|
117
|
-
|
|
118
|
-
Use `minimumDescriptionLength` to set a minimum length for descriptions when using the `allow-with-description` option for a directive.
|
|
119
|
-
|
|
120
|
-
For example, with `{ 'ts-expect-error': 'allow-with-description', minimumDescriptionLength: 10 }` the following pattern is:
|
|
121
|
-
|
|
122
|
-
<!--tabs-->
|
|
123
|
-
|
|
124
|
-
#### ❌ Incorrect
|
|
125
|
-
|
|
126
|
-
```ts
|
|
127
|
-
if (false) {
|
|
128
|
-
// @ts-expect-error: TODO
|
|
129
|
-
console.log('hello');
|
|
130
|
-
}
|
|
131
|
-
```
|
|
132
|
-
|
|
133
|
-
#### ✅ Correct
|
|
134
|
-
|
|
135
|
-
```ts
|
|
136
|
-
if (false) {
|
|
137
|
-
// @ts-expect-error The rationale for this override is described in issue #1337 on GitLab
|
|
138
|
-
console.log('hello');
|
|
139
|
-
}
|
|
140
|
-
```
|
|
141
|
-
|
|
142
|
-
## When Not To Use It
|
|
143
|
-
|
|
144
|
-
If you want to use all of the TypeScript directives.
|
|
145
|
-
|
|
146
|
-
## Further Reading
|
|
147
|
-
|
|
148
|
-
- TypeScript [Type Checking JavaScript Files](https://www.typescriptlang.org/docs/handbook/type-checking-javascript-files.html)
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: 'Disallow `// tslint:<rule-flag>` comments.'
|
|
3
|
-
---
|
|
4
|
-
|
|
5
|
-
> 🛑 This file is source code, not the primary documentation location! 🛑
|
|
6
|
-
>
|
|
7
|
-
> See **https://typescript-eslint.io/rules/ban-tslint-comment** for documentation.
|
|
8
|
-
|
|
9
|
-
Useful when migrating from TSLint to ESLint. Once TSLint has been removed, this rule helps locate TSLint annotations (e.g. `// tslint:disable`).
|
|
10
|
-
|
|
11
|
-
> See the [TSLint rule flags docs](https://palantir.github.io/tslint/usage/rule-flags) for reference.
|
|
12
|
-
|
|
13
|
-
## Examples
|
|
14
|
-
|
|
15
|
-
<!--tabs-->
|
|
16
|
-
|
|
17
|
-
### ❌ Incorrect
|
|
18
|
-
|
|
19
|
-
```js
|
|
20
|
-
/* tslint:disable */
|
|
21
|
-
/* tslint:enable */
|
|
22
|
-
/* tslint:disable:rule1 rule2 rule3... */
|
|
23
|
-
/* tslint:enable:rule1 rule2 rule3... */
|
|
24
|
-
// tslint:disable-next-line
|
|
25
|
-
someCode(); // tslint:disable-line
|
|
26
|
-
// tslint:disable-next-line:rule1 rule2 rule3...
|
|
27
|
-
```
|
|
28
|
-
|
|
29
|
-
### ✅ Correct
|
|
30
|
-
|
|
31
|
-
```js
|
|
32
|
-
// This is a comment that just happens to mention tslint
|
|
33
|
-
/* This is a multiline comment that just happens to mention tslint */
|
|
34
|
-
someCode(); // This is a comment that just happens to mention tslint
|
|
35
|
-
```
|
|
36
|
-
|
|
37
|
-
## When Not To Use It
|
|
38
|
-
|
|
39
|
-
If you are still using TSLint.
|
|
@@ -1,183 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: 'Disallow certain types.'
|
|
3
|
-
---
|
|
4
|
-
|
|
5
|
-
> 🛑 This file is source code, not the primary documentation location! 🛑
|
|
6
|
-
>
|
|
7
|
-
> See **https://typescript-eslint.io/rules/ban-types** for documentation.
|
|
8
|
-
|
|
9
|
-
Some built-in types have aliases, while some types are considered dangerous or harmful.
|
|
10
|
-
It's often a good idea to ban certain types to help with consistency and safety.
|
|
11
|
-
|
|
12
|
-
This rule bans specific types and can suggest alternatives.
|
|
13
|
-
Note that it does not ban the corresponding runtime objects from being used.
|
|
14
|
-
|
|
15
|
-
## Examples
|
|
16
|
-
|
|
17
|
-
Examples of code with the default options:
|
|
18
|
-
|
|
19
|
-
<!--tabs-->
|
|
20
|
-
|
|
21
|
-
### ❌ Incorrect
|
|
22
|
-
|
|
23
|
-
```ts
|
|
24
|
-
// use lower-case primitives for consistency
|
|
25
|
-
const str: String = 'foo';
|
|
26
|
-
const bool: Boolean = true;
|
|
27
|
-
const num: Number = 1;
|
|
28
|
-
const symb: Symbol = Symbol('foo');
|
|
29
|
-
const bigInt: BigInt = 1n;
|
|
30
|
-
|
|
31
|
-
// use a proper function type
|
|
32
|
-
const func: Function = () => 1;
|
|
33
|
-
|
|
34
|
-
// use safer object types
|
|
35
|
-
const lowerObj: Object = {};
|
|
36
|
-
const capitalObj: Object = { a: 'string' };
|
|
37
|
-
|
|
38
|
-
const curly1: {} = 1;
|
|
39
|
-
const curly2: {} = { a: 'string' };
|
|
40
|
-
```
|
|
41
|
-
|
|
42
|
-
### ✅ Correct
|
|
43
|
-
|
|
44
|
-
```ts
|
|
45
|
-
// use lower-case primitives for consistency
|
|
46
|
-
const str: string = 'foo';
|
|
47
|
-
const bool: boolean = true;
|
|
48
|
-
const num: number = 1;
|
|
49
|
-
const symb: symbol = Symbol('foo');
|
|
50
|
-
const bigInt: bigint = 1n;
|
|
51
|
-
|
|
52
|
-
// use a proper function type
|
|
53
|
-
const func: () => number = () => 1;
|
|
54
|
-
|
|
55
|
-
// use safer object types
|
|
56
|
-
const lowerObj: object = {};
|
|
57
|
-
const capitalObj: { a: string } = { a: 'string' };
|
|
58
|
-
|
|
59
|
-
const curly1: number = 1;
|
|
60
|
-
const curly2: Record<'a', string> = { a: 'string' };
|
|
61
|
-
```
|
|
62
|
-
|
|
63
|
-
## Options
|
|
64
|
-
|
|
65
|
-
The default options provide a set of "best practices", intended to provide safety and standardization in your codebase:
|
|
66
|
-
|
|
67
|
-
- Don't use the upper-case primitive types, you should use the lower-case types for consistency.
|
|
68
|
-
- Avoid the `Function` type, as it provides little safety for the following reasons:
|
|
69
|
-
- It provides no type safety when calling the value, which means it's easy to provide the wrong arguments.
|
|
70
|
-
- It accepts class declarations, which will fail when called, as they are called without the `new` keyword.
|
|
71
|
-
- Avoid the `Object` and `{}` types, as they mean "any non-nullish value".
|
|
72
|
-
- This is a point of confusion for many developers, who think it means "any object type".
|
|
73
|
-
- See [this comment for more information](https://github.com/typescript-eslint/typescript-eslint/issues/2063#issuecomment-675156492).
|
|
74
|
-
|
|
75
|
-
<details>
|
|
76
|
-
<summary>Default Options</summary>
|
|
77
|
-
|
|
78
|
-
```ts
|
|
79
|
-
const defaultTypes = {
|
|
80
|
-
String: {
|
|
81
|
-
message: 'Use string instead',
|
|
82
|
-
fixWith: 'string',
|
|
83
|
-
},
|
|
84
|
-
Boolean: {
|
|
85
|
-
message: 'Use boolean instead',
|
|
86
|
-
fixWith: 'boolean',
|
|
87
|
-
},
|
|
88
|
-
Number: {
|
|
89
|
-
message: 'Use number instead',
|
|
90
|
-
fixWith: 'number',
|
|
91
|
-
},
|
|
92
|
-
Symbol: {
|
|
93
|
-
message: 'Use symbol instead',
|
|
94
|
-
fixWith: 'symbol',
|
|
95
|
-
},
|
|
96
|
-
BigInt: {
|
|
97
|
-
message: 'Use bigint instead',
|
|
98
|
-
fixWith: 'bigint',
|
|
99
|
-
},
|
|
100
|
-
Function: {
|
|
101
|
-
message: [
|
|
102
|
-
'The `Function` type accepts any function-like value.',
|
|
103
|
-
'It provides no type safety when calling the function, which can be a common source of bugs.',
|
|
104
|
-
'It also accepts things like class declarations, which will throw at runtime as they will not be called with `new`.',
|
|
105
|
-
'If you are expecting the function to accept certain arguments, you should explicitly define the function shape.',
|
|
106
|
-
].join('\n'),
|
|
107
|
-
},
|
|
108
|
-
// object typing
|
|
109
|
-
Object: {
|
|
110
|
-
message: [
|
|
111
|
-
'The `Object` type actually means "any non-nullish value", so it is marginally better than `unknown`.',
|
|
112
|
-
'- If you want a type meaning "any object", you probably want `object` instead.',
|
|
113
|
-
'- If you want a type meaning "any value", you probably want `unknown` instead.',
|
|
114
|
-
'- If you really want a type meaning "any non-nullish value", you probably want `NonNullable<unknown>` instead.',
|
|
115
|
-
].join('\n'),
|
|
116
|
-
suggest: ['object', 'unknown', 'NonNullable<unknown>'],
|
|
117
|
-
},
|
|
118
|
-
'{}': {
|
|
119
|
-
message: [
|
|
120
|
-
'`{}` actually means "any non-nullish value".',
|
|
121
|
-
'- If you want a type meaning "any object", you probably want `object` instead.',
|
|
122
|
-
'- If you want a type meaning "any value", you probably want `unknown` instead.',
|
|
123
|
-
'- If you want a type meaning "empty object", you probably want `Record<string, never>` instead.',
|
|
124
|
-
'- If you really want a type meaning "any non-nullish value", you probably want `NonNullable<unknown>` instead.',
|
|
125
|
-
].join('\n'),
|
|
126
|
-
suggest: [
|
|
127
|
-
'object',
|
|
128
|
-
'unknown',
|
|
129
|
-
'Record<string, never>',
|
|
130
|
-
'NonNullable<unknown>',
|
|
131
|
-
],
|
|
132
|
-
},
|
|
133
|
-
};
|
|
134
|
-
```
|
|
135
|
-
|
|
136
|
-
</details>
|
|
137
|
-
|
|
138
|
-
### `types`
|
|
139
|
-
|
|
140
|
-
An object whose keys are the types you want to ban, and the values are error messages.
|
|
141
|
-
|
|
142
|
-
The type can either be a type name literal (`Foo`), a type name with generic parameter instantiation(s) (`Foo<Bar>`), the empty object literal (`{}`), or the empty tuple type (`[]`).
|
|
143
|
-
|
|
144
|
-
The values can be:
|
|
145
|
-
|
|
146
|
-
- A string, which is the error message to be reported; or
|
|
147
|
-
- `false` to specifically un-ban this type (useful when you are using `extendDefaults`); or
|
|
148
|
-
- An object with the following properties:
|
|
149
|
-
- `message: string` - the message to display when the type is matched.
|
|
150
|
-
- `fixWith?: string` - a string to replace the banned type with when the fixer is run. If this is omitted, no fix will be done.
|
|
151
|
-
- `suggest?: string[]` - a list of suggested replacements for the banned type.
|
|
152
|
-
|
|
153
|
-
### `extendDefaults`
|
|
154
|
-
|
|
155
|
-
If you're specifying custom `types`, you can set this to `true` to extend the default `types` configuration. This is a convenience option to save you copying across the defaults when adding another type.
|
|
156
|
-
|
|
157
|
-
If this is `false`, the rule will _only_ use the types defined in your configuration.
|
|
158
|
-
|
|
159
|
-
Example configuration:
|
|
160
|
-
|
|
161
|
-
```jsonc
|
|
162
|
-
{
|
|
163
|
-
"@typescript-eslint/ban-types": [
|
|
164
|
-
"error",
|
|
165
|
-
{
|
|
166
|
-
"types": {
|
|
167
|
-
// add a custom message to help explain why not to use it
|
|
168
|
-
"Foo": "Don't use Foo because it is unsafe",
|
|
169
|
-
|
|
170
|
-
// add a custom message, AND tell the plugin how to fix it
|
|
171
|
-
"OldAPI": {
|
|
172
|
-
"message": "Use NewAPI instead",
|
|
173
|
-
"fixWith": "NewAPI"
|
|
174
|
-
},
|
|
175
|
-
|
|
176
|
-
// un-ban a type that's banned by default
|
|
177
|
-
"{}": false
|
|
178
|
-
},
|
|
179
|
-
"extendDefaults": true
|
|
180
|
-
}
|
|
181
|
-
]
|
|
182
|
-
}
|
|
183
|
-
```
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: 'Disallow or enforce spaces inside of blocks after opening block and before closing block.'
|
|
3
|
-
---
|
|
4
|
-
|
|
5
|
-
> 🛑 This file is source code, not the primary documentation location! 🛑
|
|
6
|
-
>
|
|
7
|
-
> See **https://typescript-eslint.io/rules/block-spacing** for documentation.
|
|
8
|
-
|
|
9
|
-
## Examples
|
|
10
|
-
|
|
11
|
-
This rule extends the base [`eslint/block-spacing`](https://eslint.org/docs/rules/block-spacing) rule.
|
|
12
|
-
This version adds support for TypeScript related blocks (interfaces, object type literals and enums).
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: 'Enforce consistent brace style for blocks.'
|
|
3
|
-
---
|
|
4
|
-
|
|
5
|
-
> 🛑 This file is source code, not the primary documentation location! 🛑
|
|
6
|
-
>
|
|
7
|
-
> See **https://typescript-eslint.io/rules/brace-style** for documentation.
|
|
8
|
-
|
|
9
|
-
## Examples
|
|
10
|
-
|
|
11
|
-
This rule extends the base [`eslint/brace-style`](https://eslint.org/docs/rules/brace-style) rule.
|
|
12
|
-
It adds support for `enum`, `interface`, `namespace` and `module` declarations.
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
:::danger Deprecated
|
|
2
|
-
|
|
3
|
-
This rule has been deprecated in favour of the [`naming-convention`](./naming-convention.md) rule.
|
|
4
|
-
|
|
5
|
-
:::
|
|
6
|
-
|
|
7
|
-
<!--
|
|
8
|
-
This doc file has been left on purpose because `camelcase` is a core eslint rule.
|
|
9
|
-
This exists to help direct people to the replacement rule.
|
|
10
|
-
-->
|