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,51 @@
|
|
|
1
|
+
import { basename, extname } from "node:path";
|
|
2
|
+
import { ruleCreator } from "../_internal/rule-creator.js";
|
|
3
|
+
const getFileStem = (filePath) => {
|
|
4
|
+
const extension = extname(filePath);
|
|
5
|
+
return basename(filePath, extension);
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* Require top-level class declarations to match the current filename.
|
|
9
|
+
*/
|
|
10
|
+
const rule = ruleCreator({
|
|
11
|
+
create: (context) => ({
|
|
12
|
+
"Program > ExportDefaultDeclaration > ClassDeclaration > Identifier.id, Program > ExportNamedDeclaration > ClassDeclaration > Identifier.id, Program > ClassDeclaration > Identifier.id": (node) => {
|
|
13
|
+
const fileName = context.filename;
|
|
14
|
+
if (fileName === "<input>") {
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
const fileStem = getFileStem(fileName);
|
|
18
|
+
if (fileStem.length === 0 || fileStem === node.name) {
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
context.report({
|
|
22
|
+
data: {
|
|
23
|
+
expected: fileStem,
|
|
24
|
+
got: node.name,
|
|
25
|
+
},
|
|
26
|
+
messageId: "mismatch",
|
|
27
|
+
node,
|
|
28
|
+
});
|
|
29
|
+
},
|
|
30
|
+
}),
|
|
31
|
+
defaultOptions: [],
|
|
32
|
+
meta: {
|
|
33
|
+
deprecated: false,
|
|
34
|
+
docs: {
|
|
35
|
+
deprecated: false,
|
|
36
|
+
description: "require class names to match the current filename.",
|
|
37
|
+
frozen: false,
|
|
38
|
+
recommended: false,
|
|
39
|
+
url: "https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/class-match-filename",
|
|
40
|
+
},
|
|
41
|
+
hasSuggestions: false,
|
|
42
|
+
messages: {
|
|
43
|
+
mismatch: "Class name '{{got}}' does not match filename '{{expected}}'. Rename the class or the file.",
|
|
44
|
+
},
|
|
45
|
+
schema: [],
|
|
46
|
+
type: "suggestion",
|
|
47
|
+
},
|
|
48
|
+
name: "class-match-filename",
|
|
49
|
+
});
|
|
50
|
+
export default rule;
|
|
51
|
+
//# sourceMappingURL=class-match-filename.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"class-match-filename.js","sourceRoot":"","sources":["../../src/rules/class-match-filename.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAE9C,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAM3D,MAAM,WAAW,GAAG,CAAC,QAAgB,EAAU,EAAE;IAC7C,MAAM,SAAS,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;IACpC,OAAO,QAAQ,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAC;AACzC,CAAC,CAAC;AAEF;;GAEG;AACH,MAAM,IAAI,GAAwD,WAAW,CAG3E;IACE,MAAM,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;QAClB,wLAAwL,EACpL,CAAC,IAA6B,EAAQ,EAAE;YACpC,MAAM,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC;YAClC,IAAI,QAAQ,KAAK,SAAS,EAAE,CAAC;gBACzB,OAAO;YACX,CAAC;YAED,MAAM,QAAQ,GAAG,WAAW,CAAC,QAAQ,CAAC,CAAC;YACvC,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC,IAAI,QAAQ,KAAK,IAAI,CAAC,IAAI,EAAE,CAAC;gBAClD,OAAO;YACX,CAAC;YAED,OAAO,CAAC,MAAM,CAAC;gBACX,IAAI,EAAE;oBACF,QAAQ,EAAE,QAAQ;oBAClB,GAAG,EAAE,IAAI,CAAC,IAAI;iBACjB;gBACD,SAAS,EAAE,UAAU;gBACrB,IAAI;aACP,CAAC,CAAC;QACP,CAAC;KACR,CAAC;IACF,cAAc,EAAE,EAAE;IAClB,IAAI,EAAE;QACF,UAAU,EAAE,KAAK;QACjB,IAAI,EAAE;YACF,UAAU,EAAE,KAAK;YACjB,WAAW,EAAE,oDAAoD;YACjE,MAAM,EAAE,KAAK;YACb,WAAW,EAAE,KAAK;YAClB,GAAG,EAAE,qFAAqF;SAC7F;QACD,cAAc,EAAE,KAAK;QACrB,QAAQ,EAAE;YACN,QAAQ,EACJ,4FAA4F;SACnG;QACD,MAAM,EAAE,EAAE;QACV,IAAI,EAAE,YAAY;KACrB;IACD,IAAI,EAAE,sBAAsB;CAC/B,CAAC,CAAC;AAEH,eAAe,IAAI,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ruleCreator } from "../_internal/rule-creator.js";
|
|
2
|
+
type MessageIds = "invalidSpacing";
|
|
3
|
+
type Options = readonly [];
|
|
4
|
+
/**
|
|
5
|
+
* Enforce consistent blank-line spacing after comments.
|
|
6
|
+
*/
|
|
7
|
+
declare const rule: ReturnType<typeof ruleCreator<Options, MessageIds>>;
|
|
8
|
+
export default rule;
|
|
9
|
+
//# sourceMappingURL=comment-spacing.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"comment-spacing.d.ts","sourceRoot":"","sources":["../../src/rules/comment-spacing.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAE3D,KAAK,UAAU,GAAG,gBAAgB,CAAC;AAEnC,KAAK,OAAO,GAAG,SAAS,EAAE,CAAC;AAkC3B;;GAEG;AACH,QAAA,MAAM,IAAI,EAAE,UAAU,CAAC,OAAO,WAAW,CAAC,OAAO,EAAE,UAAU,CAAC,CAwD5D,CAAC;AAEH,eAAe,IAAI,CAAC"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { ruleCreator } from "../_internal/rule-creator.js";
|
|
2
|
+
const isEslintDirectiveComment = (comment) => comment.type === "Block" && comment.value.trimStart().startsWith("eslint-");
|
|
3
|
+
const expectedBlankLines = (comment) => {
|
|
4
|
+
if (comment.type === "Line" || isEslintDirectiveComment(comment)) {
|
|
5
|
+
return 0;
|
|
6
|
+
}
|
|
7
|
+
return /\r\n|\n/u.test(comment.value) ? 1 : 0;
|
|
8
|
+
};
|
|
9
|
+
const buildFix = (sourceCode, comment, nextNode, expected) => (fixer) => {
|
|
10
|
+
const textBetween = sourceCode.text.slice(comment.range[1], nextNode.range[0]);
|
|
11
|
+
const lineEnding = textBetween.includes("\r\n") ? "\r\n" : "\n";
|
|
12
|
+
const indentation = " ".repeat(nextNode.loc.start.column);
|
|
13
|
+
return fixer.replaceTextRange([comment.range[1], nextNode.range[0]], `${lineEnding.repeat(expected + 1)}${indentation}`);
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Enforce consistent blank-line spacing after comments.
|
|
17
|
+
*/
|
|
18
|
+
const rule = ruleCreator({
|
|
19
|
+
create: (context) => ({
|
|
20
|
+
Program: () => {
|
|
21
|
+
const comments = context.sourceCode.getAllComments();
|
|
22
|
+
for (const comment of comments) {
|
|
23
|
+
const nextNode = context.sourceCode.getTokenAfter(comment, {
|
|
24
|
+
includeComments: false,
|
|
25
|
+
});
|
|
26
|
+
if (nextNode === null) {
|
|
27
|
+
continue;
|
|
28
|
+
}
|
|
29
|
+
const blankLines = nextNode.loc.start.line - comment.loc.end.line - 1;
|
|
30
|
+
const expected = expectedBlankLines(comment);
|
|
31
|
+
if (blankLines === expected) {
|
|
32
|
+
continue;
|
|
33
|
+
}
|
|
34
|
+
context.report({
|
|
35
|
+
fix: buildFix(context.sourceCode, comment, nextNode, expected),
|
|
36
|
+
messageId: "invalidSpacing",
|
|
37
|
+
node: comment,
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
}),
|
|
42
|
+
defaultOptions: [],
|
|
43
|
+
meta: {
|
|
44
|
+
deprecated: false,
|
|
45
|
+
docs: {
|
|
46
|
+
deprecated: false,
|
|
47
|
+
description: "enforce consistent blank-line spacing after comments.",
|
|
48
|
+
frozen: false,
|
|
49
|
+
recommended: false,
|
|
50
|
+
url: "https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/comment-spacing",
|
|
51
|
+
},
|
|
52
|
+
fixable: "whitespace",
|
|
53
|
+
hasSuggestions: false,
|
|
54
|
+
messages: {
|
|
55
|
+
invalidSpacing: "Incorrect blank-line spacing after this comment.",
|
|
56
|
+
},
|
|
57
|
+
schema: [],
|
|
58
|
+
type: "layout",
|
|
59
|
+
},
|
|
60
|
+
name: "comment-spacing",
|
|
61
|
+
});
|
|
62
|
+
export default rule;
|
|
63
|
+
//# sourceMappingURL=comment-spacing.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"comment-spacing.js","sourceRoot":"","sources":["../../src/rules/comment-spacing.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAM3D,MAAM,wBAAwB,GAAG,CAAC,OAA6B,EAAW,EAAE,CACxE,OAAO,CAAC,IAAI,KAAK,OAAO,IAAI,OAAO,CAAC,KAAK,CAAC,SAAS,EAAE,C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|
+
import { ruleCreator } from "../_internal/rule-creator.js";
|
|
2
|
+
type MessageIds = "inconsistent";
|
|
3
|
+
type Options = readonly [];
|
|
4
|
+
/**
|
|
5
|
+
* Enforce at most one consecutive empty line.
|
|
6
|
+
*/
|
|
7
|
+
declare const rule: ReturnType<typeof ruleCreator<Options, MessageIds>>;
|
|
8
|
+
export default rule;
|
|
9
|
+
//# sourceMappingURL=consistent-empty-lines.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"consistent-empty-lines.d.ts","sourceRoot":"","sources":["../../src/rules/consistent-empty-lines.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAE3D,KAAK,UAAU,GAAG,cAAc,CAAC;AAEjC,KAAK,OAAO,GAAG,SAAS,EAAE,CAAC;AA6C3B;;GAEG;AACH,QAAA,MAAM,IAAI,EAAE,UAAU,CAAC,OAAO,WAAW,CAAC,OAAO,EAAE,UAAU,CAAC,CA0C5D,CAAC;AAEH,eAAe,IAAI,CAAC"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { ruleCreator } from "../_internal/rule-creator.js";
|
|
2
|
+
const splitLines = (sourceText) => sourceText.split(/\r?\n/u);
|
|
3
|
+
const collapseEmptyLines = (sourceText) => {
|
|
4
|
+
const lines = splitLines(sourceText);
|
|
5
|
+
let output = [];
|
|
6
|
+
let emptyRun = 0;
|
|
7
|
+
for (const line of lines) {
|
|
8
|
+
const isEmpty = line.trim().length === 0;
|
|
9
|
+
if (!isEmpty) {
|
|
10
|
+
emptyRun = 0;
|
|
11
|
+
output = [...output, line];
|
|
12
|
+
continue;
|
|
13
|
+
}
|
|
14
|
+
if (emptyRun < 1) {
|
|
15
|
+
output = [...output, line];
|
|
16
|
+
}
|
|
17
|
+
emptyRun += 1;
|
|
18
|
+
}
|
|
19
|
+
return output.join("\n");
|
|
20
|
+
};
|
|
21
|
+
const hasTooManyEmptyLines = (sourceText) => {
|
|
22
|
+
let emptyRun = 0;
|
|
23
|
+
for (const line of splitLines(sourceText)) {
|
|
24
|
+
if (line.trim().length === 0) {
|
|
25
|
+
emptyRun += 1;
|
|
26
|
+
if (emptyRun >= 2) {
|
|
27
|
+
return true;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
else {
|
|
31
|
+
emptyRun = 0;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
return false;
|
|
35
|
+
};
|
|
36
|
+
/**
|
|
37
|
+
* Enforce at most one consecutive empty line.
|
|
38
|
+
*/
|
|
39
|
+
const rule = ruleCreator({
|
|
40
|
+
create: (context) => ({
|
|
41
|
+
Program: (node) => {
|
|
42
|
+
const sourceText = context.sourceCode.getText();
|
|
43
|
+
if (!hasTooManyEmptyLines(sourceText)) {
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
context.report({
|
|
47
|
+
fix: (fixer) => fixer.replaceTextRange([0, sourceText.length], collapseEmptyLines(sourceText)),
|
|
48
|
+
messageId: "inconsistent",
|
|
49
|
+
node,
|
|
50
|
+
});
|
|
51
|
+
},
|
|
52
|
+
}),
|
|
53
|
+
defaultOptions: [],
|
|
54
|
+
meta: {
|
|
55
|
+
deprecated: false,
|
|
56
|
+
docs: {
|
|
57
|
+
deprecated: false,
|
|
58
|
+
description: "enforce at most one consecutive empty line.",
|
|
59
|
+
frozen: false,
|
|
60
|
+
recommended: false,
|
|
61
|
+
url: "https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/consistent-empty-lines",
|
|
62
|
+
},
|
|
63
|
+
fixable: "whitespace",
|
|
64
|
+
hasSuggestions: false,
|
|
65
|
+
messages: {
|
|
66
|
+
inconsistent: "Consecutive empty lines should be collapsed to a single blank line.",
|
|
67
|
+
},
|
|
68
|
+
schema: [],
|
|
69
|
+
type: "layout",
|
|
70
|
+
},
|
|
71
|
+
name: "consistent-empty-lines",
|
|
72
|
+
});
|
|
73
|
+
export default rule;
|
|
74
|
+
//# sourceMappingURL=consistent-empty-lines.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"consistent-empty-lines.js","sourceRoot":"","sources":["../../src/rules/consistent-empty-lines.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAM3D,MAAM,UAAU,GAAG,CAAC,UAAkB,EAAqB,EAAE,CACzD,UAAU,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;AAE/B,MAAM,kBAAkB,GAAG,CAAC,UAAkB,EAAU,EAAE;IACtD,MAAM,KAAK,GAAG,UAAU,CAAC,UAAU,CAAC,CAAC;IACrC,IAAI,MAAM,GAAsB,EAAE,CAAC;IACnC,IAAI,QAAQ,GAAG,CAAC,CAAC;IAEjB,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACvB,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC,MAAM,KAAK,CAAC,CAAC;QACzC,IAAI,CAAC,OAAO,EAAE,CAAC;YACX,QAAQ,GAAG,CAAC,CAAC;YACb,MAAM,GAAG,CAAC,GAAG,MAAM,EAAE,IAAI,CAAC,CAAC;YAC3B,SAAS;QACb,CAAC;QAED,IAAI,QAAQ,GAAG,CAAC,EAAE,CAAC;YACf,MAAM,GAAG,CAAC,GAAG,MAAM,EAAE,IAAI,CAAC,CAAC;QAC/B,CAAC;QAED,QAAQ,IAAI,CAAC,CAAC;IAClB,CAAC;IAED,OAAO,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC7B,CAAC,CAAC;AAEF,MAAM,oBAAoB,GAAG,CAAC,UAAkB,EAAW,EAAE;IACzD,IAAI,QAAQ,GAAG,CAAC,CAAC;IAEjB,KAAK,MAAM,IAAI,IAAI,UAAU,CAAC,UAAU,CAAC,EAAE,CAAC;QACxC,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YAC3B,QAAQ,IAAI,CAAC,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+
import { ruleCreator } from "../_internal/rule-creator.js";
|
|
2
|
+
type MessageIds = "forbidden";
|
|
3
|
+
type Options = readonly [];
|
|
4
|
+
/**
|
|
5
|
+
* Enforce SCREAMING_SNAKE_CASE enum member names and literal values.
|
|
6
|
+
*/
|
|
7
|
+
declare const rule: ReturnType<typeof ruleCreator<Options, MessageIds>>;
|
|
8
|
+
export default rule;
|
|
9
|
+
//# sourceMappingURL=consistent-enum-members.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"consistent-enum-members.d.ts","sourceRoot":"","sources":["../../src/rules/consistent-enum-members.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAE3D,KAAK,UAAU,GAAG,WAAW,CAAC;AAE9B,KAAK,OAAO,GAAG,SAAS,EAAE,CAAC;AAK3B;;GAEG;AACH,QAAA,MAAM,IAAI,EAAE,UAAU,CAAC,OAAO,WAAW,CAAC,OAAO,EAAE,UAAU,CAAC,CAgC5D,CAAC;AAEH,eAAe,IAAI,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { ruleCreator } from "../_internal/rule-creator.js";
|
|
2
|
+
// eslint-disable-next-line etc-misc/no-unnecessary-template-literal -- Keep String.raw to preserve backslashes required by AST selector regex parsing.
|
|
3
|
+
const selector = String.raw `TSEnumMember:not([id.name=/^[A-Z][A-Z_\d]*$/u], [initializer.value=/^[A-Z][A-Z_\d]*$/u])`;
|
|
4
|
+
/**
|
|
5
|
+
* Enforce SCREAMING_SNAKE_CASE enum member names and literal values.
|
|
6
|
+
*/
|
|
7
|
+
const rule = ruleCreator({
|
|
8
|
+
create: (context) => ({
|
|
9
|
+
[selector]: (node) => {
|
|
10
|
+
context.report({
|
|
11
|
+
messageId: "forbidden",
|
|
12
|
+
node,
|
|
13
|
+
});
|
|
14
|
+
},
|
|
15
|
+
}),
|
|
16
|
+
defaultOptions: [],
|
|
17
|
+
meta: {
|
|
18
|
+
deprecated: false,
|
|
19
|
+
docs: {
|
|
20
|
+
deprecated: false,
|
|
21
|
+
description: "enforce SCREAMING_SNAKE_CASE enum member names and string literal values.",
|
|
22
|
+
frozen: false,
|
|
23
|
+
recommended: false,
|
|
24
|
+
url: "https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/consistent-enum-members",
|
|
25
|
+
},
|
|
26
|
+
hasSuggestions: false,
|
|
27
|
+
messages: {
|
|
28
|
+
forbidden: "Enum member names and string values must use SCREAMING_SNAKE_CASE.",
|
|
29
|
+
},
|
|
30
|
+
schema: [],
|
|
31
|
+
type: "suggestion",
|
|
32
|
+
},
|
|
33
|
+
name: "consistent-enum-members",
|
|
34
|
+
});
|
|
35
|
+
export default rule;
|
|
36
|
+
//# sourceMappingURL=consistent-enum-members.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"consistent-enum-members.js","sourceRoot":"","sources":["../../src/rules/consistent-enum-members.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAM3D,uJAAuJ;AACvJ,MAAM,QAAQ,GAAG,MAAM,CAAC,GAAG,CAAA,0FAA0F,CAAC;AAEtH;;GAEG;AACH,MAAM,IAAI,GAAwD,WAAW,CAG3E;IACE,MAAM,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;QAClB,CAAC,QAAQ,CAAC,EAAE,CAAC,IAAuB,EAAQ,EAAE;YAC1C,OAAO,CAAC,MAAM,CAAC;gBACX,SAAS,EAAE,WAAW;gBACtB,IAAI;aACP,CAAC,CAAC;QACP,CAAC;KACJ,CAAC;IACF,cAAc,EAAE,EAAE;IAClB,IAAI,EAAE;QACF,UAAU,EAAE,KAAK;QACjB,IAAI,EAAE;YACF,UAAU,EAAE,KAAK;YACjB,WAAW,EACP,2EAA2E;YAC/E,MAAM,EAAE,KAAK;YACb,WAAW,EAAE,KAAK;YAClB,GAAG,EAAE,wFAAwF;SAChG;QACD,cAAc,EAAE,KAAK;QACrB,QAAQ,EAAE;YACN,SAAS,EACL,oEAAoE;SAC3E;QACD,MAAM,EAAE,EAAE;QACV,IAAI,EAAE,YAAY;KACrB;IACD,IAAI,EAAE,yBAAyB;CAClC,CAAC,CAAC;AAEH,eAAe,IAAI,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { type Casing } from "../_internal/casing.js";
|
|
2
|
+
import { ruleCreator } from "../_internal/rule-creator.js";
|
|
3
|
+
type MessageIds = "inconsistent";
|
|
4
|
+
type Options = readonly [
|
|
5
|
+
Readonly<{
|
|
6
|
+
readonly format?: Casing;
|
|
7
|
+
}>
|
|
8
|
+
];
|
|
9
|
+
/**
|
|
10
|
+
* Enforce filename casing consistency with optional selector-based overrides.
|
|
11
|
+
*/
|
|
12
|
+
declare const rule: ReturnType<typeof ruleCreator<Options, MessageIds>>;
|
|
13
|
+
/**
|
|
14
|
+
* Wrapper rule with explicit lifecycle metadata and replacement mapping.
|
|
15
|
+
*/
|
|
16
|
+
declare const deprecatedRule: typeof rule;
|
|
17
|
+
export default deprecatedRule;
|
|
18
|
+
//# sourceMappingURL=consistent-filename.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"consistent-filename.d.ts","sourceRoot":"","sources":["../../src/rules/consistent-filename.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,MAAM,EAA0B,MAAM,wBAAwB,CAAC;AAC7E,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAM3D,KAAK,UAAU,GAAG,cAAc,CAAC;AAEjC,KAAK,OAAO,GAAG,SAAS;IACpB,QAAQ,CAAC;QACL,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;KAC5B,CAAC;CACL,CAAC;AAMF;;GAEG;AACH,QAAA,MAAM,IAAI,EAAE,UAAU,CAAC,OAAO,WAAW,CAAC,OAAO,EAAE,UAAU,CAAC,CAkE5D,CAAC;AAEH;;GAEG;AACH,QAAA,MAAM,cAAc,EAAE,OAAO,IAe3B,CAAC;AAEH,eAAe,cAAc,CAAC"}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { filenameStem, toCasing } from "../_internal/casing.js";
|
|
2
|
+
import { ruleCreator } from "../_internal/rule-creator.js";
|
|
3
|
+
import { createReplacementRuleInfo, withDeprecatedRuleLifecycle, } from "../_internal/rule-deprecation.js";
|
|
4
|
+
const defaultOptions = {
|
|
5
|
+
format: "kebab-case",
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* Enforce filename casing consistency with optional selector-based overrides.
|
|
9
|
+
*/
|
|
10
|
+
const rule = ruleCreator({
|
|
11
|
+
create: (context, [options]) => ({
|
|
12
|
+
Program: (node) => {
|
|
13
|
+
if (context.filename === "<input>") {
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
16
|
+
const stem = filenameStem(context.filename);
|
|
17
|
+
const expected = toCasing(stem, options.format ?? defaultOptions.format);
|
|
18
|
+
if (stem === expected) {
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
context.report({
|
|
22
|
+
data: {
|
|
23
|
+
expected,
|
|
24
|
+
},
|
|
25
|
+
messageId: "inconsistent",
|
|
26
|
+
node,
|
|
27
|
+
});
|
|
28
|
+
},
|
|
29
|
+
}),
|
|
30
|
+
defaultOptions: [defaultOptions],
|
|
31
|
+
meta: {
|
|
32
|
+
defaultOptions: [defaultOptions],
|
|
33
|
+
deprecated: true,
|
|
34
|
+
docs: {
|
|
35
|
+
deprecated: true,
|
|
36
|
+
description: "enforce filename casing consistency.",
|
|
37
|
+
frozen: true,
|
|
38
|
+
recommended: false,
|
|
39
|
+
url: "https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/consistent-filename",
|
|
40
|
+
},
|
|
41
|
+
hasSuggestions: false,
|
|
42
|
+
messages: {
|
|
43
|
+
inconsistent: "Filename should use '{{expected}}' casing.",
|
|
44
|
+
},
|
|
45
|
+
schema: [
|
|
46
|
+
{
|
|
47
|
+
additionalProperties: false,
|
|
48
|
+
description: "Configuration for filename casing consistency enforcement.",
|
|
49
|
+
properties: {
|
|
50
|
+
format: {
|
|
51
|
+
description: "Expected casing format for filename stems.",
|
|
52
|
+
enum: [
|
|
53
|
+
"camelCase",
|
|
54
|
+
"kebab-case",
|
|
55
|
+
"PascalCase",
|
|
56
|
+
],
|
|
57
|
+
type: "string",
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
type: "object",
|
|
61
|
+
},
|
|
62
|
+
],
|
|
63
|
+
type: "suggestion",
|
|
64
|
+
},
|
|
65
|
+
name: "consistent-filename",
|
|
66
|
+
});
|
|
67
|
+
/**
|
|
68
|
+
* Wrapper rule with explicit lifecycle metadata and replacement mapping.
|
|
69
|
+
*/
|
|
70
|
+
const deprecatedRule = withDeprecatedRuleLifecycle(rule, {
|
|
71
|
+
message: "Deprecated in favor of unicorn/filename-case.",
|
|
72
|
+
replacedBy: [
|
|
73
|
+
createReplacementRuleInfo({
|
|
74
|
+
plugin: {
|
|
75
|
+
name: "unicorn",
|
|
76
|
+
url: "https://github.com/sindresorhus/eslint-plugin-unicorn",
|
|
77
|
+
},
|
|
78
|
+
rule: {
|
|
79
|
+
name: "filename-case",
|
|
80
|
+
url: "https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/filename-case.md",
|
|
81
|
+
},
|
|
82
|
+
}),
|
|
83
|
+
],
|
|
84
|
+
ruleId: "consistent-filename",
|
|
85
|
+
});
|
|
86
|
+
export default deprecatedRule;
|
|
87
|
+
//# sourceMappingURL=consistent-filename.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"consistent-filename.js","sourceRoot":"","sources":["../../src/rules/consistent-filename.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,YAAY,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAC7E,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAC3D,OAAO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AChD,IAAI,EAAE;4BACF,WAAW;4BACX,YAAY;4BACZ,YAAY;yBACf;wBACD,IAAI,EAAE,QAAQ;qBACjB;iBACJ;gBACD,IAAI,EAAE,QAAQ;aACjB;SACJ;QACD,IAAI,EAAE,YAAY;KACrB;IACD,IAAI,EAAE,qBAAqB;CAC9B,CAAC,CAAC;AAEH;;GAEG;AACH,MAAM,cAAc,GAAgB,2BAA2B,CAAC,IAAI,EAAE;IAClE,OAAO,EAAE,+CAA+C;IACxD,UAAU,EAAE;QACR,yBAAyB,CAAC;YACtB,MAAM,EAAE;gBACJ,IAAI,EAAE,SAAS;gBACf,GAAG,EAAE,uDAAuD;aAC/D;YACD,IAAI,EAAE;gBACF,IAAI,EAAE,eAAe;gBACrB,GAAG,EAAE,6FAA6F;aACrG;SACJ,CAAC;KACL;IACD,MAAM,EAAE,qBAAqB;CAChC,CAAC,CAAC;AAEH,eAAe,cAAc,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ruleCreator } from "../_internal/rule-creator.js";
|
|
2
|
+
type ImportStyle = "default" | "mixed" | "named" | "namespace" | "side-effect";
|
|
3
|
+
type MessageIds = "inconsistent";
|
|
4
|
+
type Options = readonly [
|
|
5
|
+
Readonly<{
|
|
6
|
+
readonly style?: ImportStyle;
|
|
7
|
+
}>
|
|
8
|
+
];
|
|
9
|
+
/**
|
|
10
|
+
* Enforce consistent import declaration style per module source.
|
|
11
|
+
*/
|
|
12
|
+
declare const rule: ReturnType<typeof ruleCreator<Options, MessageIds>>;
|
|
13
|
+
export default rule;
|
|
14
|
+
//# sourceMappingURL=consistent-import.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"consistent-import.d.ts","sourceRoot":"","sources":["../../src/rules/consistent-import.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAE3D,KAAK,WAAW,GAAG,SAAS,GAAG,OAAO,GAAG,OAAO,GAAG,WAAW,GAAG,aAAa,CAAC;AAE/E,KAAK,UAAU,GAAG,cAAc,CAAC;AAEjC,KAAK,OAAO,GAAG,SAAS;IACpB,QAAQ,CAAC;QACL,QAAQ,CAAC,KAAK,CAAC,EAAE,WAAW,CAAC;KAChC,CAAC;CACL,CAAC;AAgCF;;GAEG;AACH,QAAA,MAAM,IAAI,EAAE,UAAU,CAAC,OAAO,WAAW,CAAC,OAAO,EAAE,UAAU,CAAC,CA6E5D,CAAC;AAEH,eAAe,IAAI,CAAC"}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { ruleCreator } from "../_internal/rule-creator.js";
|
|
2
|
+
const styleFromImport = (node) => {
|
|
3
|
+
if (node.specifiers.length === 0) {
|
|
4
|
+
return "side-effect";
|
|
5
|
+
}
|
|
6
|
+
const hasDefault = node.specifiers.some((specifier) => specifier.type === "ImportDefaultSpecifier");
|
|
7
|
+
const hasNamed = node.specifiers.some((specifier) => specifier.type === "ImportSpecifier");
|
|
8
|
+
const hasNamespace = node.specifiers.some((specifier) => specifier.type === "ImportNamespaceSpecifier");
|
|
9
|
+
if (hasNamespace) {
|
|
10
|
+
return "namespace";
|
|
11
|
+
}
|
|
12
|
+
if (hasDefault && hasNamed) {
|
|
13
|
+
return "mixed";
|
|
14
|
+
}
|
|
15
|
+
if (hasDefault) {
|
|
16
|
+
return "default";
|
|
17
|
+
}
|
|
18
|
+
return "named";
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* Enforce consistent import declaration style per module source.
|
|
22
|
+
*/
|
|
23
|
+
const rule = ruleCreator({
|
|
24
|
+
create: (context, [options]) => {
|
|
25
|
+
const seen = new Map();
|
|
26
|
+
return {
|
|
27
|
+
ImportDeclaration: (node) => {
|
|
28
|
+
if (typeof node.source.value !== "string") {
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
const source = node.source.value;
|
|
32
|
+
const style = styleFromImport(node);
|
|
33
|
+
const expected = options.style ?? seen.get(source) ?? style;
|
|
34
|
+
if (options.style === undefined) {
|
|
35
|
+
seen.set(source, expected);
|
|
36
|
+
}
|
|
37
|
+
if (style === expected) {
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
context.report({
|
|
41
|
+
data: {
|
|
42
|
+
expected,
|
|
43
|
+
source,
|
|
44
|
+
},
|
|
45
|
+
messageId: "inconsistent",
|
|
46
|
+
node,
|
|
47
|
+
});
|
|
48
|
+
},
|
|
49
|
+
};
|
|
50
|
+
},
|
|
51
|
+
defaultOptions: [{}],
|
|
52
|
+
meta: {
|
|
53
|
+
defaultOptions: [{}],
|
|
54
|
+
deprecated: false,
|
|
55
|
+
docs: {
|
|
56
|
+
deprecated: false,
|
|
57
|
+
description: "enforce consistent import declaration style per module source.",
|
|
58
|
+
frozen: false,
|
|
59
|
+
recommended: false,
|
|
60
|
+
url: "https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/consistent-import",
|
|
61
|
+
},
|
|
62
|
+
hasSuggestions: false,
|
|
63
|
+
messages: {
|
|
64
|
+
inconsistent: "Imports from '{{source}}' should use '{{expected}}' style consistently.",
|
|
65
|
+
},
|
|
66
|
+
schema: [
|
|
67
|
+
{
|
|
68
|
+
additionalProperties: false,
|
|
69
|
+
description: "Configuration for global import declaration style enforcement.",
|
|
70
|
+
properties: {
|
|
71
|
+
style: {
|
|
72
|
+
description: "When provided, all imports must use this style.",
|
|
73
|
+
enum: [
|
|
74
|
+
"default",
|
|
75
|
+
"mixed",
|
|
76
|
+
"named",
|
|
77
|
+
"namespace",
|
|
78
|
+
"side-effect",
|
|
79
|
+
],
|
|
80
|
+
type: "string",
|
|
81
|
+
},
|
|
82
|
+
},
|
|
83
|
+
type: "object",
|
|
84
|
+
},
|
|
85
|
+
],
|
|
86
|
+
type: "suggestion",
|
|
87
|
+
},
|
|
88
|
+
name: "consistent-import",
|
|
89
|
+
});
|
|
90
|
+
export default rule;
|
|
91
|
+
//# sourceMappingURL=consistent-import.js.map
|
|
@@ -0,0 +1 @@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,IAAI,EAAE,QAAQ;aACjB;SACJ;QACD,IAAI,EAAE,YAAY;KACrB;IACD,IAAI,EAAE,mBAAmB;CAC5B,CAAC,CAAC;AAEH,eAAe,IAAI,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ruleCreator } from "../_internal/rule-creator.js";
|
|
2
|
+
type MessageIds = "forbidden";
|
|
3
|
+
type Options = readonly [];
|
|
4
|
+
/**
|
|
5
|
+
* Disallow redundant `undefined` unions on already-optional properties.
|
|
6
|
+
*/
|
|
7
|
+
declare const rule: ReturnType<typeof ruleCreator<Options, MessageIds>>;
|
|
8
|
+
export default rule;
|
|
9
|
+
//# sourceMappingURL=consistent-optional-props.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"consistent-optional-props.d.ts","sourceRoot":"","sources":["../../src/rules/consistent-optional-props.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAE3D,KAAK,UAAU,GAAG,WAAW,CAAC;AAE9B,KAAK,OAAO,GAAG,SAAS,EAAE,CAAC;AAkC3B;;GAEG;AACH,QAAA,MAAM,IAAI,EAAE,UAAU,CAAC,OAAO,WAAW,CAAC,OAAO,EAAE,UAAU,CAAC,CAsD5D,CAAC;AAEH,eAAe,IAAI,CAAC"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { ruleCreator } from "../_internal/rule-creator.js";
|
|
2
|
+
const selector = [
|
|
3
|
+
"TSPropertySignature[optional=true] > TSTypeAnnotation > TSUnionType",
|
|
4
|
+
"PropertyDefinition[optional=true] > TSTypeAnnotation > TSUnionType",
|
|
5
|
+
].join(", ");
|
|
6
|
+
const buildOptionalUnionFixText = (sourceCode, unionType) => {
|
|
7
|
+
let nonUndefinedTypeTexts = [];
|
|
8
|
+
for (const typeNode of unionType.types) {
|
|
9
|
+
if (typeNode.type === "TSUndefinedKeyword") {
|
|
10
|
+
continue;
|
|
11
|
+
}
|
|
12
|
+
nonUndefinedTypeTexts = [
|
|
13
|
+
...nonUndefinedTypeTexts,
|
|
14
|
+
sourceCode.getText(typeNode),
|
|
15
|
+
];
|
|
16
|
+
}
|
|
17
|
+
if (nonUndefinedTypeTexts.length === 0 ||
|
|
18
|
+
nonUndefinedTypeTexts.length === unionType.types.length) {
|
|
19
|
+
return undefined;
|
|
20
|
+
}
|
|
21
|
+
return nonUndefinedTypeTexts.join(" | ");
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* Disallow redundant `undefined` unions on already-optional properties.
|
|
25
|
+
*/
|
|
26
|
+
const rule = ruleCreator({
|
|
27
|
+
create: (context) => {
|
|
28
|
+
const sourceCode = context.sourceCode;
|
|
29
|
+
return {
|
|
30
|
+
[selector]: (node) => {
|
|
31
|
+
if (node.type !== "TSUnionType") {
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
const fixedTypeText = buildOptionalUnionFixText(sourceCode, node);
|
|
35
|
+
if (fixedTypeText === undefined) {
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
const fix = (fixer) => fixer.replaceText(node, fixedTypeText);
|
|
39
|
+
context.report({
|
|
40
|
+
fix,
|
|
41
|
+
messageId: "forbidden",
|
|
42
|
+
node,
|
|
43
|
+
});
|
|
44
|
+
},
|
|
45
|
+
};
|
|
46
|
+
},
|
|
47
|
+
defaultOptions: [],
|
|
48
|
+
meta: {
|
|
49
|
+
deprecated: false,
|
|
50
|
+
docs: {
|
|
51
|
+
deprecated: false,
|
|
52
|
+
description: "disallow redundant `undefined` unions on optional property declarations.",
|
|
53
|
+
frozen: false,
|
|
54
|
+
recommended: false,
|
|
55
|
+
url: "https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/consistent-optional-props",
|
|
56
|
+
},
|
|
57
|
+
fixable: "code",
|
|
58
|
+
hasSuggestions: false,
|
|
59
|
+
messages: {
|
|
60
|
+
forbidden: "Optional properties should not redundantly include `undefined` in their type union.",
|
|
61
|
+
},
|
|
62
|
+
schema: [],
|
|
63
|
+
type: "suggestion",
|
|
64
|
+
},
|
|
65
|
+
name: "consistent-optional-props",
|
|
66
|
+
});
|
|
67
|
+
export default rule;
|
|
68
|
+
//# sourceMappingURL=consistent-optional-props.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"consistent-optional-props.js","sourceRoot":"","sources":["../../src/rules/consistent-optional-props.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAM3D,MAAM,QAAQ,GAAG;IACb,qEAAqE;IACrE,oEAAoE;CACvE,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAEb,MAAM,yBAAyB,GAAG,CAC9B,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;;GAEG;AACH,MAAM,IAAI,GAAwD,WAAW,CAG3E;IACE,MAAM,EAAE,CAAC,OAAO,EAAE,EAAE;QAChB,MAAM,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC;QAEtC,OAAO;YACH,CAAC,QAAQ,CAAC,EAAE,CAAC,IAAuB,EAAQ,EAAE;gBAC1C,IAAI,IAAI,CAAC,IAAI,KAAK,aAAa,EAAE,CAAC;oBAC9B,OAAO;gBACX,CAAC;gBAED,MAAM,aAAa,GAAG,yBAAyB,CAC3C,UAAU,EACV,IAAI,CACP,CAAC;gBACF,IAAI,aAAa,KAAK,SAAS,EAAE,CAAC;oBAC9B,OAAO;gBACX,CAAC;gBAED,MAAM,GAAG,GAAG,CACR,KAAmC,EACnB,EAAE,CAAC,KAAK,CAAC,WAAW,CAAC,IAAI,EAAE,aAAa,CAAC,CAAC;gBAE9D,OAAO,CAAC,MAAM,CAAC;oBACX,GAAG;oBACH,SAAS,EAAE,WAAW;oBACtB,IAAI;iBACP,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,0EAA0E;YAC9E,MAAM,EAAE,KAAK;YACb,WAAW,EAAE,KAAK;YAClB,GAAG,EAAE,0FAA0F;SAClG;QACD,OAAO,EAAE,MAAM;QACf,cAAc,EAAE,KAAK;QACrB,QAAQ,EAAE;YACN,SAAS,EACL,qFAAqF;SAC5F;QACD,MAAM,EAAE,EAAE;QACV,IAAI,EAAE,YAAY;KACrB;IACD,IAAI,EAAE,2BAA2B;CACpC,CAAC,CAAC;AAEH,eAAe,IAAI,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ruleCreator } from "../_internal/rule-creator.js";
|
|
2
|
+
type MessageIds = "forbidden";
|
|
3
|
+
type Options = readonly [];
|
|
4
|
+
/**
|
|
5
|
+
* Disallow explicit `.js`, `.json`, and `.ts` source extensions in
|
|
6
|
+
* imports/exports.
|
|
7
|
+
*/
|
|
8
|
+
declare const rule: ReturnType<typeof ruleCreator<Options, MessageIds>>;
|
|
9
|
+
/**
|
|
10
|
+
* Wrapper rule with explicit lifecycle metadata and replacement mapping.
|
|
11
|
+
*/
|
|
12
|
+
declare const deprecatedRule: typeof rule;
|
|
13
|
+
export default deprecatedRule;
|
|
14
|
+
//# sourceMappingURL=consistent-source-extension.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"consistent-source-extension.d.ts","sourceRoot":"","sources":["../../src/rules/consistent-source-extension.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAM3D,KAAK,UAAU,GAAG,WAAW,CAAC;AAE9B,KAAK,OAAO,GAAG,SAAS,EAAE,CAAC;AAI3B;;;GAGG;AACH,QAAA,MAAM,IAAI,EAAE,UAAU,CAAC,OAAO,WAAW,CAAC,OAAO,EAAE,UAAU,CAAC,CAgC5D,CAAC;AAEH;;GAEG;AACH,QAAA,MAAM,cAAc,EAAE,OAAO,IAe3B,CAAC;AAEH,eAAe,cAAc,CAAC"}
|