eslint-plugin-etc-misc 1.0.1
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/CHANGELOG.md +23 -0
- package/LICENSE +21 -0
- package/README.md +259 -0
- package/dist/_internal/casing.d.ts +13 -0
- package/dist/_internal/casing.d.ts.map +1 -0
- package/dist/_internal/casing.js +34 -0
- package/dist/_internal/casing.js.map +1 -0
- package/dist/_internal/create-external-rule.d.ts +12 -0
- package/dist/_internal/create-external-rule.d.ts.map +1 -0
- package/dist/_internal/create-external-rule.js +66 -0
- package/dist/_internal/create-external-rule.js.map +1 -0
- package/dist/_internal/create-import-pattern-rule.d.ts +39 -0
- package/dist/_internal/create-import-pattern-rule.d.ts.map +1 -0
- package/dist/_internal/create-import-pattern-rule.js +67 -0
- package/dist/_internal/create-import-pattern-rule.js.map +1 -0
- package/dist/_internal/create-selector-rule.d.ts +18 -0
- package/dist/_internal/create-selector-rule.d.ts.map +1 -0
- package/dist/_internal/create-selector-rule.js +31 -0
- package/dist/_internal/create-selector-rule.js.map +1 -0
- package/dist/_internal/get-core-rule.d.ts +8 -0
- package/dist/_internal/get-core-rule.d.ts.map +1 -0
- package/dist/_internal/get-core-rule.js +14 -0
- package/dist/_internal/get-core-rule.js.map +1 -0
- package/dist/_internal/identifier-blocks.d.ts +10 -0
- package/dist/_internal/identifier-blocks.d.ts.map +1 -0
- package/dist/_internal/identifier-blocks.js +24 -0
- package/dist/_internal/identifier-blocks.js.map +1 -0
- package/dist/_internal/ignore-patterns.d.ts +26 -0
- package/dist/_internal/ignore-patterns.d.ts.map +1 -0
- package/dist/_internal/ignore-patterns.js +35 -0
- package/dist/_internal/ignore-patterns.js.map +1 -0
- package/dist/_internal/import-patterns.d.ts +30 -0
- package/dist/_internal/import-patterns.d.ts.map +1 -0
- package/dist/_internal/import-patterns.js +52 -0
- package/dist/_internal/import-patterns.js.map +1 -0
- package/dist/_internal/plugin-meta.d.ts +13 -0
- package/dist/_internal/plugin-meta.d.ts.map +1 -0
- package/dist/_internal/plugin-meta.js +9 -0
- package/dist/_internal/plugin-meta.js.map +1 -0
- package/dist/_internal/rule-catalog.d.ts +36 -0
- package/dist/_internal/rule-catalog.d.ts.map +1 -0
- package/dist/_internal/rule-catalog.js +49 -0
- package/dist/_internal/rule-catalog.js.map +1 -0
- package/dist/_internal/rule-creator.d.ts +26 -0
- package/dist/_internal/rule-creator.d.ts.map +1 -0
- package/dist/_internal/rule-creator.js +14 -0
- package/dist/_internal/rule-creator.js.map +1 -0
- package/dist/_internal/rule-deprecation.d.ts +32 -0
- package/dist/_internal/rule-deprecation.d.ts.map +1 -0
- package/dist/_internal/rule-deprecation.js +38 -0
- package/dist/_internal/rule-deprecation.js.map +1 -0
- package/dist/_internal/symbol-usage.d.ts +25 -0
- package/dist/_internal/symbol-usage.d.ts.map +1 -0
- package/dist/_internal/symbol-usage.js +82 -0
- package/dist/_internal/symbol-usage.js.map +1 -0
- package/dist/_internal/syntax-selectors.d.ts +24 -0
- package/dist/_internal/syntax-selectors.d.ts.map +1 -0
- package/dist/_internal/syntax-selectors.js +30 -0
- package/dist/_internal/syntax-selectors.js.map +1 -0
- package/dist/configs/all-strict.d.ts +11 -0
- package/dist/configs/all-strict.d.ts.map +1 -0
- package/dist/configs/all-strict.js +16 -0
- package/dist/configs/all-strict.js.map +1 -0
- package/dist/configs/all.d.ts +10 -0
- package/dist/configs/all.d.ts.map +1 -0
- package/dist/configs/all.js +18 -0
- package/dist/configs/all.js.map +1 -0
- package/dist/configs/recommended.d.ts +29 -0
- package/dist/configs/recommended.d.ts.map +1 -0
- package/dist/configs/recommended.js +29 -0
- package/dist/configs/recommended.js.map +1 -0
- package/dist/configs/strict-type-checked.d.ts +15 -0
- package/dist/configs/strict-type-checked.d.ts.map +1 -0
- package/dist/configs/strict-type-checked.js +38 -0
- package/dist/configs/strict-type-checked.js.map +1 -0
- package/dist/configs/strict.d.ts +13 -0
- package/dist/configs/strict.d.ts.map +1 -0
- package/dist/configs/strict.js +10 -0
- package/dist/configs/strict.js.map +1 -0
- package/dist/configs.d.ts +34 -0
- package/dist/configs.d.ts.map +1 -0
- package/dist/configs.js +33 -0
- package/dist/configs.js.map +1 -0
- package/dist/plugin.cjs +4 -0
- package/dist/plugin.d.cts +2 -0
- package/dist/plugin.d.ts +15 -0
- package/dist/plugin.d.ts.map +1 -0
- package/dist/plugin.js +14 -0
- package/dist/plugin.js.map +1 -0
- package/dist/rules/array-type.d.ts +8 -0
- package/dist/rules/array-type.d.ts.map +1 -0
- package/dist/rules/array-type.js +25 -0
- package/dist/rules/array-type.js.map +1 -0
- package/dist/rules/class-match-filename.d.ts +9 -0
- package/dist/rules/class-match-filename.d.ts.map +1 -0
- package/dist/rules/class-match-filename.js +51 -0
- package/dist/rules/class-match-filename.js.map +1 -0
- package/dist/rules/comment-spacing.d.ts +9 -0
- package/dist/rules/comment-spacing.d.ts.map +1 -0
- package/dist/rules/comment-spacing.js +63 -0
- package/dist/rules/comment-spacing.js.map +1 -0
- package/dist/rules/consistent-empty-lines.d.ts +9 -0
- package/dist/rules/consistent-empty-lines.d.ts.map +1 -0
- package/dist/rules/consistent-empty-lines.js +74 -0
- package/dist/rules/consistent-empty-lines.js.map +1 -0
- package/dist/rules/consistent-enum-members.d.ts +9 -0
- package/dist/rules/consistent-enum-members.d.ts.map +1 -0
- package/dist/rules/consistent-enum-members.js +36 -0
- package/dist/rules/consistent-enum-members.js.map +1 -0
- package/dist/rules/consistent-filename.d.ts +18 -0
- package/dist/rules/consistent-filename.d.ts.map +1 -0
- package/dist/rules/consistent-filename.js +87 -0
- package/dist/rules/consistent-filename.js.map +1 -0
- package/dist/rules/consistent-import.d.ts +14 -0
- package/dist/rules/consistent-import.d.ts.map +1 -0
- package/dist/rules/consistent-import.js +91 -0
- package/dist/rules/consistent-import.js.map +1 -0
- package/dist/rules/consistent-optional-props.d.ts +9 -0
- package/dist/rules/consistent-optional-props.d.ts.map +1 -0
- package/dist/rules/consistent-optional-props.js +68 -0
- package/dist/rules/consistent-optional-props.js.map +1 -0
- package/dist/rules/consistent-source-extension.d.ts +14 -0
- package/dist/rules/consistent-source-extension.d.ts.map +1 -0
- package/dist/rules/consistent-source-extension.js +56 -0
- package/dist/rules/consistent-source-extension.js.map +1 -0
- package/dist/rules/consistent-symbol-description.d.ts +9 -0
- package/dist/rules/consistent-symbol-description.d.ts.map +1 -0
- package/dist/rules/consistent-symbol-description.js +36 -0
- package/dist/rules/consistent-symbol-description.js.map +1 -0
- package/dist/rules/default-case.d.ts +7 -0
- package/dist/rules/default-case.d.ts.map +1 -0
- package/dist/rules/default-case.js +9 -0
- package/dist/rules/default-case.js.map +1 -0
- package/dist/rules/disallow-import.d.ts +7 -0
- package/dist/rules/disallow-import.d.ts.map +1 -0
- package/dist/rules/disallow-import.js +11 -0
- package/dist/rules/disallow-import.js.map +1 -0
- package/dist/rules/export-matching-filename-only.d.ts +14 -0
- package/dist/rules/export-matching-filename-only.d.ts.map +1 -0
- package/dist/rules/export-matching-filename-only.js +102 -0
- package/dist/rules/export-matching-filename-only.js.map +1 -0
- package/dist/rules/match-filename.d.ts +18 -0
- package/dist/rules/match-filename.d.ts.map +1 -0
- package/dist/rules/match-filename.js +119 -0
- package/dist/rules/match-filename.js.map +1 -0
- package/dist/rules/max-identifier-blocks.d.ts +9 -0
- package/dist/rules/max-identifier-blocks.d.ts.map +1 -0
- package/dist/rules/max-identifier-blocks.js +46 -0
- package/dist/rules/max-identifier-blocks.js.map +1 -0
- package/dist/rules/no-assign-mutated-array.d.ts +9 -0
- package/dist/rules/no-assign-mutated-array.d.ts.map +1 -0
- package/dist/rules/no-assign-mutated-array.js +117 -0
- package/dist/rules/no-assign-mutated-array.js.map +1 -0
- package/dist/rules/no-at-sign-import.d.ts +7 -0
- package/dist/rules/no-at-sign-import.d.ts.map +1 -0
- package/dist/rules/no-at-sign-import.js +11 -0
- package/dist/rules/no-at-sign-import.js.map +1 -0
- package/dist/rules/no-at-sign-internal-import.d.ts +7 -0
- package/dist/rules/no-at-sign-internal-import.d.ts.map +1 -0
- package/dist/rules/no-at-sign-internal-import.js +11 -0
- package/dist/rules/no-at-sign-internal-import.js.map +1 -0
- package/dist/rules/no-chain-coalescence-mixture.d.ts +10 -0
- package/dist/rules/no-chain-coalescence-mixture.d.ts.map +1 -0
- package/dist/rules/no-chain-coalescence-mixture.js +36 -0
- package/dist/rules/no-chain-coalescence-mixture.js.map +1 -0
- package/dist/rules/no-commented-out-code.d.ts +13 -0
- package/dist/rules/no-commented-out-code.d.ts.map +1 -0
- package/dist/rules/no-commented-out-code.js +220 -0
- package/dist/rules/no-commented-out-code.js.map +1 -0
- package/dist/rules/no-const-enum.d.ts +13 -0
- package/dist/rules/no-const-enum.d.ts.map +1 -0
- package/dist/rules/no-const-enum.js +90 -0
- package/dist/rules/no-const-enum.js.map +1 -0
- package/dist/rules/no-deprecated.d.ts +18 -0
- package/dist/rules/no-deprecated.d.ts.map +1 -0
- package/dist/rules/no-deprecated.js +133 -0
- package/dist/rules/no-deprecated.js.map +1 -0
- package/dist/rules/no-enum.d.ts +8 -0
- package/dist/rules/no-enum.d.ts.map +1 -0
- package/dist/rules/no-enum.js +34 -0
- package/dist/rules/no-enum.js.map +1 -0
- package/dist/rules/no-expression-empty-lines.d.ts +9 -0
- package/dist/rules/no-expression-empty-lines.d.ts.map +1 -0
- package/dist/rules/no-expression-empty-lines.js +51 -0
- package/dist/rules/no-expression-empty-lines.js.map +1 -0
- package/dist/rules/no-foreach.d.ts +13 -0
- package/dist/rules/no-foreach.d.ts.map +1 -0
- package/dist/rules/no-foreach.js +95 -0
- package/dist/rules/no-foreach.js.map +1 -0
- package/dist/rules/no-implicit-any-catch.d.ts +13 -0
- package/dist/rules/no-implicit-any-catch.d.ts.map +1 -0
- package/dist/rules/no-implicit-any-catch.js +156 -0
- package/dist/rules/no-implicit-any-catch.js.map +1 -0
- package/dist/rules/no-index-import.d.ts +7 -0
- package/dist/rules/no-index-import.d.ts.map +1 -0
- package/dist/rules/no-index-import.js +11 -0
- package/dist/rules/no-index-import.js.map +1 -0
- package/dist/rules/no-internal-modules.d.ts +7 -0
- package/dist/rules/no-internal-modules.d.ts.map +1 -0
- package/dist/rules/no-internal-modules.js +15 -0
- package/dist/rules/no-internal-modules.js.map +1 -0
- package/dist/rules/no-internal.d.ts +14 -0
- package/dist/rules/no-internal.d.ts.map +1 -0
- package/dist/rules/no-internal.js +113 -0
- package/dist/rules/no-internal.js.map +1 -0
- package/dist/rules/no-language-mixing.d.ts +9 -0
- package/dist/rules/no-language-mixing.d.ts.map +1 -0
- package/dist/rules/no-language-mixing.js +40 -0
- package/dist/rules/no-language-mixing.js.map +1 -0
- package/dist/rules/no-misused-generics.d.ts +10 -0
- package/dist/rules/no-misused-generics.d.ts.map +1 -0
- package/dist/rules/no-misused-generics.js +159 -0
- package/dist/rules/no-misused-generics.js.map +1 -0
- package/dist/rules/no-mixed-enums.d.ts +8 -0
- package/dist/rules/no-mixed-enums.d.ts.map +1 -0
- package/dist/rules/no-mixed-enums.js +25 -0
- package/dist/rules/no-mixed-enums.js.map +1 -0
- package/dist/rules/no-negated-conditions.d.ts +9 -0
- package/dist/rules/no-negated-conditions.d.ts.map +1 -0
- package/dist/rules/no-negated-conditions.js +42 -0
- package/dist/rules/no-negated-conditions.js.map +1 -0
- package/dist/rules/no-nodejs-modules.d.ts +7 -0
- package/dist/rules/no-nodejs-modules.d.ts.map +1 -0
- package/dist/rules/no-nodejs-modules.js +11 -0
- package/dist/rules/no-nodejs-modules.js.map +1 -0
- package/dist/rules/no-param-reassign.d.ts +10 -0
- package/dist/rules/no-param-reassign.d.ts.map +1 -0
- package/dist/rules/no-param-reassign.js +102 -0
- package/dist/rules/no-param-reassign.js.map +1 -0
- package/dist/rules/no-relative-parent-import.d.ts +11 -0
- package/dist/rules/no-relative-parent-import.d.ts.map +1 -0
- package/dist/rules/no-relative-parent-import.js +42 -0
- package/dist/rules/no-relative-parent-import.js.map +1 -0
- package/dist/rules/no-restricted-syntax.d.ts +18 -0
- package/dist/rules/no-restricted-syntax.d.ts.map +1 -0
- package/dist/rules/no-restricted-syntax.js +100 -0
- package/dist/rules/no-restricted-syntax.js.map +1 -0
- package/dist/rules/no-secret.d.ts +8 -0
- package/dist/rules/no-secret.d.ts.map +1 -0
- package/dist/rules/no-secret.js +37 -0
- package/dist/rules/no-secret.js.map +1 -0
- package/dist/rules/no-self-import.d.ts +13 -0
- package/dist/rules/no-self-import.d.ts.map +1 -0
- package/dist/rules/no-self-import.js +86 -0
- package/dist/rules/no-self-import.js.map +1 -0
- package/dist/rules/no-shadow.d.ts +14 -0
- package/dist/rules/no-shadow.d.ts.map +1 -0
- package/dist/rules/no-shadow.js +92 -0
- package/dist/rules/no-shadow.js.map +1 -0
- package/dist/rules/no-sibling-import.d.ts +7 -0
- package/dist/rules/no-sibling-import.d.ts.map +1 -0
- package/dist/rules/no-sibling-import.js +11 -0
- package/dist/rules/no-sibling-import.js.map +1 -0
- package/dist/rules/no-single-line-comment.d.ts +13 -0
- package/dist/rules/no-single-line-comment.d.ts.map +1 -0
- package/dist/rules/no-single-line-comment.js +88 -0
- package/dist/rules/no-single-line-comment.js.map +1 -0
- package/dist/rules/no-t.d.ts +16 -0
- package/dist/rules/no-t.d.ts.map +1 -0
- package/dist/rules/no-t.js +67 -0
- package/dist/rules/no-t.js.map +1 -0
- package/dist/rules/no-underscore-export.d.ts +9 -0
- package/dist/rules/no-underscore-export.d.ts.map +1 -0
- package/dist/rules/no-underscore-export.js +39 -0
- package/dist/rules/no-underscore-export.js.map +1 -0
- package/dist/rules/no-unnecessary-as-const.d.ts +9 -0
- package/dist/rules/no-unnecessary-as-const.d.ts.map +1 -0
- package/dist/rules/no-unnecessary-as-const.js +53 -0
- package/dist/rules/no-unnecessary-as-const.js.map +1 -0
- package/dist/rules/no-unnecessary-break.d.ts +9 -0
- package/dist/rules/no-unnecessary-break.d.ts.map +1 -0
- package/dist/rules/no-unnecessary-break.js +66 -0
- package/dist/rules/no-unnecessary-break.js.map +1 -0
- package/dist/rules/no-unnecessary-initialization.d.ts +9 -0
- package/dist/rules/no-unnecessary-initialization.d.ts.map +1 -0
- package/dist/rules/no-unnecessary-initialization.js +63 -0
- package/dist/rules/no-unnecessary-initialization.js.map +1 -0
- package/dist/rules/no-unnecessary-template-literal.d.ts +9 -0
- package/dist/rules/no-unnecessary-template-literal.d.ts.map +1 -0
- package/dist/rules/no-unnecessary-template-literal.js +47 -0
- package/dist/rules/no-unnecessary-template-literal.js.map +1 -0
- package/dist/rules/no-unused-disable.d.ts +11 -0
- package/dist/rules/no-unused-disable.d.ts.map +1 -0
- package/dist/rules/no-unused-disable.js +28 -0
- package/dist/rules/no-unused-disable.js.map +1 -0
- package/dist/rules/no-useless-generics.d.ts +8 -0
- package/dist/rules/no-useless-generics.d.ts.map +1 -0
- package/dist/rules/no-useless-generics.js +25 -0
- package/dist/rules/no-useless-generics.js.map +1 -0
- package/dist/rules/no-value-tostring.d.ts +8 -0
- package/dist/rules/no-value-tostring.d.ts.map +1 -0
- package/dist/rules/no-value-tostring.js +25 -0
- package/dist/rules/no-value-tostring.js.map +1 -0
- package/dist/rules/no-writeonly.d.ts +7 -0
- package/dist/rules/no-writeonly.d.ts.map +1 -0
- package/dist/rules/no-writeonly.js +9 -0
- package/dist/rules/no-writeonly.js.map +1 -0
- package/dist/rules/object-format.d.ts +13 -0
- package/dist/rules/object-format.d.ts.map +1 -0
- package/dist/rules/object-format.js +61 -0
- package/dist/rules/object-format.js.map +1 -0
- package/dist/rules/only-export-name.d.ts +13 -0
- package/dist/rules/only-export-name.d.ts.map +1 -0
- package/dist/rules/only-export-name.js +104 -0
- package/dist/rules/only-export-name.js.map +1 -0
- package/dist/rules/prefer-arrow-function-property.d.ts +9 -0
- package/dist/rules/prefer-arrow-function-property.d.ts.map +1 -0
- package/dist/rules/prefer-arrow-function-property.js +35 -0
- package/dist/rules/prefer-arrow-function-property.js.map +1 -0
- package/dist/rules/prefer-const-require.d.ts +9 -0
- package/dist/rules/prefer-const-require.d.ts.map +1 -0
- package/dist/rules/prefer-const-require.js +35 -0
- package/dist/rules/prefer-const-require.js.map +1 -0
- package/dist/rules/prefer-includes.d.ts +8 -0
- package/dist/rules/prefer-includes.d.ts.map +1 -0
- package/dist/rules/prefer-includes.js +25 -0
- package/dist/rules/prefer-includes.js.map +1 -0
- package/dist/rules/prefer-interface.d.ts +17 -0
- package/dist/rules/prefer-interface.d.ts.map +1 -0
- package/dist/rules/prefer-interface.js +190 -0
- package/dist/rules/prefer-interface.js.map +1 -0
- package/dist/rules/prefer-less-than.d.ts +8 -0
- package/dist/rules/prefer-less-than.d.ts.map +1 -0
- package/dist/rules/prefer-less-than.js +65 -0
- package/dist/rules/prefer-less-than.js.map +1 -0
- package/dist/rules/prefer-object-has-own.d.ts +8 -0
- package/dist/rules/prefer-object-has-own.d.ts.map +1 -0
- package/dist/rules/prefer-object-has-own.js +26 -0
- package/dist/rules/prefer-object-has-own.js.map +1 -0
- package/dist/rules/prefer-only-export.d.ts +9 -0
- package/dist/rules/prefer-only-export.d.ts.map +1 -0
- package/dist/rules/prefer-only-export.js +35 -0
- package/dist/rules/prefer-only-export.js.map +1 -0
- package/dist/rules/require-jsdoc.d.ts +18 -0
- package/dist/rules/require-jsdoc.d.ts.map +1 -0
- package/dist/rules/require-jsdoc.js +129 -0
- package/dist/rules/require-jsdoc.js.map +1 -0
- package/dist/rules/require-syntax.d.ts +14 -0
- package/dist/rules/require-syntax.d.ts.map +1 -0
- package/dist/rules/require-syntax.js +106 -0
- package/dist/rules/require-syntax.js.map +1 -0
- package/dist/rules/restrict-identifier-characters.d.ts +9 -0
- package/dist/rules/restrict-identifier-characters.d.ts.map +1 -0
- package/dist/rules/restrict-identifier-characters.js +36 -0
- package/dist/rules/restrict-identifier-characters.js.map +1 -0
- package/dist/rules/sort-array.d.ts +9 -0
- package/dist/rules/sort-array.d.ts.map +1 -0
- package/dist/rules/sort-array.js +73 -0
- package/dist/rules/sort-array.js.map +1 -0
- package/dist/rules/sort-call-signature.d.ts +9 -0
- package/dist/rules/sort-call-signature.d.ts.map +1 -0
- package/dist/rules/sort-call-signature.js +35 -0
- package/dist/rules/sort-call-signature.js.map +1 -0
- package/dist/rules/sort-class-members.d.ts +13 -0
- package/dist/rules/sort-class-members.d.ts.map +1 -0
- package/dist/rules/sort-class-members.js +90 -0
- package/dist/rules/sort-class-members.js.map +1 -0
- package/dist/rules/sort-construct-signature.d.ts +9 -0
- package/dist/rules/sort-construct-signature.d.ts.map +1 -0
- package/dist/rules/sort-construct-signature.js +35 -0
- package/dist/rules/sort-construct-signature.js.map +1 -0
- package/dist/rules/sort-export-specifiers.d.ts +9 -0
- package/dist/rules/sort-export-specifiers.d.ts.map +1 -0
- package/dist/rules/sort-export-specifiers.js +62 -0
- package/dist/rules/sort-export-specifiers.js.map +1 -0
- package/dist/rules/sort-keys.d.ts +9 -0
- package/dist/rules/sort-keys.d.ts.map +1 -0
- package/dist/rules/sort-keys.js +84 -0
- package/dist/rules/sort-keys.js.map +1 -0
- package/dist/rules/sort-top-comments.d.ts +9 -0
- package/dist/rules/sort-top-comments.d.ts.map +1 -0
- package/dist/rules/sort-top-comments.js +66 -0
- package/dist/rules/sort-top-comments.js.map +1 -0
- package/dist/rules/switch-case-spacing.d.ts +13 -0
- package/dist/rules/switch-case-spacing.d.ts.map +1 -0
- package/dist/rules/switch-case-spacing.js +72 -0
- package/dist/rules/switch-case-spacing.js.map +1 -0
- package/dist/rules/template-literal-format.d.ts +9 -0
- package/dist/rules/template-literal-format.d.ts.map +1 -0
- package/dist/rules/template-literal-format.js +70 -0
- package/dist/rules/template-literal-format.js.map +1 -0
- package/dist/rules/throw-error.d.ts +9 -0
- package/dist/rules/throw-error.d.ts.map +1 -0
- package/dist/rules/throw-error.js +123 -0
- package/dist/rules/throw-error.js.map +1 -0
- package/dist/rules/throw-new-error.d.ts +8 -0
- package/dist/rules/throw-new-error.d.ts.map +1 -0
- package/dist/rules/throw-new-error.js +25 -0
- package/dist/rules/throw-new-error.js.map +1 -0
- package/dist/rules/typescript-array-callback-return-type.d.ts +9 -0
- package/dist/rules/typescript-array-callback-return-type.d.ts.map +1 -0
- package/dist/rules/typescript-array-callback-return-type.js +80 -0
- package/dist/rules/typescript-array-callback-return-type.js.map +1 -0
- package/dist/rules/typescript-class-methods-use-this.d.ts +13 -0
- package/dist/rules/typescript-class-methods-use-this.d.ts.map +1 -0
- package/dist/rules/typescript-class-methods-use-this.js +99 -0
- package/dist/rules/typescript-class-methods-use-this.js.map +1 -0
- package/dist/rules/typescript-consistent-array-type-name.d.ts +9 -0
- package/dist/rules/typescript-consistent-array-type-name.d.ts.map +1 -0
- package/dist/rules/typescript-consistent-array-type-name.js +36 -0
- package/dist/rules/typescript-consistent-array-type-name.js.map +1 -0
- package/dist/rules/typescript-define-function-in-one-statement.d.ts +9 -0
- package/dist/rules/typescript-define-function-in-one-statement.d.ts.map +1 -0
- package/dist/rules/typescript-define-function-in-one-statement.js +35 -0
- package/dist/rules/typescript-define-function-in-one-statement.js.map +1 -0
- package/dist/rules/typescript-exhaustive-switch.d.ts +13 -0
- package/dist/rules/typescript-exhaustive-switch.d.ts.map +1 -0
- package/dist/rules/typescript-exhaustive-switch.js +55 -0
- package/dist/rules/typescript-exhaustive-switch.js.map +1 -0
- package/dist/rules/typescript-no-boolean-literal-type.d.ts +9 -0
- package/dist/rules/typescript-no-boolean-literal-type.d.ts.map +1 -0
- package/dist/rules/typescript-no-boolean-literal-type.js +43 -0
- package/dist/rules/typescript-no-boolean-literal-type.js.map +1 -0
- package/dist/rules/typescript-no-complex-declarator-type.d.ts +9 -0
- package/dist/rules/typescript-no-complex-declarator-type.d.ts.map +1 -0
- package/dist/rules/typescript-no-complex-declarator-type.js +35 -0
- package/dist/rules/typescript-no-complex-declarator-type.js.map +1 -0
- package/dist/rules/typescript-no-complex-return-type.d.ts +9 -0
- package/dist/rules/typescript-no-complex-return-type.d.ts.map +1 -0
- package/dist/rules/typescript-no-complex-return-type.js +35 -0
- package/dist/rules/typescript-no-complex-return-type.js.map +1 -0
- package/dist/rules/typescript-no-empty-interfaces.d.ts +10 -0
- package/dist/rules/typescript-no-empty-interfaces.d.ts.map +1 -0
- package/dist/rules/typescript-no-empty-interfaces.js +55 -0
- package/dist/rules/typescript-no-empty-interfaces.js.map +1 -0
- package/dist/rules/typescript-no-inferrable-types.d.ts +13 -0
- package/dist/rules/typescript-no-inferrable-types.d.ts.map +1 -0
- package/dist/rules/typescript-no-inferrable-types.js +58 -0
- package/dist/rules/typescript-no-inferrable-types.js.map +1 -0
- package/dist/rules/typescript-no-multi-type-tuples.d.ts +9 -0
- package/dist/rules/typescript-no-multi-type-tuples.d.ts.map +1 -0
- package/dist/rules/typescript-no-multi-type-tuples.js +35 -0
- package/dist/rules/typescript-no-multi-type-tuples.js.map +1 -0
- package/dist/rules/typescript-no-never.d.ts +9 -0
- package/dist/rules/typescript-no-never.d.ts.map +1 -0
- package/dist/rules/typescript-no-never.js +50 -0
- package/dist/rules/typescript-no-never.js.map +1 -0
- package/dist/rules/typescript-no-redundant-undefined-const.d.ts +10 -0
- package/dist/rules/typescript-no-redundant-undefined-const.d.ts.map +1 -0
- package/dist/rules/typescript-no-redundant-undefined-const.js +130 -0
- package/dist/rules/typescript-no-redundant-undefined-const.js.map +1 -0
- package/dist/rules/typescript-no-redundant-undefined-default-parameter.d.ts +10 -0
- package/dist/rules/typescript-no-redundant-undefined-default-parameter.d.ts.map +1 -0
- package/dist/rules/typescript-no-redundant-undefined-default-parameter.js +165 -0
- package/dist/rules/typescript-no-redundant-undefined-default-parameter.js.map +1 -0
- package/dist/rules/typescript-no-redundant-undefined-let.d.ts +10 -0
- package/dist/rules/typescript-no-redundant-undefined-let.d.ts.map +1 -0
- package/dist/rules/typescript-no-redundant-undefined-let.js +134 -0
- package/dist/rules/typescript-no-redundant-undefined-let.js.map +1 -0
- package/dist/rules/typescript-no-redundant-undefined-optional.d.ts +10 -0
- package/dist/rules/typescript-no-redundant-undefined-optional.d.ts.map +1 -0
- package/dist/rules/typescript-no-redundant-undefined-optional.js +77 -0
- package/dist/rules/typescript-no-redundant-undefined-optional.js.map +1 -0
- package/dist/rules/typescript-no-redundant-undefined-promise-return-type.d.ts +10 -0
- package/dist/rules/typescript-no-redundant-undefined-promise-return-type.d.ts.map +1 -0
- package/dist/rules/typescript-no-redundant-undefined-promise-return-type.js +179 -0
- package/dist/rules/typescript-no-redundant-undefined-promise-return-type.js.map +1 -0
- package/dist/rules/typescript-no-redundant-undefined-readonly-property.d.ts +10 -0
- package/dist/rules/typescript-no-redundant-undefined-readonly-property.d.ts.map +1 -0
- package/dist/rules/typescript-no-redundant-undefined-readonly-property.js +125 -0
- package/dist/rules/typescript-no-redundant-undefined-readonly-property.js.map +1 -0
- package/dist/rules/typescript-no-redundant-undefined-return-type.d.ts +10 -0
- package/dist/rules/typescript-no-redundant-undefined-return-type.d.ts.map +1 -0
- package/dist/rules/typescript-no-redundant-undefined-return-type.js +154 -0
- package/dist/rules/typescript-no-redundant-undefined-return-type.js.map +1 -0
- package/dist/rules/typescript-no-redundant-undefined-var.d.ts +10 -0
- package/dist/rules/typescript-no-redundant-undefined-var.d.ts.map +1 -0
- package/dist/rules/typescript-no-redundant-undefined-var.js +134 -0
- package/dist/rules/typescript-no-redundant-undefined-var.js.map +1 -0
- package/dist/rules/typescript-no-restricted-syntax.d.ts +11 -0
- package/dist/rules/typescript-no-restricted-syntax.d.ts.map +1 -0
- package/dist/rules/typescript-no-restricted-syntax.js +40 -0
- package/dist/rules/typescript-no-restricted-syntax.js.map +1 -0
- package/dist/rules/typescript-no-unsafe-object-assign.d.ts +9 -0
- package/dist/rules/typescript-no-unsafe-object-assign.d.ts.map +1 -0
- package/dist/rules/typescript-no-unsafe-object-assign.js +53 -0
- package/dist/rules/typescript-no-unsafe-object-assign.js.map +1 -0
- package/dist/rules/typescript-no-unsafe-object-assignment.d.ts +7 -0
- package/dist/rules/typescript-no-unsafe-object-assignment.d.ts.map +1 -0
- package/dist/rules/typescript-no-unsafe-object-assignment.js +20 -0
- package/dist/rules/typescript-no-unsafe-object-assignment.js.map +1 -0
- package/dist/rules/typescript-prefer-array-type-alias.d.ts +9 -0
- package/dist/rules/typescript-prefer-array-type-alias.d.ts.map +1 -0
- package/dist/rules/typescript-prefer-array-type-alias.js +36 -0
- package/dist/rules/typescript-prefer-array-type-alias.js.map +1 -0
- package/dist/rules/typescript-prefer-class-method.d.ts +9 -0
- package/dist/rules/typescript-prefer-class-method.d.ts.map +1 -0
- package/dist/rules/typescript-prefer-class-method.js +35 -0
- package/dist/rules/typescript-prefer-class-method.js.map +1 -0
- package/dist/rules/typescript-prefer-enum.d.ts +9 -0
- package/dist/rules/typescript-prefer-enum.d.ts.map +1 -0
- package/dist/rules/typescript-prefer-enum.js +132 -0
- package/dist/rules/typescript-prefer-enum.js.map +1 -0
- package/dist/rules/typescript-prefer-named-tuple-members.d.ts +9 -0
- package/dist/rules/typescript-prefer-named-tuple-members.d.ts.map +1 -0
- package/dist/rules/typescript-prefer-named-tuple-members.js +108 -0
- package/dist/rules/typescript-prefer-named-tuple-members.js.map +1 -0
- package/dist/rules/typescript-prefer-readonly-array-parameter.d.ts +9 -0
- package/dist/rules/typescript-prefer-readonly-array-parameter.d.ts.map +1 -0
- package/dist/rules/typescript-prefer-readonly-array-parameter.js +123 -0
- package/dist/rules/typescript-prefer-readonly-array-parameter.js.map +1 -0
- package/dist/rules/typescript-prefer-readonly-array.d.ts +9 -0
- package/dist/rules/typescript-prefer-readonly-array.d.ts.map +1 -0
- package/dist/rules/typescript-prefer-readonly-array.js +51 -0
- package/dist/rules/typescript-prefer-readonly-array.js.map +1 -0
- package/dist/rules/typescript-prefer-readonly-index-signature.d.ts +9 -0
- package/dist/rules/typescript-prefer-readonly-index-signature.d.ts.map +1 -0
- package/dist/rules/typescript-prefer-readonly-index-signature.js +40 -0
- package/dist/rules/typescript-prefer-readonly-index-signature.js.map +1 -0
- package/dist/rules/typescript-prefer-readonly-map.d.ts +9 -0
- package/dist/rules/typescript-prefer-readonly-map.d.ts.map +1 -0
- package/dist/rules/typescript-prefer-readonly-map.js +40 -0
- package/dist/rules/typescript-prefer-readonly-map.js.map +1 -0
- package/dist/rules/typescript-prefer-readonly-property.d.ts +9 -0
- package/dist/rules/typescript-prefer-readonly-property.d.ts.map +1 -0
- package/dist/rules/typescript-prefer-readonly-property.js +58 -0
- package/dist/rules/typescript-prefer-readonly-property.js.map +1 -0
- package/dist/rules/typescript-prefer-readonly-record.d.ts +9 -0
- package/dist/rules/typescript-prefer-readonly-record.d.ts.map +1 -0
- package/dist/rules/typescript-prefer-readonly-record.js +60 -0
- package/dist/rules/typescript-prefer-readonly-record.js.map +1 -0
- package/dist/rules/typescript-prefer-readonly-set.d.ts +9 -0
- package/dist/rules/typescript-prefer-readonly-set.d.ts.map +1 -0
- package/dist/rules/typescript-prefer-readonly-set.js +40 -0
- package/dist/rules/typescript-prefer-readonly-set.js.map +1 -0
- package/dist/rules/typescript-require-prop-type-annotation.d.ts +9 -0
- package/dist/rules/typescript-require-prop-type-annotation.d.ts.map +1 -0
- package/dist/rules/typescript-require-prop-type-annotation.js +58 -0
- package/dist/rules/typescript-require-prop-type-annotation.js.map +1 -0
- package/dist/rules/typescript-require-readonly-array-property-type.d.ts +9 -0
- package/dist/rules/typescript-require-readonly-array-property-type.d.ts.map +1 -0
- package/dist/rules/typescript-require-readonly-array-property-type.js +91 -0
- package/dist/rules/typescript-require-readonly-array-property-type.js.map +1 -0
- package/dist/rules/typescript-require-readonly-array-return-type.d.ts +9 -0
- package/dist/rules/typescript-require-readonly-array-return-type.d.ts.map +1 -0
- package/dist/rules/typescript-require-readonly-array-return-type.js +93 -0
- package/dist/rules/typescript-require-readonly-array-return-type.js.map +1 -0
- package/dist/rules/typescript-require-readonly-array-type-alias.d.ts +9 -0
- package/dist/rules/typescript-require-readonly-array-type-alias.d.ts.map +1 -0
- package/dist/rules/typescript-require-readonly-array-type-alias.js +73 -0
- package/dist/rules/typescript-require-readonly-array-type-alias.js.map +1 -0
- package/dist/rules/typescript-require-readonly-map-parameter-type.d.ts +9 -0
- package/dist/rules/typescript-require-readonly-map-parameter-type.d.ts.map +1 -0
- package/dist/rules/typescript-require-readonly-map-parameter-type.js +109 -0
- package/dist/rules/typescript-require-readonly-map-parameter-type.js.map +1 -0
- package/dist/rules/typescript-require-readonly-map-property-type.d.ts +9 -0
- package/dist/rules/typescript-require-readonly-map-property-type.d.ts.map +1 -0
- package/dist/rules/typescript-require-readonly-map-property-type.js +77 -0
- package/dist/rules/typescript-require-readonly-map-property-type.js.map +1 -0
- package/dist/rules/typescript-require-readonly-map-return-type.d.ts +9 -0
- package/dist/rules/typescript-require-readonly-map-return-type.d.ts.map +1 -0
- package/dist/rules/typescript-require-readonly-map-return-type.js +79 -0
- package/dist/rules/typescript-require-readonly-map-return-type.js.map +1 -0
- package/dist/rules/typescript-require-readonly-map-type-alias.d.ts +9 -0
- package/dist/rules/typescript-require-readonly-map-type-alias.d.ts.map +1 -0
- package/dist/rules/typescript-require-readonly-map-type-alias.js +59 -0
- package/dist/rules/typescript-require-readonly-map-type-alias.js.map +1 -0
- package/dist/rules/typescript-require-readonly-record-parameter-type.d.ts +9 -0
- package/dist/rules/typescript-require-readonly-record-parameter-type.d.ts.map +1 -0
- package/dist/rules/typescript-require-readonly-record-parameter-type.js +124 -0
- package/dist/rules/typescript-require-readonly-record-parameter-type.js.map +1 -0
- package/dist/rules/typescript-require-readonly-record-property-type.d.ts +9 -0
- package/dist/rules/typescript-require-readonly-record-property-type.d.ts.map +1 -0
- package/dist/rules/typescript-require-readonly-record-property-type.js +92 -0
- package/dist/rules/typescript-require-readonly-record-property-type.js.map +1 -0
- package/dist/rules/typescript-require-readonly-record-return-type.d.ts +9 -0
- package/dist/rules/typescript-require-readonly-record-return-type.d.ts.map +1 -0
- package/dist/rules/typescript-require-readonly-record-return-type.js +94 -0
- package/dist/rules/typescript-require-readonly-record-return-type.js.map +1 -0
- package/dist/rules/typescript-require-readonly-record-type-alias.d.ts +9 -0
- package/dist/rules/typescript-require-readonly-record-type-alias.d.ts.map +1 -0
- package/dist/rules/typescript-require-readonly-record-type-alias.js +74 -0
- package/dist/rules/typescript-require-readonly-record-type-alias.js.map +1 -0
- package/dist/rules/typescript-require-readonly-set-parameter-type.d.ts +9 -0
- package/dist/rules/typescript-require-readonly-set-parameter-type.d.ts.map +1 -0
- package/dist/rules/typescript-require-readonly-set-parameter-type.js +109 -0
- package/dist/rules/typescript-require-readonly-set-parameter-type.js.map +1 -0
- package/dist/rules/typescript-require-readonly-set-property-type.d.ts +9 -0
- package/dist/rules/typescript-require-readonly-set-property-type.d.ts.map +1 -0
- package/dist/rules/typescript-require-readonly-set-property-type.js +77 -0
- package/dist/rules/typescript-require-readonly-set-property-type.js.map +1 -0
- package/dist/rules/typescript-require-readonly-set-return-type.d.ts +9 -0
- package/dist/rules/typescript-require-readonly-set-return-type.d.ts.map +1 -0
- package/dist/rules/typescript-require-readonly-set-return-type.js +79 -0
- package/dist/rules/typescript-require-readonly-set-return-type.js.map +1 -0
- package/dist/rules/typescript-require-readonly-set-type-alias.d.ts +9 -0
- package/dist/rules/typescript-require-readonly-set-type-alias.d.ts.map +1 -0
- package/dist/rules/typescript-require-readonly-set-type-alias.js +59 -0
- package/dist/rules/typescript-require-readonly-set-type-alias.js.map +1 -0
- package/dist/rules/typescript-require-this-void.d.ts +9 -0
- package/dist/rules/typescript-require-this-void.d.ts.map +1 -0
- package/dist/rules/typescript-require-this-void.js +71 -0
- package/dist/rules/typescript-require-this-void.js.map +1 -0
- package/dist/rules/underscore-internal.d.ts +8 -0
- package/dist/rules/underscore-internal.d.ts.map +1 -0
- package/dist/rules/underscore-internal.js +116 -0
- package/dist/rules/underscore-internal.js.map +1 -0
- package/dist/rules/unused-internal-properties.d.ts +11 -0
- package/dist/rules/unused-internal-properties.d.ts.map +1 -0
- package/dist/rules/unused-internal-properties.js +28 -0
- package/dist/rules/unused-internal-properties.js.map +1 -0
- package/dist/rules/uppercase-iife.d.ts +11 -0
- package/dist/rules/uppercase-iife.d.ts.map +1 -0
- package/dist/rules/uppercase-iife.js +28 -0
- package/dist/rules/uppercase-iife.js.map +1 -0
- package/dist/rules/words.d.ts +11 -0
- package/dist/rules/words.d.ts.map +1 -0
- package/dist/rules/words.js +28 -0
- package/dist/rules/words.js.map +1 -0
- package/dist/rules.d.ts +21 -0
- package/dist/rules.d.ts.map +1 -0
- package/dist/rules.js +355 -0
- package/dist/rules.js.map +1 -0
- package/docs/docusaurus/blog/2026-03-09-docs-site-online.md +19 -0
- package/docs/docusaurus/blog/2026-03-11-adr-driven-docs-roadmap.md +31 -0
- package/docs/docusaurus/blog/authors.yml +18 -0
- package/docs/docusaurus/docusaurus.config.ts +457 -0
- package/docs/docusaurus/package.json +116 -0
- package/docs/docusaurus/sidebars.rules.ts +379 -0
- package/docs/docusaurus/sidebars.ts +136 -0
- package/docs/docusaurus/site-docs/architecture/adr/0001-flat-config-first-plugin-shape.md +41 -0
- package/docs/docusaurus/site-docs/architecture/adr/0002-rule-docs-coverage-enforcement.md +42 -0
- package/docs/docusaurus/site-docs/architecture/adr/0003-unified-etc-misc-curation-strategy.md +55 -0
- package/docs/docusaurus/site-docs/architecture/adr/0004-generated-rule-catalog-source-of-truth.md +50 -0
- package/docs/docusaurus/site-docs/architecture/adr/0005-risk-tiered-recommended-preset-strategy.md +50 -0
- package/docs/docusaurus/site-docs/architecture/adr/index.md +24 -0
- package/docs/docusaurus/site-docs/getting-started.md +48 -0
- package/docs/docusaurus/site-docs/guides/blog-post-backlog.md +28 -0
- package/docs/docusaurus/site-docs/guides/docs-maintenance-playbook.md +49 -0
- package/docs/docusaurus/site-docs/guides/migration-from-etc-and-misc.md +88 -0
- package/docs/docusaurus/site-docs/intro.md +39 -0
- package/docs/docusaurus/site-docs/releasing.md +95 -0
- package/docs/docusaurus/src/components/GitHubStats.jsx +72 -0
- package/docs/docusaurus/src/css/custom.css +570 -0
- package/docs/docusaurus/src/css/custom.css.d.ts +22 -0
- package/docs/docusaurus/src/js/modernEnhancements.ts +219 -0
- package/docs/docusaurus/src/pages/index.jsx +201 -0
- package/docs/docusaurus/src/pages/index.module.css +588 -0
- package/docs/docusaurus/src/pages/index.module.css.d.ts +48 -0
- package/docs/docusaurus/static/img/apple-touch-icon.png +0 -0
- package/docs/docusaurus/static/img/favicon-96x96.png +0 -0
- package/docs/docusaurus/static/img/favicon.ico +0 -0
- package/docs/docusaurus/static/img/favicon.svg +1 -0
- package/docs/docusaurus/static/img/logo-128x128.svg +401 -0
- package/docs/docusaurus/static/img/logo.png +0 -0
- package/docs/docusaurus/static/img/logo.svg +399 -0
- package/docs/docusaurus/static/img/logo_128x128.png +0 -0
- package/docs/docusaurus/static/img/logo_192x192.png +0 -0
- package/docs/docusaurus/static/img/site.webmanifest +21 -0
- package/docs/docusaurus/static/img/web-app-manifest-192x192.png +0 -0
- package/docs/docusaurus/static/img/web-app-manifest-512x512.png +0 -0
- package/docs/docusaurus/static/manifest.json +22 -0
- package/docs/docusaurus/tsconfig.json +30 -0
- package/docs/docusaurus/tsconfig.typedoc.json +20 -0
- package/docs/docusaurus/typedoc-plugins/hashToBangLinks.mjs +61 -0
- package/docs/docusaurus/typedoc-plugins/hashToBangLinksCore.d.mts +31 -0
- package/docs/docusaurus/typedoc-plugins/hashToBangLinksCore.mjs +154 -0
- package/docs/docusaurus/typedoc-plugins/prefixDocLinks.mjs +46 -0
- package/docs/docusaurus/typedoc-plugins/prefixDocLinksCore.d.mts +18 -0
- package/docs/docusaurus/typedoc-plugins/prefixDocLinksCore.mjs +410 -0
- package/docs/docusaurus/typedoc.config.json +610 -0
- package/docs/docusaurus/typedoc.local.config.json +610 -0
- package/docs/rules/array-type.md +82 -0
- package/docs/rules/class-match-filename.md +95 -0
- package/docs/rules/comment-spacing.md +131 -0
- package/docs/rules/consistent-empty-lines.md +104 -0
- package/docs/rules/consistent-enum-members.md +112 -0
- package/docs/rules/consistent-filename.md +116 -0
- package/docs/rules/consistent-import.md +128 -0
- package/docs/rules/consistent-optional-props.md +114 -0
- package/docs/rules/consistent-source-extension.md +106 -0
- package/docs/rules/consistent-symbol-description.md +91 -0
- package/docs/rules/default-case.md +95 -0
- package/docs/rules/disallow-import.md +108 -0
- package/docs/rules/export-matching-filename-only.md +115 -0
- package/docs/rules/getting-started.md +66 -0
- package/docs/rules/guides/adoption-checklist.md +37 -0
- package/docs/rules/guides/rollout-and-fix-safety.md +42 -0
- package/docs/rules/match-filename.md +119 -0
- package/docs/rules/max-identifier-blocks.md +94 -0
- package/docs/rules/no-assign-mutated-array.md +119 -0
- package/docs/rules/no-at-sign-import.md +97 -0
- package/docs/rules/no-at-sign-internal-import.md +98 -0
- package/docs/rules/no-chain-coalescence-mixture.md +93 -0
- package/docs/rules/no-commented-out-code.md +126 -0
- package/docs/rules/no-const-enum.md +109 -0
- package/docs/rules/no-deprecated.md +175 -0
- package/docs/rules/no-enum.md +98 -0
- package/docs/rules/no-expression-empty-lines.md +100 -0
- package/docs/rules/no-foreach.md +108 -0
- package/docs/rules/no-implicit-any-catch.md +159 -0
- package/docs/rules/no-index-import.md +101 -0
- package/docs/rules/no-internal-modules.md +111 -0
- package/docs/rules/no-internal.md +168 -0
- package/docs/rules/no-language-mixing.md +89 -0
- package/docs/rules/no-misused-generics.md +105 -0
- package/docs/rules/no-mixed-enums.md +96 -0
- package/docs/rules/no-negated-conditions.md +98 -0
- package/docs/rules/no-nodejs-modules.md +103 -0
- package/docs/rules/no-param-reassign.md +110 -0
- package/docs/rules/no-relative-parent-import.md +118 -0
- package/docs/rules/no-restricted-syntax.md +140 -0
- package/docs/rules/no-secret.md +86 -0
- package/docs/rules/no-self-import.md +107 -0
- package/docs/rules/no-shadow.md +109 -0
- package/docs/rules/no-sibling-import.md +109 -0
- package/docs/rules/no-single-line-comment.md +109 -0
- package/docs/rules/no-t.md +128 -0
- package/docs/rules/no-underscore-export.md +93 -0
- package/docs/rules/no-unnecessary-as-const.md +96 -0
- package/docs/rules/no-unnecessary-break.md +99 -0
- package/docs/rules/no-unnecessary-initialization.md +93 -0
- package/docs/rules/no-unnecessary-template-literal.md +92 -0
- package/docs/rules/no-unused-disable.md +88 -0
- package/docs/rules/no-useless-generics.md +95 -0
- package/docs/rules/no-value-tostring.md +90 -0
- package/docs/rules/no-writeonly.md +102 -0
- package/docs/rules/object-format.md +118 -0
- package/docs/rules/only-export-name.md +120 -0
- package/docs/rules/overview.md +46 -0
- package/docs/rules/prefer-arrow-function-property.md +108 -0
- package/docs/rules/prefer-const-require.md +91 -0
- package/docs/rules/prefer-includes.md +83 -0
- package/docs/rules/prefer-interface.md +156 -0
- package/docs/rules/prefer-less-than.md +98 -0
- package/docs/rules/prefer-object-has-own.md +82 -0
- package/docs/rules/prefer-only-export.md +89 -0
- package/docs/rules/presets/all-strict.md +160 -0
- package/docs/rules/presets/all.md +177 -0
- package/docs/rules/presets/recommended.md +55 -0
- package/docs/rules/presets/strict-type-checked.md +66 -0
- package/docs/rules/presets/strict.md +51 -0
- package/docs/rules/require-jsdoc.md +151 -0
- package/docs/rules/require-syntax.md +129 -0
- package/docs/rules/restrict-identifier-characters.md +88 -0
- package/docs/rules/rule-catalog-map.json +912 -0
- package/docs/rules/sort-array.md +91 -0
- package/docs/rules/sort-call-signature.md +98 -0
- package/docs/rules/sort-class-members.md +115 -0
- package/docs/rules/sort-construct-signature.md +96 -0
- package/docs/rules/sort-export-specifiers.md +89 -0
- package/docs/rules/sort-keys.md +107 -0
- package/docs/rules/sort-top-comments.md +92 -0
- package/docs/rules/switch-case-spacing.md +110 -0
- package/docs/rules/template-literal-format.md +100 -0
- package/docs/rules/throw-error.md +110 -0
- package/docs/rules/throw-new-error.md +81 -0
- package/docs/rules/typescript-array-callback-return-type.md +127 -0
- package/docs/rules/typescript-class-methods-use-this.md +120 -0
- package/docs/rules/typescript-consistent-array-type-name.md +93 -0
- package/docs/rules/typescript-define-function-in-one-statement.md +90 -0
- package/docs/rules/typescript-exhaustive-switch.md +114 -0
- package/docs/rules/typescript-no-boolean-literal-type.md +94 -0
- package/docs/rules/typescript-no-complex-declarator-type.md +96 -0
- package/docs/rules/typescript-no-complex-return-type.md +90 -0
- package/docs/rules/typescript-no-empty-interfaces.md +99 -0
- package/docs/rules/typescript-no-inferrable-types.md +102 -0
- package/docs/rules/typescript-no-multi-type-tuples.md +87 -0
- package/docs/rules/typescript-no-never.md +93 -0
- package/docs/rules/typescript-no-redundant-undefined-const.md +101 -0
- package/docs/rules/typescript-no-redundant-undefined-default-parameter.md +117 -0
- package/docs/rules/typescript-no-redundant-undefined-let.md +106 -0
- package/docs/rules/typescript-no-redundant-undefined-optional.md +106 -0
- package/docs/rules/typescript-no-redundant-undefined-promise-return-type.md +134 -0
- package/docs/rules/typescript-no-redundant-undefined-readonly-property.md +110 -0
- package/docs/rules/typescript-no-redundant-undefined-return-type.md +131 -0
- package/docs/rules/typescript-no-redundant-undefined-var.md +106 -0
- package/docs/rules/typescript-no-restricted-syntax.md +119 -0
- package/docs/rules/typescript-no-unsafe-object-assign.md +91 -0
- package/docs/rules/typescript-no-unsafe-object-assignment.md +93 -0
- package/docs/rules/typescript-prefer-array-type-alias.md +87 -0
- package/docs/rules/typescript-prefer-class-method.md +87 -0
- package/docs/rules/typescript-prefer-enum.md +99 -0
- package/docs/rules/typescript-prefer-named-tuple-members.md +104 -0
- package/docs/rules/typescript-prefer-readonly-array-parameter.md +106 -0
- package/docs/rules/typescript-prefer-readonly-array.md +86 -0
- package/docs/rules/typescript-prefer-readonly-index-signature.md +94 -0
- package/docs/rules/typescript-prefer-readonly-map.md +83 -0
- package/docs/rules/typescript-prefer-readonly-property.md +91 -0
- package/docs/rules/typescript-prefer-readonly-record.md +84 -0
- package/docs/rules/typescript-prefer-readonly-set.md +82 -0
- package/docs/rules/typescript-require-prop-type-annotation.md +91 -0
- package/docs/rules/typescript-require-readonly-array-property-type.md +111 -0
- package/docs/rules/typescript-require-readonly-array-return-type.md +113 -0
- package/docs/rules/typescript-require-readonly-array-type-alias.md +102 -0
- package/docs/rules/typescript-require-readonly-map-parameter-type.md +99 -0
- package/docs/rules/typescript-require-readonly-map-property-type.md +103 -0
- package/docs/rules/typescript-require-readonly-map-return-type.md +105 -0
- package/docs/rules/typescript-require-readonly-map-type-alias.md +92 -0
- package/docs/rules/typescript-require-readonly-record-parameter-type.md +100 -0
- package/docs/rules/typescript-require-readonly-record-property-type.md +102 -0
- package/docs/rules/typescript-require-readonly-record-return-type.md +108 -0
- package/docs/rules/typescript-require-readonly-record-type-alias.md +93 -0
- package/docs/rules/typescript-require-readonly-set-parameter-type.md +99 -0
- package/docs/rules/typescript-require-readonly-set-property-type.md +103 -0
- package/docs/rules/typescript-require-readonly-set-return-type.md +105 -0
- package/docs/rules/typescript-require-readonly-set-type-alias.md +92 -0
- package/docs/rules/typescript-require-this-void.md +95 -0
- package/docs/rules/underscore-internal.md +112 -0
- package/docs/rules/unused-internal-properties.md +100 -0
- package/docs/rules/uppercase-iife.md +82 -0
- package/docs/rules/words.md +83 -0
- package/package.json +546 -0
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
import { ruleCreator } from "../_internal/rule-creator.js";
|
|
2
|
+
const functionLikeNodeSelector = ":matches(ArrowFunctionExpression, FunctionDeclaration, FunctionExpression, TSCallSignatureDeclaration, TSConstructSignatureDeclaration, TSConstructorType, TSDeclareFunction, TSEmptyBodyFunctionExpression, TSFunctionType, TSMethodSignature)";
|
|
3
|
+
const getParametersFromFunctionLikeNode = (node) => {
|
|
4
|
+
if (node.type === "ArrowFunctionExpression" ||
|
|
5
|
+
node.type === "FunctionDeclaration" ||
|
|
6
|
+
node.type === "FunctionExpression" ||
|
|
7
|
+
node.type === "TSCallSignatureDeclaration" ||
|
|
8
|
+
node.type === "TSConstructSignatureDeclaration" ||
|
|
9
|
+
node.type === "TSConstructorType" ||
|
|
10
|
+
node.type === "TSDeclareFunction" ||
|
|
11
|
+
node.type === "TSEmptyBodyFunctionExpression" ||
|
|
12
|
+
node.type === "TSFunctionType" ||
|
|
13
|
+
node.type === "TSMethodSignature") {
|
|
14
|
+
return node.params;
|
|
15
|
+
}
|
|
16
|
+
return undefined;
|
|
17
|
+
};
|
|
18
|
+
const getAssignmentPatternFromPattern = (pattern) => {
|
|
19
|
+
if (pattern.type === "AssignmentPattern") {
|
|
20
|
+
return pattern;
|
|
21
|
+
}
|
|
22
|
+
if (pattern.type === "RestElement") {
|
|
23
|
+
return undefined;
|
|
24
|
+
}
|
|
25
|
+
return undefined;
|
|
26
|
+
};
|
|
27
|
+
const getAssignmentPatternFromParameter = (parameter) => {
|
|
28
|
+
if (parameter.type === "TSParameterProperty") {
|
|
29
|
+
return getAssignmentPatternFromPattern(parameter.parameter);
|
|
30
|
+
}
|
|
31
|
+
return getAssignmentPatternFromPattern(parameter);
|
|
32
|
+
};
|
|
33
|
+
const getTypeAnnotationFromAssignmentPattern = (assignmentPattern) => {
|
|
34
|
+
if (assignmentPattern.left.type !== "ArrayPattern" &&
|
|
35
|
+
assignmentPattern.left.type !== "Identifier" &&
|
|
36
|
+
assignmentPattern.left.type !== "ObjectPattern") {
|
|
37
|
+
return undefined;
|
|
38
|
+
}
|
|
39
|
+
return assignmentPattern.left.typeAnnotation;
|
|
40
|
+
};
|
|
41
|
+
const unwrapExpression = (expression) => {
|
|
42
|
+
if (expression.type === "TSAsExpression" ||
|
|
43
|
+
expression.type === "TSSatisfiesExpression" ||
|
|
44
|
+
expression.type === "TSNonNullExpression" ||
|
|
45
|
+
expression.type === "TSTypeAssertion") {
|
|
46
|
+
return unwrapExpression(expression.expression);
|
|
47
|
+
}
|
|
48
|
+
return expression;
|
|
49
|
+
};
|
|
50
|
+
const isDefinitelyDefinedExpression = (expression) => {
|
|
51
|
+
const unwrappedExpression = unwrapExpression(expression);
|
|
52
|
+
if (unwrappedExpression.type === "ArrayExpression") {
|
|
53
|
+
return true;
|
|
54
|
+
}
|
|
55
|
+
if (unwrappedExpression.type === "ArrowFunctionExpression") {
|
|
56
|
+
return true;
|
|
57
|
+
}
|
|
58
|
+
if (unwrappedExpression.type === "ClassExpression") {
|
|
59
|
+
return true;
|
|
60
|
+
}
|
|
61
|
+
if (unwrappedExpression.type === "FunctionExpression") {
|
|
62
|
+
return true;
|
|
63
|
+
}
|
|
64
|
+
if (unwrappedExpression.type === "Literal") {
|
|
65
|
+
return true;
|
|
66
|
+
}
|
|
67
|
+
if (unwrappedExpression.type === "NewExpression") {
|
|
68
|
+
return true;
|
|
69
|
+
}
|
|
70
|
+
if (unwrappedExpression.type === "ObjectExpression") {
|
|
71
|
+
return true;
|
|
72
|
+
}
|
|
73
|
+
if (unwrappedExpression.type === "TemplateLiteral") {
|
|
74
|
+
return true;
|
|
75
|
+
}
|
|
76
|
+
return false;
|
|
77
|
+
};
|
|
78
|
+
const buildFixedTypeText = (sourceCode, unionType) => {
|
|
79
|
+
let nonUndefinedTypeTexts = [];
|
|
80
|
+
for (const typeNode of unionType.types) {
|
|
81
|
+
if (typeNode.type === "TSUndefinedKeyword") {
|
|
82
|
+
continue;
|
|
83
|
+
}
|
|
84
|
+
nonUndefinedTypeTexts = [
|
|
85
|
+
...nonUndefinedTypeTexts,
|
|
86
|
+
sourceCode.getText(typeNode),
|
|
87
|
+
];
|
|
88
|
+
}
|
|
89
|
+
if (nonUndefinedTypeTexts.length === 0 ||
|
|
90
|
+
nonUndefinedTypeTexts.length === unionType.types.length) {
|
|
91
|
+
return undefined;
|
|
92
|
+
}
|
|
93
|
+
return nonUndefinedTypeTexts.join(" | ");
|
|
94
|
+
};
|
|
95
|
+
/**
|
|
96
|
+
* Disallow redundant `undefined` unions on default parameters with
|
|
97
|
+
* definitely-defined initializers.
|
|
98
|
+
*/
|
|
99
|
+
const rule = ruleCreator({
|
|
100
|
+
create: (context) => {
|
|
101
|
+
const sourceCode = context.sourceCode;
|
|
102
|
+
return {
|
|
103
|
+
[functionLikeNodeSelector]: (node) => {
|
|
104
|
+
const parameters = getParametersFromFunctionLikeNode(node);
|
|
105
|
+
if (parameters === undefined) {
|
|
106
|
+
return;
|
|
107
|
+
}
|
|
108
|
+
for (const parameter of parameters) {
|
|
109
|
+
const assignmentPattern = getAssignmentPatternFromParameter(parameter);
|
|
110
|
+
if (assignmentPattern === undefined) {
|
|
111
|
+
continue;
|
|
112
|
+
}
|
|
113
|
+
if (!isDefinitelyDefinedExpression(assignmentPattern.right)) {
|
|
114
|
+
continue;
|
|
115
|
+
}
|
|
116
|
+
const typeAnnotation = getTypeAnnotationFromAssignmentPattern(assignmentPattern);
|
|
117
|
+
if (typeAnnotation === undefined) {
|
|
118
|
+
continue;
|
|
119
|
+
}
|
|
120
|
+
if (typeAnnotation.typeAnnotation.type !== "TSUnionType") {
|
|
121
|
+
continue;
|
|
122
|
+
}
|
|
123
|
+
const fixedTypeText = buildFixedTypeText(sourceCode, typeAnnotation.typeAnnotation);
|
|
124
|
+
if (fixedTypeText === undefined) {
|
|
125
|
+
continue;
|
|
126
|
+
}
|
|
127
|
+
const fix = (fixer) => fixer.replaceText(typeAnnotation.typeAnnotation, fixedTypeText);
|
|
128
|
+
context.report({
|
|
129
|
+
fix,
|
|
130
|
+
messageId: "forbidden",
|
|
131
|
+
node: typeAnnotation.typeAnnotation,
|
|
132
|
+
suggest: [
|
|
133
|
+
{
|
|
134
|
+
fix,
|
|
135
|
+
messageId: "suggestRemoveRedundantUndefined",
|
|
136
|
+
},
|
|
137
|
+
],
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
},
|
|
141
|
+
};
|
|
142
|
+
},
|
|
143
|
+
defaultOptions: [],
|
|
144
|
+
meta: {
|
|
145
|
+
deprecated: false,
|
|
146
|
+
docs: {
|
|
147
|
+
deprecated: false,
|
|
148
|
+
description: "disallow redundant `undefined` in default parameter union types when the initializer is definitely defined.",
|
|
149
|
+
frozen: false,
|
|
150
|
+
recommended: false,
|
|
151
|
+
url: "https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/typescript-no-redundant-undefined-default-parameter",
|
|
152
|
+
},
|
|
153
|
+
fixable: "code",
|
|
154
|
+
hasSuggestions: true,
|
|
155
|
+
messages: {
|
|
156
|
+
forbidden: "Default parameters with definitely-defined initializers should not redundantly include `undefined` in their type union.",
|
|
157
|
+
suggestRemoveRedundantUndefined: "Remove redundant `undefined` from this default parameter type union.",
|
|
158
|
+
},
|
|
159
|
+
schema: [],
|
|
160
|
+
type: "suggestion",
|
|
161
|
+
},
|
|
162
|
+
name: "typescript/no-redundant-undefined-default-parameter",
|
|
163
|
+
});
|
|
164
|
+
export default rule;
|
|
165
|
+
//# sourceMappingURL=typescript-no-redundant-undefined-default-parameter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"typescript-no-redundant-undefined-default-parameter.js","sourceRoot":"","sources":["../../src/rules/typescript-no-redundant-undefined-default-parameter.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAM3D,MAAM,wBAAwB,GAC1B,iPAAiP,CAAC;AAEtP,MAAM,iCAAiC,GAAG,CACtC,IAAuB,EACsB,EAAE;IAC/C,IACI,IAAI,CAAC,IAAI,KAAK,yBAAyB;QACvC,IAAI,CAAC,IAAI,KAAK,qBAAqB;QACnC,IAAI,CAAC,IAAI,KAAK,oBAAoB;QAClC,IAAI,CAAC,IAAI,KAAK,4BAA4B;QAC1C,IAAI,CAAC,IAAI,KAAK,iCAAiC;QAC/C,IAAI,CAAC,IAAI,KAAK,mBAAmB;QACjC,IAAI,CAAC,IAAI,KAAK,mBAAmB;QACjC,IAAI,CAAC,IAAI,KAAK,+BAA+B;QAC7C,IAAI,CAAC,IAAI,KAAK,gBAAgB;QAC9B,IAAI,CAAC,IAAI,KAAK,mBAAmB,EACnC,CAAC;QACC,OAAO,IAAI,CAAC,MAAM,CAAC;IACvB,CAAC;IAED,OAAO,SAAS,CAAC;AACrB,CAAC,CAAC;AAEF,MAAM,+BAA+B,GAAG,CACpC,OAAyE,EAC/B,EAAE;IAC5C,IAAI,OAAO,CAAC,IAAI,KAAK,mBAAmB,EAAE,CAAC;QACvC,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AAS,EAAE,WAAW;wBACtB,IAAI,EAAE,cAAc,CAAC,cAAc;wBACnC,OAAO,EAAE;4BACL;gCACI,GAAG;gCACH,SAAS,EAAE,iCAAiC;6BAC/C;yBACJ;qBACJ,CAAC,CAAC;gBACP,CAAC;YACL,CAAC;SACJ,CAAC;IACN,CAAC;IACD,cAAc,EAAE,EAAE;IAClB,IAAI,EAAE;QACF,UAAU,EAAE,KAAK;QACjB,IAAI,EAAE;YACF,UAAU,EAAE,KAAK;YACjB,WAAW,EACP,6GAA6G;YACjH,MAAM,EAAE,KAAK;YACb,WAAW,EAAE,KAAK;YAClB,GAAG,EAAE,oHAAoH;SAC5H;QACD,OAAO,EAAE,MAAM;QACf,cAAc,EAAE,IAAI;QACpB,QAAQ,EAAE;YACN,SAAS,EACL,yHAAyH;YAC7H,+BAA+B,EAC3B,sEAAsE;SAC7E;QACD,MAAM,EAAE,EAAE;QACV,IAAI,EAAE,YAAY;KACrB;IACD,IAAI,EAAE,qDAAqD;CAC9D,CAAC,CAAC;AAEH,eAAe,IAAI,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ruleCreator } from "../_internal/rule-creator.js";
|
|
2
|
+
type MessageIds = "forbidden" | "suggestRemoveRedundantUndefined";
|
|
3
|
+
type Options = readonly [];
|
|
4
|
+
/**
|
|
5
|
+
* Disallow redundant `undefined` unions on `let` declarations that are never
|
|
6
|
+
* reassigned and initialized with definitely-defined values.
|
|
7
|
+
*/
|
|
8
|
+
declare const rule: ReturnType<typeof ruleCreator<Options, MessageIds>>;
|
|
9
|
+
export default rule;
|
|
10
|
+
//# sourceMappingURL=typescript-no-redundant-undefined-let.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"typescript-no-redundant-undefined-let.d.ts","sourceRoot":"","sources":["../../src/rules/typescript-no-redundant-undefined-let.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAE3D,KAAK,UAAU,GAAG,WAAW,GAAG,iCAAiC,CAAC;AAElE,KAAK,OAAO,GAAG,SAAS,EAAE,CAAC;AAmG3B;;;GAGG;AACH,QAAA,MAAM,IAAI,EAAE,UAAU,CAAC,OAAO,WAAW,CAAC,OAAO,EAAE,UAAU,CAAC,CA8F5D,CAAC;AAEH,eAAe,IAAI,CAAC"}
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import { ruleCreator } from "../_internal/rule-creator.js";
|
|
2
|
+
const buildFixedTypeText = (sourceCode, unionType) => {
|
|
3
|
+
let nonUndefinedTypeTexts = [];
|
|
4
|
+
for (const typeNode of unionType.types) {
|
|
5
|
+
if (typeNode.type === "TSUndefinedKeyword") {
|
|
6
|
+
continue;
|
|
7
|
+
}
|
|
8
|
+
nonUndefinedTypeTexts = [
|
|
9
|
+
...nonUndefinedTypeTexts,
|
|
10
|
+
sourceCode.getText(typeNode),
|
|
11
|
+
];
|
|
12
|
+
}
|
|
13
|
+
if (nonUndefinedTypeTexts.length === 0 ||
|
|
14
|
+
nonUndefinedTypeTexts.length === unionType.types.length) {
|
|
15
|
+
return undefined;
|
|
16
|
+
}
|
|
17
|
+
return nonUndefinedTypeTexts.join(" | ");
|
|
18
|
+
};
|
|
19
|
+
const unwrapExpression = (expression) => {
|
|
20
|
+
if (expression.type === "TSAsExpression" ||
|
|
21
|
+
expression.type === "TSSatisfiesExpression" ||
|
|
22
|
+
expression.type === "TSNonNullExpression" ||
|
|
23
|
+
expression.type === "TSTypeAssertion") {
|
|
24
|
+
return unwrapExpression(expression.expression);
|
|
25
|
+
}
|
|
26
|
+
return expression;
|
|
27
|
+
};
|
|
28
|
+
const isDefinitelyDefinedExpression = (expression) => {
|
|
29
|
+
const unwrappedExpression = unwrapExpression(expression);
|
|
30
|
+
if (unwrappedExpression.type === "ArrayExpression") {
|
|
31
|
+
return true;
|
|
32
|
+
}
|
|
33
|
+
if (unwrappedExpression.type === "ArrowFunctionExpression") {
|
|
34
|
+
return true;
|
|
35
|
+
}
|
|
36
|
+
if (unwrappedExpression.type === "ClassExpression") {
|
|
37
|
+
return true;
|
|
38
|
+
}
|
|
39
|
+
if (unwrappedExpression.type === "FunctionExpression") {
|
|
40
|
+
return true;
|
|
41
|
+
}
|
|
42
|
+
if (unwrappedExpression.type === "Literal") {
|
|
43
|
+
return true;
|
|
44
|
+
}
|
|
45
|
+
if (unwrappedExpression.type === "NewExpression") {
|
|
46
|
+
return true;
|
|
47
|
+
}
|
|
48
|
+
if (unwrappedExpression.type === "ObjectExpression") {
|
|
49
|
+
return true;
|
|
50
|
+
}
|
|
51
|
+
if (unwrappedExpression.type === "TemplateLiteral") {
|
|
52
|
+
return true;
|
|
53
|
+
}
|
|
54
|
+
return false;
|
|
55
|
+
};
|
|
56
|
+
const isNeverReassigned = (sourceCode, declarator) => {
|
|
57
|
+
const [declaredVariable] = sourceCode.getDeclaredVariables(declarator);
|
|
58
|
+
if (declaredVariable === undefined) {
|
|
59
|
+
return false;
|
|
60
|
+
}
|
|
61
|
+
return !declaredVariable.references.some((reference) => reference.isWrite() && reference.init !== true);
|
|
62
|
+
};
|
|
63
|
+
/**
|
|
64
|
+
* Disallow redundant `undefined` unions on `let` declarations that are never
|
|
65
|
+
* reassigned and initialized with definitely-defined values.
|
|
66
|
+
*/
|
|
67
|
+
const rule = ruleCreator({
|
|
68
|
+
create: (context) => {
|
|
69
|
+
const sourceCode = context.sourceCode;
|
|
70
|
+
return {
|
|
71
|
+
"VariableDeclaration[kind='let'] > VariableDeclarator[id.type='Identifier']": (node) => {
|
|
72
|
+
const initializer = node.init;
|
|
73
|
+
if (initializer === null) {
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
if (!isDefinitelyDefinedExpression(initializer)) {
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
if (!isNeverReassigned(sourceCode, node)) {
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
const id = node.id;
|
|
83
|
+
if (id.type !== "Identifier") {
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
const typeAnnotation = id.typeAnnotation;
|
|
87
|
+
if (typeAnnotation === undefined) {
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
if (typeAnnotation.typeAnnotation.type !== "TSUnionType") {
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
const fixedTypeText = buildFixedTypeText(sourceCode, typeAnnotation.typeAnnotation);
|
|
94
|
+
if (fixedTypeText === undefined) {
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
97
|
+
const fix = (fixer) => fixer.replaceText(typeAnnotation.typeAnnotation, fixedTypeText);
|
|
98
|
+
context.report({
|
|
99
|
+
fix,
|
|
100
|
+
messageId: "forbidden",
|
|
101
|
+
node: typeAnnotation.typeAnnotation,
|
|
102
|
+
suggest: [
|
|
103
|
+
{
|
|
104
|
+
fix,
|
|
105
|
+
messageId: "suggestRemoveRedundantUndefined",
|
|
106
|
+
},
|
|
107
|
+
],
|
|
108
|
+
});
|
|
109
|
+
},
|
|
110
|
+
};
|
|
111
|
+
},
|
|
112
|
+
defaultOptions: [],
|
|
113
|
+
meta: {
|
|
114
|
+
deprecated: false,
|
|
115
|
+
docs: {
|
|
116
|
+
deprecated: false,
|
|
117
|
+
description: "disallow redundant `undefined` in `let` type unions when declarations are never reassigned and initialized with definitely-defined values.",
|
|
118
|
+
frozen: false,
|
|
119
|
+
recommended: false,
|
|
120
|
+
url: "https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/typescript-no-redundant-undefined-let",
|
|
121
|
+
},
|
|
122
|
+
fixable: "code",
|
|
123
|
+
hasSuggestions: true,
|
|
124
|
+
messages: {
|
|
125
|
+
forbidden: "Never-reassigned `let` declarations with definitely-defined initializers should not redundantly include `undefined` in their type union.",
|
|
126
|
+
suggestRemoveRedundantUndefined: "Remove redundant `undefined` from this `let` declaration type union.",
|
|
127
|
+
},
|
|
128
|
+
schema: [],
|
|
129
|
+
type: "suggestion",
|
|
130
|
+
},
|
|
131
|
+
name: "typescript/no-redundant-undefined-let",
|
|
132
|
+
});
|
|
133
|
+
export default rule;
|
|
134
|
+
//# sourceMappingURL=typescript-no-redundant-undefined-let.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"typescript-no-redundant-undefined-let.js","sourceRoot":"","sources":["../../src/rules/typescript-no-redundant-undefined-let.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAM3D,MAAM,kBAAkB,GAAG,CACvB,UAAyC,EACzC,SAAmC,EACjB,EAAE;IACpB,IAAI,qBAAqB,GAAsB,EAAE,CAAC;IAElD,KAAK,MAAM,QAAQ,IAAI,SAAS,CAAC,KAAK,EAAE,CAAC;QACrC,IAAI,QAAQ,CAAC,IAAI,KAAK,oBAAoB,EAAE,CAAC;YACzC,SAAS;QACb,CAAC;QAED,qBAAqB,GAAG;YACpB,GAAG,qBAAqB;YACxB,UAAU,CAAC,OAAO,CAAC,QAAQ,CAAC;SAC/B,CAAC;IACN,CAAC;IAED,IACI,qBAAqB,CAAC,MAAM,KAAK,CAAC;QAClC,qBAAqB,CAAC,MAAM,KAAK,SAAS,CAAC,KAAK,CAAC,MAAM,EACzD,CAAC;QACC,OAAO,SAAS,CAAC;IACrB,CAAC;IAED,OAAO,qBAAqB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AAC7C,CAAC,CAAC;AAEF,MAAM,gBAAgB,GAAG,CACrB,UAAmC,EACZ,EAAE;IACzB,IACI,UAAU,CAAC,IAAI,KAAK,gBAAgB;QACpC,UAAU,CAAC,IAAI,KAAK,uBAAuB;QAC3C,UAAU,CAAC,IAAI,KAAK,qBAAqB;QACzC,UAAU,CAAC,IAAI,KAAK,iBAAiB,EACvC,CAAC;QACC,OAAO,gBAAgB,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC;IACnD,CAAC;IAED,OAAO,UAAU,CAAC;AACtB,CAAC,CAAC;AAEF,MAAM,6BAA6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ACtB,IAAI,EAAE,cAAc,CAAC,cAAc;oBACnC,OAAO,EAAE;wBACL;4BACI,GAAG;4BACH,SAAS,EAAE,iCAAiC;yBAC/C;qBACJ;iBACJ,CAAC,CAAC;YACP,CAAC;SACR,CAAC;IACN,CAAC;IACD,cAAc,EAAE,EAAE;IAClB,IAAI,EAAE;QACF,UAAU,EAAE,KAAK;QACjB,IAAI,EAAE;YACF,UAAU,EAAE,KAAK;YACjB,WAAW,EACP,4IAA4I;YAChJ,MAAM,EAAE,KAAK;YACb,WAAW,EAAE,KAAK;YAClB,GAAG,EAAE,sGAAsG;SAC9G;QACD,OAAO,EAAE,MAAM;QACf,cAAc,EAAE,IAAI;QACpB,QAAQ,EAAE;YACN,SAAS,EACL,0IAA0I;YAC9I,+BAA+B,EAC3B,sEAAsE;SAC7E;QACD,MAAM,EAAE,EAAE;QACV,IAAI,EAAE,YAAY;KACrB;IACD,IAAI,EAAE,uCAAuC;CAChD,CAAC,CAAC;AAEH,eAAe,IAAI,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ruleCreator } from "../_internal/rule-creator.js";
|
|
2
|
+
type MessageIds = "forbidden" | "suggestRemoveRedundantUndefined";
|
|
3
|
+
type Options = readonly [];
|
|
4
|
+
/**
|
|
5
|
+
* Disallow redundant `undefined` unions on optional parameters and tuple
|
|
6
|
+
* members.
|
|
7
|
+
*/
|
|
8
|
+
declare const rule: ReturnType<typeof ruleCreator<Options, MessageIds>>;
|
|
9
|
+
export default rule;
|
|
10
|
+
//# sourceMappingURL=typescript-no-redundant-undefined-optional.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"typescript-no-redundant-undefined-optional.d.ts","sourceRoot":"","sources":["../../src/rules/typescript-no-redundant-undefined-optional.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAE3D,KAAK,UAAU,GAAG,WAAW,GAAG,iCAAiC,CAAC;AAElE,KAAK,OAAO,GAAG,SAAS,EAAE,CAAC;AAmC3B;;;GAGG;AACH,QAAA,MAAM,IAAI,EAAE,UAAU,CAAC,OAAO,WAAW,CAAC,OAAO,EAAE,UAAU,CAAC,CA4D5D,CAAC;AAEH,eAAe,IAAI,CAAC"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { ruleCreator } from "../_internal/rule-creator.js";
|
|
2
|
+
const selector = [
|
|
3
|
+
"Identifier[optional=true] > TSTypeAnnotation > TSUnionType",
|
|
4
|
+
"TSNamedTupleMember[optional=true] > TSUnionType",
|
|
5
|
+
"TSOptionalType > TSUnionType",
|
|
6
|
+
].join(", ");
|
|
7
|
+
const buildFixedTypeText = (sourceCode, unionType) => {
|
|
8
|
+
let nonUndefinedTypeTexts = [];
|
|
9
|
+
for (const typeNode of unionType.types) {
|
|
10
|
+
if (typeNode.type === "TSUndefinedKeyword") {
|
|
11
|
+
continue;
|
|
12
|
+
}
|
|
13
|
+
nonUndefinedTypeTexts = [
|
|
14
|
+
...nonUndefinedTypeTexts,
|
|
15
|
+
sourceCode.getText(typeNode),
|
|
16
|
+
];
|
|
17
|
+
}
|
|
18
|
+
if (nonUndefinedTypeTexts.length === 0 ||
|
|
19
|
+
nonUndefinedTypeTexts.length === unionType.types.length) {
|
|
20
|
+
return undefined;
|
|
21
|
+
}
|
|
22
|
+
return nonUndefinedTypeTexts.join(" | ");
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* Disallow redundant `undefined` unions on optional parameters and tuple
|
|
26
|
+
* members.
|
|
27
|
+
*/
|
|
28
|
+
const rule = ruleCreator({
|
|
29
|
+
create: (context) => {
|
|
30
|
+
const sourceCode = context.sourceCode;
|
|
31
|
+
return {
|
|
32
|
+
[selector]: (node) => {
|
|
33
|
+
if (node.type !== "TSUnionType") {
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
const fixedTypeText = buildFixedTypeText(sourceCode, node);
|
|
37
|
+
if (fixedTypeText === undefined) {
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
const fix = (fixer) => fixer.replaceText(node, fixedTypeText);
|
|
41
|
+
context.report({
|
|
42
|
+
fix,
|
|
43
|
+
messageId: "forbidden",
|
|
44
|
+
node,
|
|
45
|
+
suggest: [
|
|
46
|
+
{
|
|
47
|
+
fix,
|
|
48
|
+
messageId: "suggestRemoveRedundantUndefined",
|
|
49
|
+
},
|
|
50
|
+
],
|
|
51
|
+
});
|
|
52
|
+
},
|
|
53
|
+
};
|
|
54
|
+
},
|
|
55
|
+
defaultOptions: [],
|
|
56
|
+
meta: {
|
|
57
|
+
deprecated: false,
|
|
58
|
+
docs: {
|
|
59
|
+
deprecated: false,
|
|
60
|
+
description: "disallow redundant `undefined` in optional parameter and tuple member union types.",
|
|
61
|
+
frozen: false,
|
|
62
|
+
recommended: false,
|
|
63
|
+
url: "https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/typescript-no-redundant-undefined-optional",
|
|
64
|
+
},
|
|
65
|
+
fixable: "code",
|
|
66
|
+
hasSuggestions: true,
|
|
67
|
+
messages: {
|
|
68
|
+
forbidden: "Optional parameters and tuple members should not redundantly include `undefined` in their type union.",
|
|
69
|
+
suggestRemoveRedundantUndefined: "Remove redundant `undefined` from this optional union type.",
|
|
70
|
+
},
|
|
71
|
+
schema: [],
|
|
72
|
+
type: "suggestion",
|
|
73
|
+
},
|
|
74
|
+
name: "typescript/no-redundant-undefined-optional",
|
|
75
|
+
});
|
|
76
|
+
export default rule;
|
|
77
|
+
//# sourceMappingURL=typescript-no-redundant-undefined-optional.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"typescript-no-redundant-undefined-optional.js","sourceRoot":"","sources":["../../src/rules/typescript-no-redundant-undefined-optional.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAM3D,MAAM,QAAQ,GAAG;IACb,4DAA4D;IAC5D,iDAAiD;IACjD,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E,WAAW;oBACtB,IAAI;oBACJ,OAAO,EAAE;wBACL;4BACI,GAAG;4BACH,SAAS,EAAE,iCAAiC;yBAC/C;qBACJ;iBACJ,CAAC,CAAC;YACP,CAAC;SACJ,CAAC;IACN,CAAC;IACD,cAAc,EAAE,EAAE;IAClB,IAAI,EAAE;QACF,UAAU,EAAE,KAAK;QACjB,IAAI,EAAE;YACF,UAAU,EAAE,KAAK;YACjB,WAAW,EACP,oFAAoF;YACxF,MAAM,EAAE,KAAK;YACb,WAAW,EAAE,KAAK;YAClB,GAAG,EAAE,2GAA2G;SACnH;QACD,OAAO,EAAE,MAAM;QACf,cAAc,EAAE,IAAI;QACpB,QAAQ,EAAE;YACN,SAAS,EACL,uGAAuG;YAC3G,+BAA+B,EAC3B,6DAA6D;SACpE;QACD,MAAM,EAAE,EAAE;QACV,IAAI,EAAE,YAAY;KACrB;IACD,IAAI,EAAE,4CAA4C;CACrD,CAAC,CAAC;AAEH,eAAe,IAAI,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ruleCreator } from "../_internal/rule-creator.js";
|
|
2
|
+
type MessageIds = "forbidden" | "suggestRemoveRedundantUndefined";
|
|
3
|
+
type Options = readonly [];
|
|
4
|
+
/**
|
|
5
|
+
* Disallow redundant `undefined` inside Promise return type unions for async
|
|
6
|
+
* functions that deterministically return definitely-defined values.
|
|
7
|
+
*/
|
|
8
|
+
declare const rule: ReturnType<typeof ruleCreator<Options, MessageIds>>;
|
|
9
|
+
export default rule;
|
|
10
|
+
//# sourceMappingURL=typescript-no-redundant-undefined-promise-return-type.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"typescript-no-redundant-undefined-promise-return-type.d.ts","sourceRoot":"","sources":["../../src/rules/typescript-no-redundant-undefined-promise-return-type.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAE3D,KAAK,UAAU,GAAG,WAAW,GAAG,iCAAiC,CAAC;AAElE,KAAK,OAAO,GAAG,SAAS,EAAE,CAAC;AAkL3B;;;GAGG;AACH,QAAA,MAAM,IAAI,EAAE,UAAU,CAAC,OAAO,WAAW,CAAC,OAAO,EAAE,UAAU,CAAC,CAyF5D,CAAC;AAEH,eAAe,IAAI,CAAC"}
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
import { ruleCreator } from "../_internal/rule-creator.js";
|
|
2
|
+
const buildFixedTypeText = (sourceCode, unionType) => {
|
|
3
|
+
let nonUndefinedTypeTexts = [];
|
|
4
|
+
for (const typeNode of unionType.types) {
|
|
5
|
+
if (typeNode.type === "TSUndefinedKeyword") {
|
|
6
|
+
continue;
|
|
7
|
+
}
|
|
8
|
+
nonUndefinedTypeTexts = [
|
|
9
|
+
...nonUndefinedTypeTexts,
|
|
10
|
+
sourceCode.getText(typeNode),
|
|
11
|
+
];
|
|
12
|
+
}
|
|
13
|
+
if (nonUndefinedTypeTexts.length === 0 ||
|
|
14
|
+
nonUndefinedTypeTexts.length === unionType.types.length) {
|
|
15
|
+
return undefined;
|
|
16
|
+
}
|
|
17
|
+
return nonUndefinedTypeTexts.join(" | ");
|
|
18
|
+
};
|
|
19
|
+
const unwrapExpression = (expression) => {
|
|
20
|
+
if (expression.type === "TSAsExpression" ||
|
|
21
|
+
expression.type === "TSSatisfiesExpression" ||
|
|
22
|
+
expression.type === "TSNonNullExpression" ||
|
|
23
|
+
expression.type === "TSTypeAssertion") {
|
|
24
|
+
return unwrapExpression(expression.expression);
|
|
25
|
+
}
|
|
26
|
+
return expression;
|
|
27
|
+
};
|
|
28
|
+
const isDefinitelyDefinedExpression = (expression) => {
|
|
29
|
+
const unwrappedExpression = unwrapExpression(expression);
|
|
30
|
+
if (unwrappedExpression.type === "ArrayExpression") {
|
|
31
|
+
return true;
|
|
32
|
+
}
|
|
33
|
+
if (unwrappedExpression.type === "ArrowFunctionExpression") {
|
|
34
|
+
return true;
|
|
35
|
+
}
|
|
36
|
+
if (unwrappedExpression.type === "ClassExpression") {
|
|
37
|
+
return true;
|
|
38
|
+
}
|
|
39
|
+
if (unwrappedExpression.type === "ConditionalExpression") {
|
|
40
|
+
return (isDefinitelyDefinedExpression(unwrappedExpression.consequent) &&
|
|
41
|
+
isDefinitelyDefinedExpression(unwrappedExpression.alternate));
|
|
42
|
+
}
|
|
43
|
+
if (unwrappedExpression.type === "FunctionExpression") {
|
|
44
|
+
return true;
|
|
45
|
+
}
|
|
46
|
+
if (unwrappedExpression.type === "Literal") {
|
|
47
|
+
return true;
|
|
48
|
+
}
|
|
49
|
+
if (unwrappedExpression.type === "LogicalExpression" &&
|
|
50
|
+
unwrappedExpression.operator === "??") {
|
|
51
|
+
return isDefinitelyDefinedExpression(unwrappedExpression.right);
|
|
52
|
+
}
|
|
53
|
+
if (unwrappedExpression.type === "NewExpression") {
|
|
54
|
+
return true;
|
|
55
|
+
}
|
|
56
|
+
if (unwrappedExpression.type === "ObjectExpression") {
|
|
57
|
+
return true;
|
|
58
|
+
}
|
|
59
|
+
if (unwrappedExpression.type === "SequenceExpression") {
|
|
60
|
+
const lastExpression = unwrappedExpression.expressions.at(-1);
|
|
61
|
+
return (lastExpression !== undefined &&
|
|
62
|
+
isDefinitelyDefinedExpression(lastExpression));
|
|
63
|
+
}
|
|
64
|
+
if (unwrappedExpression.type === "TemplateLiteral") {
|
|
65
|
+
return true;
|
|
66
|
+
}
|
|
67
|
+
return false;
|
|
68
|
+
};
|
|
69
|
+
const hasDefinitelyDefinedReturnValue = (node) => {
|
|
70
|
+
const body = node.body;
|
|
71
|
+
if (body.type !== "BlockStatement") {
|
|
72
|
+
return isDefinitelyDefinedExpression(body);
|
|
73
|
+
}
|
|
74
|
+
if (body.body.length !== 1) {
|
|
75
|
+
return false;
|
|
76
|
+
}
|
|
77
|
+
const statement = body.body[0];
|
|
78
|
+
if (statement === undefined) {
|
|
79
|
+
return false;
|
|
80
|
+
}
|
|
81
|
+
if (statement.type !== "ReturnStatement") {
|
|
82
|
+
return false;
|
|
83
|
+
}
|
|
84
|
+
if (statement.argument === null) {
|
|
85
|
+
return false;
|
|
86
|
+
}
|
|
87
|
+
return isDefinitelyDefinedExpression(statement.argument);
|
|
88
|
+
};
|
|
89
|
+
const getPromiseValueUnionType = (returnType) => {
|
|
90
|
+
const annotation = returnType.typeAnnotation;
|
|
91
|
+
if (annotation.type !== "TSTypeReference") {
|
|
92
|
+
return undefined;
|
|
93
|
+
}
|
|
94
|
+
if (annotation.typeName.type !== "Identifier") {
|
|
95
|
+
return undefined;
|
|
96
|
+
}
|
|
97
|
+
if (annotation.typeName.name !== "Promise") {
|
|
98
|
+
return undefined;
|
|
99
|
+
}
|
|
100
|
+
const typeArguments = annotation.typeArguments;
|
|
101
|
+
if (typeArguments?.params.length !== 1) {
|
|
102
|
+
return undefined;
|
|
103
|
+
}
|
|
104
|
+
const [promiseValueType] = typeArguments.params;
|
|
105
|
+
if (promiseValueType === undefined) {
|
|
106
|
+
return undefined;
|
|
107
|
+
}
|
|
108
|
+
if (promiseValueType.type !== "TSUnionType") {
|
|
109
|
+
return undefined;
|
|
110
|
+
}
|
|
111
|
+
return promiseValueType;
|
|
112
|
+
};
|
|
113
|
+
/**
|
|
114
|
+
* Disallow redundant `undefined` inside Promise return type unions for async
|
|
115
|
+
* functions that deterministically return definitely-defined values.
|
|
116
|
+
*/
|
|
117
|
+
const rule = ruleCreator({
|
|
118
|
+
create: (context) => {
|
|
119
|
+
const sourceCode = context.sourceCode;
|
|
120
|
+
return {
|
|
121
|
+
":matches(ArrowFunctionExpression, FunctionDeclaration, FunctionExpression)[async=true]": (node) => {
|
|
122
|
+
if (node.type !== "ArrowFunctionExpression" &&
|
|
123
|
+
node.type !== "FunctionDeclaration" &&
|
|
124
|
+
node.type !== "FunctionExpression") {
|
|
125
|
+
return;
|
|
126
|
+
}
|
|
127
|
+
const returnType = node.returnType;
|
|
128
|
+
if (returnType === undefined) {
|
|
129
|
+
return;
|
|
130
|
+
}
|
|
131
|
+
const promiseValueUnionType = getPromiseValueUnionType(returnType);
|
|
132
|
+
if (promiseValueUnionType === undefined) {
|
|
133
|
+
return;
|
|
134
|
+
}
|
|
135
|
+
if (!hasDefinitelyDefinedReturnValue(node)) {
|
|
136
|
+
return;
|
|
137
|
+
}
|
|
138
|
+
const fixedPromiseValueTypeText = buildFixedTypeText(sourceCode, promiseValueUnionType);
|
|
139
|
+
if (fixedPromiseValueTypeText === undefined) {
|
|
140
|
+
return;
|
|
141
|
+
}
|
|
142
|
+
const fix = (fixer) => fixer.replaceText(promiseValueUnionType, fixedPromiseValueTypeText);
|
|
143
|
+
context.report({
|
|
144
|
+
fix,
|
|
145
|
+
messageId: "forbidden",
|
|
146
|
+
node: promiseValueUnionType,
|
|
147
|
+
suggest: [
|
|
148
|
+
{
|
|
149
|
+
fix,
|
|
150
|
+
messageId: "suggestRemoveRedundantUndefined",
|
|
151
|
+
},
|
|
152
|
+
],
|
|
153
|
+
});
|
|
154
|
+
},
|
|
155
|
+
};
|
|
156
|
+
},
|
|
157
|
+
defaultOptions: [],
|
|
158
|
+
meta: {
|
|
159
|
+
deprecated: false,
|
|
160
|
+
docs: {
|
|
161
|
+
deprecated: false,
|
|
162
|
+
description: "disallow redundant `undefined` in Promise return value unions for async functions that deterministically return definitely-defined values.",
|
|
163
|
+
frozen: false,
|
|
164
|
+
recommended: false,
|
|
165
|
+
url: "https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/typescript-no-redundant-undefined-promise-return-type",
|
|
166
|
+
},
|
|
167
|
+
fixable: "code",
|
|
168
|
+
hasSuggestions: true,
|
|
169
|
+
messages: {
|
|
170
|
+
forbidden: "Async Promise return value unions should not redundantly include `undefined` when the function deterministically returns definitely-defined values.",
|
|
171
|
+
suggestRemoveRedundantUndefined: "Remove redundant `undefined` from this Promise return value union.",
|
|
172
|
+
},
|
|
173
|
+
schema: [],
|
|
174
|
+
type: "suggestion",
|
|
175
|
+
},
|
|
176
|
+
name: "typescript/no-redundant-undefined-promise-return-type",
|
|
177
|
+
});
|
|
178
|
+
export default rule;
|
|
179
|
+
//# sourceMappingURL=typescript-no-redundant-undefined-promise-return-type.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"typescript-no-redundant-undefined-promise-return-type.js","sourceRoot":"","sources":["../../src/rules/typescript-no-redundant-undefined-promise-return-type.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAW3D,MAAM,kBAAkB,GAAG,CACvB,UAAyC,EACzC,SAAmC,EACjB,EAAE;IACpB,IAAI,qBAAqB,GAAsB,EAAE,CAAC;IAElD,KAAK,MAAM,QAAQ,IAAI,SAAS,CAAC,KAAK,EAAE,CAAC;QACrC,IAAI,QAAQ,CAAC,IAAI,KAAK,oBAAoB,EAAE,CAAC;YACzC,SAAS;QACb,CAAC;QAED,qBAAqB,GAAG;YACpB,GAAG,qBAAqB;YACxB,UAAU,CAAC,OAAO,CAAC,QAAQ,CAAC;SAC/B,CAAC;IACN,CAAC;IAED,IACI,qBAAqB,CAAC,MAAM,KAAK,CAAC;QAClC,qBAAqB,CAAC,MAAM,KAAK,SAAS,CAAC,KAAK,CAAC,MAAM,EACzD,CAAC;QACC,OAAO,SAAS,CAAC;IACrB,CAAC;IAED,OAAO,qBAAqB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AAC7C,CAAC,CAAC;AAEF,MAAM,gBAAgB,GAAG,CACrB,UAAmC,EACZ,EAAE;IACzB,IACI,UAAU,CAAC,IAAI,KAAK,gBAAgB;QACpC,UAAU,CAAC,IAAI,KAAK,uBAAuB;QAC3C,UAAU,CAAC,IAAI,KAAK,qBAAqB;QACzC,UAAU,CAAC,IAAI,KAAK,iBAAiB,EACvC,CAAC;QACC,OAAO,gBAAgB,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC;IACnD,CAAC;IAED,OAAO,UAAU,CAAC;AACtB,CAAC,CAAC;AAEF,MAAM,6BAA6B,GAAG,CAClC,UAAmC,EA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AED,MAAM,yBAAyB,GAAG,kBAAkB,CAChD,UAAU,EACV,qBAAqB,CACxB,CAAC;gBAEF,IAAI,yBAAyB,KAAK,SAAS,EAAE,CAAC;oBAC1C,OAAO;gBACX,CAAC;gBAED,MAAM,GAAG,GAAG,CACR,KAAmC,EACnB,EAAE,CAClB,KAAK,CAAC,WAAW,CACb,qBAAqB,EACrB,yBAAyB,CAC5B,CAAC;gBAEN,OAAO,CAAC,MAAM,CAAC;oBACX,GAAG;oBACH,SAAS,EAAE,WAAW;oBACtB,IAAI,EAAE,qBAAqB;oBAC3B,OAAO,EAAE;wBACL;4BACI,GAAG;4BACH,SAAS,EAAE,iCAAiC;yBAC/C;qBACJ;iBACJ,CAAC,CAAC;YACP,CAAC;SACR,CAAC;IACN,CAAC;IACD,cAAc,EAAE,EAAE;IAClB,IAAI,EAAE;QACF,UAAU,EAAE,KAAK;QACjB,IAAI,EAAE;YACF,UAAU,EAAE,KAAK;YACjB,WAAW,EACP,4IAA4I;YAChJ,MAAM,EAAE,KAAK;YACb,WAAW,EAAE,KAAK;YAClB,GAAG,EAAE,sHAAsH;SAC9H;QACD,OAAO,EAAE,MAAM;QACf,cAAc,EAAE,IAAI;QACpB,QAAQ,EAAE;YACN,SAAS,EACL,qJAAqJ;YACzJ,+BAA+B,EAC3B,oEAAoE;SAC3E;QACD,MAAM,EAAE,EAAE;QACV,IAAI,EAAE,YAAY;KACrB;IACD,IAAI,EAAE,uDAAuD;CAChE,CAAC,CAAC;AAEH,eAAe,IAAI,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ruleCreator } from "../_internal/rule-creator.js";
|
|
2
|
+
type MessageIds = "forbidden" | "suggestRemoveRedundantUndefined";
|
|
3
|
+
type Options = readonly [];
|
|
4
|
+
/**
|
|
5
|
+
* Disallow redundant `undefined` unions on readonly class properties with
|
|
6
|
+
* definitely-defined initializers.
|
|
7
|
+
*/
|
|
8
|
+
declare const rule: ReturnType<typeof ruleCreator<Options, MessageIds>>;
|
|
9
|
+
export default rule;
|
|
10
|
+
//# sourceMappingURL=typescript-no-redundant-undefined-readonly-property.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"typescript-no-redundant-undefined-readonly-property.d.ts","sourceRoot":"","sources":["../../src/rules/typescript-no-redundant-undefined-readonly-property.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAE3D,KAAK,UAAU,GAAG,WAAW,GAAG,iCAAiC,CAAC;AAElE,KAAK,OAAO,GAAG,SAAS,EAAE,CAAC;AAoF3B;;;GAGG;AACH,QAAA,MAAM,IAAI,EAAE,UAAU,CAAC,OAAO,WAAW,CAAC,OAAO,EAAE,UAAU,CAAC,CA2F5D,CAAC;AAEH,eAAe,IAAI,CAAC"}
|