@nr1e/commons 0.1.1-alpha.0 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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/develop +0 -2
- package/.git/logs/refs/remotes/origin/develop +0 -2
- package/.git/objects/07/c0af7cd711cab6a55ad3dc349ac8c70775623c +0 -0
- package/.git/objects/09/8fb5a5ff070a1ee3ea11db1a3568af3fea6fa2 +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/26/d9a4912af870ce319f5cb5102651d49baac4ab +0 -1
- 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/38/0be191ee415827a1217f46626fea4fefba48e5 +0 -0
- package/.git/objects/4c/bb28de66d7aaeb4d7737cc2be955adc0c886b5 +0 -0
- package/.git/objects/50/150b739272269be2ede552448013eba65323da +0 -0
- package/.git/objects/53/2b7b796ffd3223f913a5a5e1e17743ee3591fe +0 -0
- package/.git/objects/54/f13d9d62fbedd19b41134ba17153c4328de95b +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/6d/f39e776d6a89628ce4a005a011911298651635 +0 -0
- package/.git/objects/70/0e093acb1c1e55d523507411b7940a01a3bb65 +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/8d/d819967bdc8457f04c1b5498bce89380d6552b +0 -7
- 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/aa/8ae6a0af7014d738cc551d1ffebeb4e19e6b73 +0 -0
- package/.git/objects/ad/c418f9105db9ec488de6831584b82e3929eaef +0 -0
- package/.git/objects/ae/14b04cdf65ade0f70577cdea2f85203f4c1bde +0 -0
- package/.git/objects/b0/c1c68fbbad6b190434cd2bb0e807796bd56fca +0 -0
- package/.git/objects/b1/0f0d0ef3bc5aaf3a91be0b991cb6fe0fcadc40 +0 -0
- package/.git/objects/b1/3c15806ef3856ecd8660b0bb36f39830daa3c2 +0 -0
- package/.git/objects/b6/3b642cfb4254fc0f7058903abc5b481895c4ef +0 -0
- package/.git/objects/b8/a2c461d7ffed9d4ba242c58a52341832b99e0a +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/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/develop +0 -1
- package/.git/refs/remotes/origin/develop +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 -20
- 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/package.json +0 -72
- 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}/b64.test.d.mts +0 -0
- /package/{dist/bitsnbytes → bitsnbytes}/b64.test.d.mts.map +0 -0
- /package/{dist/bitsnbytes → bitsnbytes}/b64.test.mjs +0 -0
- /package/{dist/bitsnbytes → bitsnbytes}/b64.test.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}/errors.test.d.mts +0 -0
- /package/{dist/errors → errors}/errors.test.d.mts.map +0 -0
- /package/{dist/errors → errors}/errors.test.mjs +0 -0
- /package/{dist/errors → errors}/errors.test.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}/crypto-functions.test.d.mts +0 -0
- /package/{dist/oauth → oauth}/crypto-functions.test.d.mts.map +0 -0
- /package/{dist/oauth → oauth}/crypto-functions.test.mjs +0 -0
- /package/{dist/oauth → oauth}/crypto-functions.test.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
- /package/{dist/validator → validator}/validators.test.d.mts +0 -0
- /package/{dist/validator → validator}/validators.test.d.mts.map +0 -0
- /package/{dist/validator → validator}/validators.test.mjs +0 -0
- /package/{dist/validator → validator}/validators.test.mjs.map +0 -0
package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/explicit-member-accessibility.md
DELETED
|
@@ -1,331 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: 'Require explicit accessibility modifiers on class properties and methods.'
|
|
3
|
-
---
|
|
4
|
-
|
|
5
|
-
> 🛑 This file is source code, not the primary documentation location! 🛑
|
|
6
|
-
>
|
|
7
|
-
> See **https://typescript-eslint.io/rules/explicit-member-accessibility** for documentation.
|
|
8
|
-
|
|
9
|
-
TypeScript allows placing explicit `public`, `protected`, and `private` accessibility modifiers in front of class members.
|
|
10
|
-
The modifiers exist solely in the type system and just server to describe who is allowed to access those members.
|
|
11
|
-
|
|
12
|
-
Leaving off accessibility modifiers makes for less code to read and write.
|
|
13
|
-
Members are `public` by default.
|
|
14
|
-
|
|
15
|
-
However, adding in explicit accessibility modifiers can be helpful in codebases with many classes for enforcing proper privacy of members.
|
|
16
|
-
Some developers also find it preferable for code readability to keep member publicity explicit.
|
|
17
|
-
|
|
18
|
-
## Examples
|
|
19
|
-
|
|
20
|
-
This rule aims to make code more readable and explicit about who can use
|
|
21
|
-
which properties.
|
|
22
|
-
|
|
23
|
-
## Options
|
|
24
|
-
|
|
25
|
-
### Configuring in a mixed JS/TS codebase
|
|
26
|
-
|
|
27
|
-
If you are working on a codebase within which you lint non-TypeScript code (i.e. `.js`/`.mjs`/`.cjs`/`.jsx`), you should ensure that you should use [ESLint `overrides`](https://eslint.org/docs/user-guide/configuring#disabling-rules-only-for-a-group-of-files) to only enable the rule on `.ts`/`.mts`/`.cts`/`.tsx` files. If you don't, then you will get unfixable lint errors reported within `.js`/`.mjs`/`.cjs`/`.jsx` files.
|
|
28
|
-
|
|
29
|
-
```jsonc
|
|
30
|
-
{
|
|
31
|
-
"rules": {
|
|
32
|
-
// disable the rule for all files
|
|
33
|
-
"@typescript-eslint/explicit-member-accessibility": "off"
|
|
34
|
-
},
|
|
35
|
-
"overrides": [
|
|
36
|
-
{
|
|
37
|
-
// enable the rule specifically for TypeScript files
|
|
38
|
-
"files": ["*.ts", "*.mts", "*.cts", "*.tsx"],
|
|
39
|
-
"rules": {
|
|
40
|
-
"@typescript-eslint/explicit-member-accessibility": "error"
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
]
|
|
44
|
-
}
|
|
45
|
-
```
|
|
46
|
-
|
|
47
|
-
### `accessibility`
|
|
48
|
-
|
|
49
|
-
This rule in its default state requires no configuration and will enforce that every class member has an accessibility modifier. If you would like to allow for some implicit public members then you have the following options:
|
|
50
|
-
|
|
51
|
-
```ts
|
|
52
|
-
{
|
|
53
|
-
accessibility: 'explicit',
|
|
54
|
-
overrides: {
|
|
55
|
-
accessors: 'explicit',
|
|
56
|
-
constructors: 'no-public',
|
|
57
|
-
methods: 'explicit',
|
|
58
|
-
properties: 'off',
|
|
59
|
-
parameterProperties: 'explicit'
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
```
|
|
63
|
-
|
|
64
|
-
Note the above is an example of a possible configuration you could use - it is not the default configuration.
|
|
65
|
-
|
|
66
|
-
The following patterns are considered incorrect code if no options are provided:
|
|
67
|
-
|
|
68
|
-
```ts
|
|
69
|
-
class Animal {
|
|
70
|
-
constructor(name) {
|
|
71
|
-
// No accessibility modifier
|
|
72
|
-
this.animalName = name;
|
|
73
|
-
}
|
|
74
|
-
animalName: string; // No accessibility modifier
|
|
75
|
-
get name(): string {
|
|
76
|
-
// No accessibility modifier
|
|
77
|
-
return this.animalName;
|
|
78
|
-
}
|
|
79
|
-
set name(value: string) {
|
|
80
|
-
// No accessibility modifier
|
|
81
|
-
this.animalName = value;
|
|
82
|
-
}
|
|
83
|
-
walk() {
|
|
84
|
-
// method
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
```
|
|
88
|
-
|
|
89
|
-
The following patterns are considered correct with the default options `{ accessibility: 'explicit' }`:
|
|
90
|
-
|
|
91
|
-
```ts
|
|
92
|
-
class Animal {
|
|
93
|
-
public constructor(public breed, name) {
|
|
94
|
-
// Parameter property and constructor
|
|
95
|
-
this.animalName = name;
|
|
96
|
-
}
|
|
97
|
-
private animalName: string; // Property
|
|
98
|
-
get name(): string {
|
|
99
|
-
// get accessor
|
|
100
|
-
return this.animalName;
|
|
101
|
-
}
|
|
102
|
-
set name(value: string) {
|
|
103
|
-
// set accessor
|
|
104
|
-
this.animalName = value;
|
|
105
|
-
}
|
|
106
|
-
public walk() {
|
|
107
|
-
// method
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
```
|
|
111
|
-
|
|
112
|
-
The following patterns are considered incorrect with the accessibility set to **no-public** `[{ accessibility: 'no-public' }]`:
|
|
113
|
-
|
|
114
|
-
```ts
|
|
115
|
-
class Animal {
|
|
116
|
-
public constructor(public breed, name) {
|
|
117
|
-
// Parameter property and constructor
|
|
118
|
-
this.animalName = name;
|
|
119
|
-
}
|
|
120
|
-
public animalName: string; // Property
|
|
121
|
-
public get name(): string {
|
|
122
|
-
// get accessor
|
|
123
|
-
return this.animalName;
|
|
124
|
-
}
|
|
125
|
-
public set name(value: string) {
|
|
126
|
-
// set accessor
|
|
127
|
-
this.animalName = value;
|
|
128
|
-
}
|
|
129
|
-
public walk() {
|
|
130
|
-
// method
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
```
|
|
134
|
-
|
|
135
|
-
The following patterns are considered correct with the accessibility set to **no-public** `[{ accessibility: 'no-public' }]`:
|
|
136
|
-
|
|
137
|
-
```ts
|
|
138
|
-
class Animal {
|
|
139
|
-
constructor(protected breed, name) {
|
|
140
|
-
// Parameter property and constructor
|
|
141
|
-
this.name = name;
|
|
142
|
-
}
|
|
143
|
-
private animalName: string; // Property
|
|
144
|
-
get name(): string {
|
|
145
|
-
// get accessor
|
|
146
|
-
return this.animalName;
|
|
147
|
-
}
|
|
148
|
-
private set name(value: string) {
|
|
149
|
-
// set accessor
|
|
150
|
-
this.animalName = value;
|
|
151
|
-
}
|
|
152
|
-
protected walk() {
|
|
153
|
-
// method
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
```
|
|
157
|
-
|
|
158
|
-
### Overrides
|
|
159
|
-
|
|
160
|
-
There are three ways in which an override can be used.
|
|
161
|
-
|
|
162
|
-
- To disallow the use of public on a given member.
|
|
163
|
-
- To enforce explicit member accessibility when the root has allowed implicit public accessibility
|
|
164
|
-
- To disable any checks on given member type
|
|
165
|
-
|
|
166
|
-
#### Disallow the use of public on a given member
|
|
167
|
-
|
|
168
|
-
e.g. `[ { overrides: { constructors: 'no-public' } } ]`
|
|
169
|
-
|
|
170
|
-
The following patterns are considered incorrect with the example override
|
|
171
|
-
|
|
172
|
-
```ts
|
|
173
|
-
class Animal {
|
|
174
|
-
public constructor(protected animalName) {}
|
|
175
|
-
public get name() {
|
|
176
|
-
return this.animalName;
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
```
|
|
180
|
-
|
|
181
|
-
The following patterns are considered correct with the example override
|
|
182
|
-
|
|
183
|
-
```ts
|
|
184
|
-
class Animal {
|
|
185
|
-
constructor(protected animalName) {}
|
|
186
|
-
public get name() {
|
|
187
|
-
return this.animalName;
|
|
188
|
-
}
|
|
189
|
-
}
|
|
190
|
-
```
|
|
191
|
-
|
|
192
|
-
#### Require explicit accessibility for a given member
|
|
193
|
-
|
|
194
|
-
e.g. `[ { accessibility: 'no-public', overrides: { properties: 'explicit' } } ]`
|
|
195
|
-
|
|
196
|
-
The following patterns are considered incorrect with the example override
|
|
197
|
-
|
|
198
|
-
```ts
|
|
199
|
-
class Animal {
|
|
200
|
-
constructor(protected animalName) {}
|
|
201
|
-
get name() {
|
|
202
|
-
return this.animalName;
|
|
203
|
-
}
|
|
204
|
-
protected set name(value: string) {
|
|
205
|
-
this.animalName = value;
|
|
206
|
-
}
|
|
207
|
-
legs: number;
|
|
208
|
-
private hasFleas: boolean;
|
|
209
|
-
}
|
|
210
|
-
```
|
|
211
|
-
|
|
212
|
-
The following patterns are considered correct with the example override
|
|
213
|
-
|
|
214
|
-
```ts
|
|
215
|
-
class Animal {
|
|
216
|
-
constructor(protected animalName) {}
|
|
217
|
-
get name() {
|
|
218
|
-
return this.animalName;
|
|
219
|
-
}
|
|
220
|
-
protected set name(value: string) {
|
|
221
|
-
this.animalName = value;
|
|
222
|
-
}
|
|
223
|
-
public legs: number;
|
|
224
|
-
private hasFleas: boolean;
|
|
225
|
-
}
|
|
226
|
-
```
|
|
227
|
-
|
|
228
|
-
e.g. `[ { accessibility: 'off', overrides: { parameterProperties: 'explicit' } } ]`
|
|
229
|
-
|
|
230
|
-
The following code is considered incorrect with the example override
|
|
231
|
-
|
|
232
|
-
```ts
|
|
233
|
-
class Animal {
|
|
234
|
-
constructor(readonly animalName: string) {}
|
|
235
|
-
}
|
|
236
|
-
```
|
|
237
|
-
|
|
238
|
-
The following code patterns are considered correct with the example override
|
|
239
|
-
|
|
240
|
-
```ts
|
|
241
|
-
class Animal {
|
|
242
|
-
constructor(public readonly animalName: string) {}
|
|
243
|
-
}
|
|
244
|
-
|
|
245
|
-
class Animal {
|
|
246
|
-
constructor(public animalName: string) {}
|
|
247
|
-
}
|
|
248
|
-
|
|
249
|
-
class Animal {
|
|
250
|
-
constructor(animalName: string) {}
|
|
251
|
-
}
|
|
252
|
-
```
|
|
253
|
-
|
|
254
|
-
e.g. `[ { accessibility: 'off', overrides: { parameterProperties: 'no-public' } } ]`
|
|
255
|
-
|
|
256
|
-
The following code is considered incorrect with the example override
|
|
257
|
-
|
|
258
|
-
```ts
|
|
259
|
-
class Animal {
|
|
260
|
-
constructor(public readonly animalName: string) {}
|
|
261
|
-
}
|
|
262
|
-
```
|
|
263
|
-
|
|
264
|
-
The following code is considered correct with the example override
|
|
265
|
-
|
|
266
|
-
```ts
|
|
267
|
-
class Animal {
|
|
268
|
-
constructor(public animalName: string) {}
|
|
269
|
-
}
|
|
270
|
-
```
|
|
271
|
-
|
|
272
|
-
#### Disable any checks on given member type
|
|
273
|
-
|
|
274
|
-
e.g. `[{ overrides: { accessors : 'off' } } ]`
|
|
275
|
-
|
|
276
|
-
As no checks on the overridden member type are performed all permutations of visibility are permitted for that member type
|
|
277
|
-
|
|
278
|
-
The follow pattern is considered incorrect for the given configuration
|
|
279
|
-
|
|
280
|
-
```ts
|
|
281
|
-
class Animal {
|
|
282
|
-
constructor(protected animalName) {}
|
|
283
|
-
public get name() {
|
|
284
|
-
return this.animalName;
|
|
285
|
-
}
|
|
286
|
-
get legs() {
|
|
287
|
-
return this.legCount;
|
|
288
|
-
}
|
|
289
|
-
}
|
|
290
|
-
```
|
|
291
|
-
|
|
292
|
-
The following patterns are considered correct with the example override
|
|
293
|
-
|
|
294
|
-
```ts
|
|
295
|
-
class Animal {
|
|
296
|
-
public constructor(protected animalName) {}
|
|
297
|
-
public get name() {
|
|
298
|
-
return this.animalName;
|
|
299
|
-
}
|
|
300
|
-
get legs() {
|
|
301
|
-
return this.legCount;
|
|
302
|
-
}
|
|
303
|
-
}
|
|
304
|
-
```
|
|
305
|
-
|
|
306
|
-
### Except specific methods
|
|
307
|
-
|
|
308
|
-
If you want to ignore some specific methods, you can do it by specifying method names. Note that this option does not care for the context, and will ignore every method with these names, which could lead to it missing some cases. You should use this sparingly.
|
|
309
|
-
e.g. `[ { ignoredMethodNames: ['specificMethod', 'whateverMethod'] } ]`
|
|
310
|
-
|
|
311
|
-
```ts
|
|
312
|
-
class Animal {
|
|
313
|
-
get specificMethod() {
|
|
314
|
-
console.log('No error because you specified this method on option');
|
|
315
|
-
}
|
|
316
|
-
get whateverMethod() {
|
|
317
|
-
console.log('No error because you specified this method on option');
|
|
318
|
-
}
|
|
319
|
-
public get otherMethod() {
|
|
320
|
-
console.log('This method comply with this rule');
|
|
321
|
-
}
|
|
322
|
-
}
|
|
323
|
-
```
|
|
324
|
-
|
|
325
|
-
## When Not To Use It
|
|
326
|
-
|
|
327
|
-
If you think defaulting to public is a good default, then you should consider using the `no-public` setting. If you want to mix implicit and explicit public members then disable this rule.
|
|
328
|
-
|
|
329
|
-
## Further Reading
|
|
330
|
-
|
|
331
|
-
- TypeScript [Accessibility Modifiers Handbook Docs](https://www.typescriptlang.org/docs/handbook/2/classes.html#member-visibility)
|
package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/explicit-module-boundary-types.md
DELETED
|
@@ -1,250 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: "Require explicit return and argument types on exported functions' and classes' public class methods."
|
|
3
|
-
---
|
|
4
|
-
|
|
5
|
-
> 🛑 This file is source code, not the primary documentation location! 🛑
|
|
6
|
-
>
|
|
7
|
-
> See **https://typescript-eslint.io/rules/explicit-module-boundary-types** for documentation.
|
|
8
|
-
|
|
9
|
-
Explicit types for function return values and arguments makes it clear to any calling code what is the module boundary's input and output.
|
|
10
|
-
Adding explicit type annotations for those types can help improve code readability.
|
|
11
|
-
It can also improve TypeScript type checking performance on larger codebases.
|
|
12
|
-
|
|
13
|
-
## Examples
|
|
14
|
-
|
|
15
|
-
<!--tabs-->
|
|
16
|
-
|
|
17
|
-
### ❌ Incorrect
|
|
18
|
-
|
|
19
|
-
```ts
|
|
20
|
-
// Should indicate that no value is returned (void)
|
|
21
|
-
export function test() {
|
|
22
|
-
return;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
// Should indicate that a number is returned
|
|
26
|
-
export default function () {
|
|
27
|
-
return 1;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
// Should indicate that a string is returned
|
|
31
|
-
export var arrowFn = () => 'test';
|
|
32
|
-
|
|
33
|
-
// All arguments should be typed
|
|
34
|
-
export var arrowFn = (arg): string => `test ${arg}`;
|
|
35
|
-
export var arrowFn = (arg: any): string => `test ${arg}`;
|
|
36
|
-
|
|
37
|
-
export class Test {
|
|
38
|
-
// Should indicate that no value is returned (void)
|
|
39
|
-
method() {
|
|
40
|
-
return;
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
```
|
|
44
|
-
|
|
45
|
-
### ✅ Correct
|
|
46
|
-
|
|
47
|
-
```ts
|
|
48
|
-
// Function is not exported
|
|
49
|
-
function test() {
|
|
50
|
-
return;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
// A return value of type number
|
|
54
|
-
export var fn = function (): number {
|
|
55
|
-
return 1;
|
|
56
|
-
};
|
|
57
|
-
|
|
58
|
-
// A return value of type string
|
|
59
|
-
export var arrowFn = (): string => 'test';
|
|
60
|
-
|
|
61
|
-
// All arguments should be typed
|
|
62
|
-
export var arrowFn = (arg: string): string => `test ${arg}`;
|
|
63
|
-
export var arrowFn = (arg: unknown): string => `test ${arg}`;
|
|
64
|
-
|
|
65
|
-
// Class is not exported
|
|
66
|
-
class Test {
|
|
67
|
-
method() {
|
|
68
|
-
return;
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
```
|
|
72
|
-
|
|
73
|
-
## Options
|
|
74
|
-
|
|
75
|
-
### Configuring in a mixed JS/TS codebase
|
|
76
|
-
|
|
77
|
-
If you are working on a codebase within which you lint non-TypeScript code (i.e. `.js`/`.mjs`/`.cjs`/`.jsx`), you should ensure that you should use [ESLint `overrides`](https://eslint.org/docs/user-guide/configuring#disabling-rules-only-for-a-group-of-files) to only enable the rule on `.ts`/`.mts`/`.cts`/`.tsx` files. If you don't, then you will get unfixable lint errors reported within `.js`/`.mjs`/`.cjs`/`.jsx` files.
|
|
78
|
-
|
|
79
|
-
```jsonc
|
|
80
|
-
{
|
|
81
|
-
"rules": {
|
|
82
|
-
// disable the rule for all files
|
|
83
|
-
"@typescript-eslint/explicit-module-boundary-types": "off"
|
|
84
|
-
},
|
|
85
|
-
"overrides": [
|
|
86
|
-
{
|
|
87
|
-
// enable the rule specifically for TypeScript files
|
|
88
|
-
"files": ["*.ts", "*.mts", "*.cts", "*.tsx"],
|
|
89
|
-
"rules": {
|
|
90
|
-
"@typescript-eslint/explicit-module-boundary-types": "error"
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
]
|
|
94
|
-
}
|
|
95
|
-
```
|
|
96
|
-
|
|
97
|
-
### `allowArgumentsExplicitlyTypedAsAny`
|
|
98
|
-
|
|
99
|
-
Examples of code for this rule with `{ allowArgumentsExplicitlyTypedAsAny: false }`:
|
|
100
|
-
|
|
101
|
-
<!--tabs-->
|
|
102
|
-
|
|
103
|
-
#### ❌ Incorrect
|
|
104
|
-
|
|
105
|
-
```ts
|
|
106
|
-
export const func = (value: any): number => value + 1;
|
|
107
|
-
```
|
|
108
|
-
|
|
109
|
-
#### ✅ Correct
|
|
110
|
-
|
|
111
|
-
```ts
|
|
112
|
-
export const func = (value: number): number => value + 1;
|
|
113
|
-
```
|
|
114
|
-
|
|
115
|
-
### `allowDirectConstAssertionInArrowFunctions`
|
|
116
|
-
|
|
117
|
-
Examples of code for this rule with `{ allowDirectConstAssertionInArrowFunctions: false }`:
|
|
118
|
-
|
|
119
|
-
<!--tabs-->
|
|
120
|
-
|
|
121
|
-
#### ❌ Incorrect
|
|
122
|
-
|
|
123
|
-
```ts
|
|
124
|
-
export const func = (value: number) => ({ type: 'X', value });
|
|
125
|
-
export const foo = () => ({
|
|
126
|
-
bar: true,
|
|
127
|
-
});
|
|
128
|
-
export const bar = () => 1;
|
|
129
|
-
```
|
|
130
|
-
|
|
131
|
-
#### ✅ Correct
|
|
132
|
-
|
|
133
|
-
```ts
|
|
134
|
-
export const func = (value: number) => ({ type: 'X', value } as const);
|
|
135
|
-
export const foo = () =>
|
|
136
|
-
({
|
|
137
|
-
bar: true,
|
|
138
|
-
} as const);
|
|
139
|
-
export const bar = () => 1 as const;
|
|
140
|
-
```
|
|
141
|
-
|
|
142
|
-
### `allowedNames`
|
|
143
|
-
|
|
144
|
-
You may pass function/method names you would like this rule to ignore, like so:
|
|
145
|
-
|
|
146
|
-
```json
|
|
147
|
-
{
|
|
148
|
-
"@typescript-eslint/explicit-module-boundary-types": [
|
|
149
|
-
"error",
|
|
150
|
-
{
|
|
151
|
-
"allowedNames": ["ignoredFunctionName", "ignoredMethodName"]
|
|
152
|
-
}
|
|
153
|
-
]
|
|
154
|
-
}
|
|
155
|
-
```
|
|
156
|
-
|
|
157
|
-
### `allowHigherOrderFunctions`
|
|
158
|
-
|
|
159
|
-
Examples of code for this rule with `{ allowHigherOrderFunctions: false }`:
|
|
160
|
-
|
|
161
|
-
<!--tabs-->
|
|
162
|
-
|
|
163
|
-
#### ❌ Incorrect
|
|
164
|
-
|
|
165
|
-
```ts
|
|
166
|
-
export const arrowFn = () => () => {};
|
|
167
|
-
|
|
168
|
-
export function fn() {
|
|
169
|
-
return function () {};
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
export function foo(outer: string) {
|
|
173
|
-
return function (inner: string) {};
|
|
174
|
-
}
|
|
175
|
-
```
|
|
176
|
-
|
|
177
|
-
#### ✅ Correct
|
|
178
|
-
|
|
179
|
-
```ts
|
|
180
|
-
export const arrowFn = () => (): void => {};
|
|
181
|
-
|
|
182
|
-
export function fn() {
|
|
183
|
-
return function (): void {};
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
export function foo(outer: string) {
|
|
187
|
-
return function (inner: string): void {};
|
|
188
|
-
}
|
|
189
|
-
```
|
|
190
|
-
|
|
191
|
-
### `allowTypedFunctionExpressions`
|
|
192
|
-
|
|
193
|
-
Examples of code for this rule with `{ allowTypedFunctionExpressions: false }`:
|
|
194
|
-
|
|
195
|
-
<!--tabs-->
|
|
196
|
-
|
|
197
|
-
#### ❌ Incorrect
|
|
198
|
-
|
|
199
|
-
```ts
|
|
200
|
-
export let arrowFn = () => 'test';
|
|
201
|
-
|
|
202
|
-
export let funcExpr = function () {
|
|
203
|
-
return 'test';
|
|
204
|
-
};
|
|
205
|
-
|
|
206
|
-
export let objectProp = {
|
|
207
|
-
foo: () => 1,
|
|
208
|
-
};
|
|
209
|
-
|
|
210
|
-
export const foo = bar => {};
|
|
211
|
-
```
|
|
212
|
-
|
|
213
|
-
#### ✅ Correct
|
|
214
|
-
|
|
215
|
-
```ts
|
|
216
|
-
type FuncType = () => string;
|
|
217
|
-
|
|
218
|
-
export let arrowFn: FuncType = () => 'test';
|
|
219
|
-
|
|
220
|
-
export let funcExpr: FuncType = function () {
|
|
221
|
-
return 'test';
|
|
222
|
-
};
|
|
223
|
-
|
|
224
|
-
export let asTyped = (() => '') as () => string;
|
|
225
|
-
export let castTyped = <() => string>(() => '');
|
|
226
|
-
|
|
227
|
-
interface ObjectType {
|
|
228
|
-
foo(): number;
|
|
229
|
-
}
|
|
230
|
-
export let objectProp: ObjectType = {
|
|
231
|
-
foo: () => 1,
|
|
232
|
-
};
|
|
233
|
-
export let objectPropAs = {
|
|
234
|
-
foo: () => 1,
|
|
235
|
-
} as ObjectType;
|
|
236
|
-
export let objectPropCast = <ObjectType>{
|
|
237
|
-
foo: () => 1,
|
|
238
|
-
};
|
|
239
|
-
|
|
240
|
-
type FooType = (bar: string) => void;
|
|
241
|
-
export const foo: FooType = bar => {};
|
|
242
|
-
```
|
|
243
|
-
|
|
244
|
-
## When Not To Use It
|
|
245
|
-
|
|
246
|
-
If you wish to make sure all functions have explicit return types, as opposed to only the module boundaries, you can use [explicit-function-return-type](./explicit-function-return-type.md)
|
|
247
|
-
|
|
248
|
-
## Further Reading
|
|
249
|
-
|
|
250
|
-
- TypeScript [Functions](https://www.typescriptlang.org/docs/handbook/functions.html#function-types)
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: 'Require or disallow spacing between function identifiers and their invocations.'
|
|
3
|
-
---
|
|
4
|
-
|
|
5
|
-
> 🛑 This file is source code, not the primary documentation location! 🛑
|
|
6
|
-
>
|
|
7
|
-
> See **https://typescript-eslint.io/rules/func-call-spacing** for documentation.
|
|
8
|
-
|
|
9
|
-
## Examples
|
|
10
|
-
|
|
11
|
-
This rule extends the base [`eslint/func-call-spacing`](https://eslint.org/docs/rules/func-call-spacing) rule.
|
|
12
|
-
It adds support for generic type parameters on function calls.
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: 'Enforce consistent indentation.'
|
|
3
|
-
---
|
|
4
|
-
|
|
5
|
-
> 🛑 This file is source code, not the primary documentation location! 🛑
|
|
6
|
-
>
|
|
7
|
-
> See **https://typescript-eslint.io/rules/indent** for documentation.
|
|
8
|
-
|
|
9
|
-
## Warning
|
|
10
|
-
|
|
11
|
-
:::warning
|
|
12
|
-
|
|
13
|
-
Please read [Issue #1824: Problems with the indent rule](https://github.com/typescript-eslint/typescript-eslint/issues/1824) before using this rule!
|
|
14
|
-
|
|
15
|
-
:::
|
|
16
|
-
|
|
17
|
-
## Examples
|
|
18
|
-
|
|
19
|
-
This rule extends the base [`eslint/indent`](https://eslint.org/docs/rules/indent) rule.
|
|
20
|
-
It adds support for TypeScript nodes.
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: 'Require or disallow initialization in variable declarations.'
|
|
3
|
-
---
|
|
4
|
-
|
|
5
|
-
> 🛑 This file is source code, not the primary documentation location! 🛑
|
|
6
|
-
>
|
|
7
|
-
> See **https://typescript-eslint.io/rules/init-declarations** for documentation.
|
|
8
|
-
|
|
9
|
-
## Examples
|
|
10
|
-
|
|
11
|
-
This rule extends the base [`eslint/init-declarations`](https://eslint.org/docs/rules/init-declarations) rule.
|
|
12
|
-
It adds support for TypeScript's `declare` variables.
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: 'Enforce consistent spacing between property names and type annotations in types and interfaces.'
|
|
3
|
-
---
|
|
4
|
-
|
|
5
|
-
> 🛑 This file is source code, not the primary documentation location! 🛑
|
|
6
|
-
>
|
|
7
|
-
> See **https://typescript-eslint.io/rules/key-spacing** for documentation.
|
|
8
|
-
|
|
9
|
-
## Examples
|
|
10
|
-
|
|
11
|
-
This rule extends the base [`eslint/key-spacing`](https://eslint.org/docs/rules/key-spacing) rule.
|
|
12
|
-
This version adds support for type annotations on interfaces, classes and type literals properties.
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: 'Enforce consistent spacing before and after keywords.'
|
|
3
|
-
---
|
|
4
|
-
|
|
5
|
-
> 🛑 This file is source code, not the primary documentation location! 🛑
|
|
6
|
-
>
|
|
7
|
-
> See **https://typescript-eslint.io/rules/keyword-spacing** for documentation.
|
|
8
|
-
|
|
9
|
-
## Examples
|
|
10
|
-
|
|
11
|
-
This rule extends the base [`eslint/keyword-spacing`](https://eslint.org/docs/rules/keyword-spacing) rule.
|
|
12
|
-
This version adds support for generic type parameters on function calls.
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: 'Require empty lines around comments.'
|
|
3
|
-
---
|
|
4
|
-
|
|
5
|
-
> 🛑 This file is source code, not the primary documentation location! 🛑
|
|
6
|
-
>
|
|
7
|
-
> See **https://typescript-eslint.io/rules/lines-around-comment** for documentation.
|
|
8
|
-
|
|
9
|
-
## Rule Details
|
|
10
|
-
|
|
11
|
-
This rule extends the base [`eslint/lines-around-comment`](https://eslint.org/docs/rules/lines-around-comment) rule.
|
|
12
|
-
It adds support for TypeScript syntax.
|
|
13
|
-
|
|
14
|
-
See the [ESLint documentation](https://eslint.org/docs/rules/lines-around-comment) for more details on the `comma-dangle` rule.
|
|
15
|
-
|
|
16
|
-
## Rule Changes
|
|
17
|
-
|
|
18
|
-
```jsonc
|
|
19
|
-
{
|
|
20
|
-
// note you must disable the base rule as it can report incorrect errors
|
|
21
|
-
"lines-around-comment": "off",
|
|
22
|
-
"@typescript-eslint/lines-around-comment": ["error"]
|
|
23
|
-
}
|
|
24
|
-
```
|
|
25
|
-
|
|
26
|
-
## Options
|
|
27
|
-
|
|
28
|
-
In addition to the options supported by the `lines-around-comment` rule in ESLint core, the rule adds the following options:
|
|
29
|
-
|
|
30
|
-
- `allowEnumEnd: true` doesn't require a blank line after an enum body block end
|
|
31
|
-
- `allowEnumStart: true` doesn't require a blank line before an enum body block start
|
|
32
|
-
- `allowInterfaceEnd: true` doesn't require a blank line before an interface body block end
|
|
33
|
-
- `allowInterfaceStart: true` doesn't require a blank line after an interface body block start
|
|
34
|
-
- `allowModuleEnd: true` doesn't require a blank line before a module body block end
|
|
35
|
-
- `allowModuleStart: true` doesn't require a blank line after a module body block start
|
|
36
|
-
- `allowTypeEnd: true` doesn't require a blank line before a type literal block end
|
|
37
|
-
- `allowTypeStart: true` doesn't require a blank line after a type literal block start
|