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 @@
|
|
|
1
|
+
{"version":3,"file":"sort-class-members.js","sourceRoot":"","sources":["../../src/rules/sort-class-members.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAC3D,OAAO,EACH,yBAAyB,EACzB,2BAA2B,GAC9B,MAAM,kCAAkC,CAAC;AAM1C,MAAM,UAAU,GAAG,CACf,MAA6D,EAC3C,EAAE;IACpB,IAAI,MAAM,CAAC,GAAG,CAAC,IAAI,KAAK,YAAY,EAAE,CAAC;QACnC,OAAO,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC;IAC3B,CAAC;IAED,IAAI,MAAM,CAAC,GAAG,CAAC,IAAI,KAAK,SAAS,IAAI,OAAO,MAAM,CAAC,GAAG,CAAC,KAAK,KAAK,QAAQ,EAAE,CAAC;QACxE,OAAO,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC;IAC5B,CAAC;IAED,OAAO,SAAS,CAAC;AACrB,CAAC,CAA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EAAE;YACN,qBAAqB,EACjB,oDAAoD;SAC3D;QACD,MAAM,EAAE,EAAE;QACV,IAAI,EAAE,YAAY;KACrB;IACD,IAAI,EAAE,oBAAoB;CAC7B,CAAC,CAAC;AAEH;;GAEG;AACH,MAAM,cAAc,GAAgB,2BAA2B,CAAC,IAAI,EAAE;IAClE,OAAO,EACH,8FAA8F;IAClG,UAAU,EAAE;QACR,yBAAyB,CAAC;YACtB,MAAM,EAAE;gBACJ,IAAI,EAAE,oBAAoB;gBAC1B,GAAG,EAAE,gEAAgE;aACxE;YACD,IAAI,EAAE;gBACF,IAAI,EAAE,oBAAoB;gBAC1B,GAAG,EAAE,gEAAgE;aACxE;SACJ,CAAC;QACF,yBAAyB,CAAC;YACtB,MAAM,EAAE;gBACJ,IAAI,EAAE,eAAe;gBACrB,GAAG,EAAE,4BAA4B;aACpC;SACJ,CAAC;KACL;IACD,MAAM,EAAE,oBAAoB;CAC/B,CAAC,CAAC;AAEH,eAAe,cAAc,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ruleCreator } from "../_internal/rule-creator.js";
|
|
2
|
+
type MessageIds = "forbidden";
|
|
3
|
+
type Options = readonly [];
|
|
4
|
+
/**
|
|
5
|
+
* Require interface construct signatures to appear before all other members.
|
|
6
|
+
*/
|
|
7
|
+
declare const rule: ReturnType<typeof ruleCreator<Options, MessageIds>>;
|
|
8
|
+
export default rule;
|
|
9
|
+
//# sourceMappingURL=sort-construct-signature.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sort-construct-signature.d.ts","sourceRoot":"","sources":["../../src/rules/sort-construct-signature.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,CA+B5D,CAAC;AAEH,eAAe,IAAI,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { ruleCreator } from "../_internal/rule-creator.js";
|
|
2
|
+
const disallowedSelector = "TSInterfaceBody > TSConstructSignatureDeclaration:not(:first-child)";
|
|
3
|
+
/**
|
|
4
|
+
* Require interface construct signatures to appear before all other members.
|
|
5
|
+
*/
|
|
6
|
+
const rule = ruleCreator({
|
|
7
|
+
create: (context) => ({
|
|
8
|
+
[disallowedSelector]: (node) => {
|
|
9
|
+
context.report({
|
|
10
|
+
messageId: "forbidden",
|
|
11
|
+
node,
|
|
12
|
+
});
|
|
13
|
+
},
|
|
14
|
+
}),
|
|
15
|
+
defaultOptions: [],
|
|
16
|
+
meta: {
|
|
17
|
+
deprecated: false,
|
|
18
|
+
docs: {
|
|
19
|
+
deprecated: false,
|
|
20
|
+
description: "require construct signatures to be the first member in interfaces.",
|
|
21
|
+
frozen: false,
|
|
22
|
+
recommended: false,
|
|
23
|
+
url: "https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/sort-construct-signature",
|
|
24
|
+
},
|
|
25
|
+
hasSuggestions: false,
|
|
26
|
+
messages: {
|
|
27
|
+
forbidden: "Construct signature should be first.",
|
|
28
|
+
},
|
|
29
|
+
schema: [],
|
|
30
|
+
type: "suggestion",
|
|
31
|
+
},
|
|
32
|
+
name: "sort-construct-signature",
|
|
33
|
+
});
|
|
34
|
+
export default rule;
|
|
35
|
+
//# sourceMappingURL=sort-construct-signature.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sort-construct-signature.js","sourceRoot":"","sources":["../../src/rules/sort-construct-signature.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAM3D,MAAM,kBAAkB,GACpB,qEAAqE,CAAC;AAE1E;;GAEG;AACH,MAAM,IAAI,GAAwD,WAAW,CAG3E;IACE,MAAM,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;QAClB,CAAC,kBAAkB,CAAC,EAAE,CAAC,IAAuB,EAAQ,EAAE;YACpD,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,oEAAoE;YACxE,MAAM,EAAE,KAAK;YACb,WAAW,EAAE,KAAK;YAClB,GAAG,EAAE,yFAAyF;SACjG;QACD,cAAc,EAAE,KAAK;QACrB,QAAQ,EAAE;YACN,SAAS,EAAE,sCAAsC;SACpD;QACD,MAAM,EAAE,EAAE;QACV,IAAI,EAAE,YAAY;KACrB;IACD,IAAI,EAAE,0BAA0B;CACnC,CAAC,CAAC;AAEH,eAAe,IAAI,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ruleCreator } from "../_internal/rule-creator.js";
|
|
2
|
+
type MessageIds = "incorrectSortingOrder";
|
|
3
|
+
type Options = readonly [];
|
|
4
|
+
/**
|
|
5
|
+
* Enforce alphabetical sorting of named export specifiers.
|
|
6
|
+
*/
|
|
7
|
+
declare const rule: ReturnType<typeof ruleCreator<Options, MessageIds>>;
|
|
8
|
+
export default rule;
|
|
9
|
+
//# sourceMappingURL=sort-export-specifiers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sort-export-specifiers.d.ts","sourceRoot":"","sources":["../../src/rules/sort-export-specifiers.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAE3D,KAAK,UAAU,GAAG,uBAAuB,CAAC;AAE1C,KAAK,OAAO,GAAG,SAAS,EAAE,CAAC;AAuB3B;;GAEG;AACH,QAAA,MAAM,IAAI,EAAE,UAAU,CAAC,OAAO,WAAW,CAAC,OAAO,EAAE,UAAU,CAAC,CA0D5D,CAAC;AAEH,eAAe,IAAI,CAAC"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/prefer-readonly-parameter-types -- ESLint fixer API callback signatures. */
|
|
2
|
+
import { ruleCreator } from "../_internal/rule-creator.js";
|
|
3
|
+
const toName = (specifier) => specifier.exported.type === "Identifier"
|
|
4
|
+
? specifier.exported.name
|
|
5
|
+
: specifier.exported.value;
|
|
6
|
+
const buildFix = (fixer, node, sourceCode, sorted) => fixer.replaceTextRange([
|
|
7
|
+
node.specifiers[0]?.range[0] ?? node.range[0],
|
|
8
|
+
// eslint-disable-next-line unicorn/prefer-at -- Node >=16.0 support baseline
|
|
9
|
+
node.specifiers[node.specifiers.length - 1]?.range[1] ??
|
|
10
|
+
node.range[1],
|
|
11
|
+
], sorted.map((specifier) => sourceCode.getText(specifier)).join(", "));
|
|
12
|
+
/**
|
|
13
|
+
* Enforce alphabetical sorting of named export specifiers.
|
|
14
|
+
*/
|
|
15
|
+
const rule = ruleCreator({
|
|
16
|
+
create: (context) => ({
|
|
17
|
+
ExportNamedDeclaration: (node) => {
|
|
18
|
+
let exportSpecifiers = [];
|
|
19
|
+
for (const specifier of node.specifiers) {
|
|
20
|
+
if (specifier.type === "ExportSpecifier") {
|
|
21
|
+
exportSpecifiers = [...exportSpecifiers, specifier];
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
if (exportSpecifiers.length < 2) {
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
// eslint-disable-next-line unicorn/no-array-sort -- Node >=16.0 support baseline
|
|
28
|
+
const sorted = [...exportSpecifiers].sort((a, b) => toName(a).localeCompare(toName(b)));
|
|
29
|
+
const unchanged = exportSpecifiers.every((specifier, index) => specifier === sorted[index]);
|
|
30
|
+
if (unchanged) {
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
context.report({
|
|
34
|
+
fix: (fixer) => buildFix(fixer, node, context.sourceCode, sorted),
|
|
35
|
+
messageId: "incorrectSortingOrder",
|
|
36
|
+
node,
|
|
37
|
+
});
|
|
38
|
+
},
|
|
39
|
+
}),
|
|
40
|
+
defaultOptions: [],
|
|
41
|
+
meta: {
|
|
42
|
+
deprecated: false,
|
|
43
|
+
docs: {
|
|
44
|
+
deprecated: false,
|
|
45
|
+
description: "enforce alphabetical sorting of named export specifiers.",
|
|
46
|
+
frozen: false,
|
|
47
|
+
recommended: false,
|
|
48
|
+
url: "https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/sort-export-specifiers",
|
|
49
|
+
},
|
|
50
|
+
fixable: "code",
|
|
51
|
+
hasSuggestions: false,
|
|
52
|
+
messages: {
|
|
53
|
+
incorrectSortingOrder: "Named export specifiers should be sorted alphabetically.",
|
|
54
|
+
},
|
|
55
|
+
schema: [],
|
|
56
|
+
type: "suggestion",
|
|
57
|
+
},
|
|
58
|
+
name: "sort-export-specifiers",
|
|
59
|
+
});
|
|
60
|
+
export default rule;
|
|
61
|
+
/* eslint-enable @typescript-eslint/prefer-readonly-parameter-types -- Re-enable after file-scoped fixer callback implementations. */
|
|
62
|
+
//# sourceMappingURL=sort-export-specifiers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sort-export-specifiers.js","sourceRoot":"","sources":["../../src/rules/sort-export-specifiers.ts"],"names":[],"mappings":"AAAA,gHAAgH;AAIhH,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAM3D,MAAM,MAAM,GAAG,CAAC,SAAuC,EAAU,EAAE,CAC/D,SAAS,CAAC,QAAQ,CAAC,IAAI,KAAK,YAAY;IACpC,CAAC,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI;IACzB,CAAC,CAAC,SAAS,CAAC,QAAQ,CAAC,KAAK,CAAC;AAEnC,MAAM,QAAQ,GAAG,CACb,KAAyB,EACzB,IAAyC,EACzC,U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C,SAAS,EAAE,KAAK,EAAE,EAAE,CAAC,SAAS,KAAK,MAAM,CAAC,KAAK,CAAC,CACpD,CAAC;YACF,IAAI,SAAS,EAAE,CAAC;gBACZ,OAAO;YACX,CAAC;YAED,OAAO,CAAC,MAAM,CAAC;gBACX,GAAG,EAAE,CAAC,KAAK,EAAE,EAAE,CACX,QAAQ,CAAC,KAAK,EAAE,IAAI,EAAE,OAAO,CAAC,UAAU,EAAE,MAAM,CAAC;gBACrD,SAAS,EAAE,uBAAuB;gBAClC,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,0DAA0D;YAC9D,MAAM,EAAE,KAAK;YACb,WAAW,EAAE,KAAK;YAClB,GAAG,EAAE,uFAAuF;SAC/F;QACD,OAAO,EAAE,MAAM;QACf,cAAc,EAAE,KAAK;QACrB,QAAQ,EAAE;YACN,qBAAqB,EACjB,0DAA0D;SACjE;QACD,MAAM,EAAE,EAAE;QACV,IAAI,EAAE,YAAY;KACrB;IACD,IAAI,EAAE,wBAAwB;CACjC,CAAC,CAAC;AAEH,eAAe,IAAI,CAAC;AAEpB,qIAAqI"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ruleCreator } from "../_internal/rule-creator.js";
|
|
2
|
+
type MessageIds = "incorrectSorting";
|
|
3
|
+
type Options = readonly [];
|
|
4
|
+
/**
|
|
5
|
+
* Enforce alphabetical sorting of object literal keys.
|
|
6
|
+
*/
|
|
7
|
+
declare const rule: ReturnType<typeof ruleCreator<Options, MessageIds>>;
|
|
8
|
+
export default rule;
|
|
9
|
+
//# sourceMappingURL=sort-keys.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sort-keys.d.ts","sourceRoot":"","sources":["../../src/rules/sort-keys.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAE3D,KAAK,UAAU,GAAG,kBAAkB,CAAC;AAErC,KAAK,OAAO,GAAG,SAAS,EAAE,CAAC;AAyC3B;;GAEG;AACH,QAAA,MAAM,IAAI,EAAE,UAAU,CAAC,OAAO,WAAW,CAAC,OAAO,EAAE,UAAU,CAAC,CAiE5D,CAAC;AAEH,eAAe,IAAI,CAAC"}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/prefer-readonly-parameter-types -- ESLint fixer API callback signatures. */
|
|
2
|
+
import { ruleCreator } from "../_internal/rule-creator.js";
|
|
3
|
+
const keyName = (property) => {
|
|
4
|
+
if (property.key.type === "Identifier") {
|
|
5
|
+
return property.key.name;
|
|
6
|
+
}
|
|
7
|
+
if (property.key.type === "Literal" &&
|
|
8
|
+
typeof property.key.value === "string") {
|
|
9
|
+
return property.key.value;
|
|
10
|
+
}
|
|
11
|
+
return undefined;
|
|
12
|
+
};
|
|
13
|
+
const buildFix = (sourceCode, properties) => (fixer) => {
|
|
14
|
+
const first = properties[0];
|
|
15
|
+
// eslint-disable-next-line unicorn/prefer-at -- Node >=16.0 support baseline
|
|
16
|
+
const last = properties[properties.length - 1];
|
|
17
|
+
if (first === undefined || last === undefined) {
|
|
18
|
+
return fixer.insertTextAfterRange([0, 0], "");
|
|
19
|
+
}
|
|
20
|
+
// eslint-disable-next-line unicorn/no-array-sort -- Node >=16.0 support baseline
|
|
21
|
+
const sorted = [...properties].sort((a, b) => (keyName(a) ?? "").localeCompare(keyName(b) ?? ""));
|
|
22
|
+
return fixer.replaceTextRange([first.range[0], last.range[1]], sorted.map((property) => sourceCode.getText(property)).join(", "));
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* Enforce alphabetical sorting of object literal keys.
|
|
26
|
+
*/
|
|
27
|
+
const rule = ruleCreator({
|
|
28
|
+
create: (context) => ({
|
|
29
|
+
ObjectExpression: (node) => {
|
|
30
|
+
let properties = [];
|
|
31
|
+
for (const property of node.properties) {
|
|
32
|
+
if (property.type === "Property" &&
|
|
33
|
+
property.kind === "init" &&
|
|
34
|
+
!property.computed) {
|
|
35
|
+
properties = [...properties, property];
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
if (properties.length < 2) {
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
let previousName = "";
|
|
42
|
+
let hasPreviousName = false;
|
|
43
|
+
for (const property of properties) {
|
|
44
|
+
const currentName = keyName(property);
|
|
45
|
+
if (currentName === undefined) {
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
if (hasPreviousName &&
|
|
49
|
+
currentName.localeCompare(previousName) < 0) {
|
|
50
|
+
context.report({
|
|
51
|
+
fix: buildFix(context.sourceCode, properties),
|
|
52
|
+
messageId: "incorrectSorting",
|
|
53
|
+
node: property,
|
|
54
|
+
});
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
previousName = currentName;
|
|
58
|
+
hasPreviousName = true;
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
}),
|
|
62
|
+
defaultOptions: [],
|
|
63
|
+
meta: {
|
|
64
|
+
deprecated: false,
|
|
65
|
+
docs: {
|
|
66
|
+
deprecated: false,
|
|
67
|
+
description: "enforce alphabetical sorting of object literal keys.",
|
|
68
|
+
frozen: false,
|
|
69
|
+
recommended: false,
|
|
70
|
+
url: "https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/sort-keys",
|
|
71
|
+
},
|
|
72
|
+
fixable: "code",
|
|
73
|
+
hasSuggestions: false,
|
|
74
|
+
messages: {
|
|
75
|
+
incorrectSorting: "Object keys should appear in alphabetical order.",
|
|
76
|
+
},
|
|
77
|
+
schema: [],
|
|
78
|
+
type: "suggestion",
|
|
79
|
+
},
|
|
80
|
+
name: "sort-keys",
|
|
81
|
+
});
|
|
82
|
+
export default rule;
|
|
83
|
+
/* eslint-enable @typescript-eslint/prefer-readonly-parameter-types -- Re-enable after file-scoped fixer callback implementations. */
|
|
84
|
+
//# sourceMappingURL=sort-keys.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sort-keys.js","sourceRoot":"","sources":["../../src/rules/sort-keys.ts"],"names":[],"mappings":"AAAA,gHAAgH;AAIhH,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAM3D,MAAM,OAAO,GAAG,CAAC,QAA+B,EAAsB,EAAE;IACpE,IAAI,QAAQ,CAAC,GAAG,CAAC,IAAI,KAAK,YAAY,EAAE,CAAC;QACrC,OAAO,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC;IAC7B,CAAC;IAED,IACI,QAAQ,CAAC,GAAG,CAAC,IAAI,KAAK,SAAS;QAC/B,OAAO,QAAQ,CAAC,GAAG,CAAC,KAAK,KAAK,QAAQ,EACxC,CAAC;QACC,OAAO,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC;IAC9B,CAAC;IAED,OAAO,SAAS,CAAC;AACrB,CAAC,CAAC;AAEF,MAAM,QAAQ,GACV,CACI,UAAyC,EACzC,UAAkC,EACR,EAAE,CAChC,CAAC,KAAK,EAAoB,EAAE;IACxB,MAAM,KAAK,GAAG,UAAU,CAAC,CAAC,CAAC,CAAC;IAC5B,6EAA6E;IAC7E,MAAM,IAAI,GAAG,UAAU,CAAC,UAAU,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IAC/C,IAAI,KAAK,KAAK,SAAS,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;QAC5C,OAAO,KAAK,CAAC,oBAAoB,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;IAClD,CAAC;IAED,iFAAiF;IACjF,MAAM,MAAM,GAAG,CAAC,GAAG,UAAU,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CACzC,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,EAAE,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C,EAC7C,CAAC;oBACC,OAAO,CAAC,MAAM,CAAC;wBACX,GAAG,EAAE,QAAQ,CAAC,OAAO,CAAC,UAAU,EAAE,UAAU,CAAC;wBAC7C,SAAS,EAAE,kBAAkB;wBAC7B,IAAI,EAAE,QAAQ;qBACjB,CAAC,CAAC;oBACH,OAAO;gBACX,CAAC;gBAED,YAAY,GAAG,WAAW,CAAC;gBAC3B,eAAe,GAAG,IAAI,CAAC;YAC3B,CAAC;QACL,CAAC;KACJ,CAAC;IACF,cAAc,EAAE,EAAE;IAClB,IAAI,EAAE;QACF,UAAU,EAAE,KAAK;QACjB,IAAI,EAAE;YACF,UAAU,EAAE,KAAK;YACjB,WAAW,EAAE,sDAAsD;YACnE,MAAM,EAAE,KAAK;YACb,WAAW,EAAE,KAAK;YAClB,GAAG,EAAE,0EAA0E;SAClF;QACD,OAAO,EAAE,MAAM;QACf,cAAc,EAAE,KAAK;QACrB,QAAQ,EAAE;YACN,gBAAgB,EACZ,kDAAkD;SACzD;QACD,MAAM,EAAE,EAAE;QACV,IAAI,EAAE,YAAY;KACrB;IACD,IAAI,EAAE,WAAW;CACpB,CAAC,CAAC;AAEH,eAAe,IAAI,CAAC;AAEpB,qIAAqI"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ruleCreator } from "../_internal/rule-creator.js";
|
|
2
|
+
type MessageIds = "incorrectSorting";
|
|
3
|
+
type Options = readonly [];
|
|
4
|
+
/**
|
|
5
|
+
* Enforce alphabetical ordering of top-of-file comments.
|
|
6
|
+
*/
|
|
7
|
+
declare const rule: ReturnType<typeof ruleCreator<Options, MessageIds>>;
|
|
8
|
+
export default rule;
|
|
9
|
+
//# sourceMappingURL=sort-top-comments.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sort-top-comments.d.ts","sourceRoot":"","sources":["../../src/rules/sort-top-comments.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAE3D,KAAK,UAAU,GAAG,kBAAkB,CAAC;AAErC,KAAK,OAAO,GAAG,SAAS,EAAE,CAAC;AAe3B;;GAEG;AACH,QAAA,MAAM,IAAI,EAAE,UAAU,CAAC,OAAO,WAAW,CAAC,OAAO,EAAE,UAAU,CAAC,CAuE5D,CAAC;AAEH,eAAe,IAAI,CAAC"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/prefer-readonly-parameter-types -- ESLint fixer API callback signatures. */
|
|
2
|
+
import { ruleCreator } from "../_internal/rule-creator.js";
|
|
3
|
+
const commentText = (comment) => comment.value.trim();
|
|
4
|
+
const buildReplacement = (sourceCode, comments) => comments
|
|
5
|
+
.map((comment) => sourceCode.getText(comment))
|
|
6
|
+
// eslint-disable-next-line unicorn/no-array-sort -- Node >=16.0 support baseline
|
|
7
|
+
.sort((a, b) => a.localeCompare(b))
|
|
8
|
+
.join("\n");
|
|
9
|
+
/**
|
|
10
|
+
* Enforce alphabetical ordering of top-of-file comments.
|
|
11
|
+
*/
|
|
12
|
+
const rule = ruleCreator({
|
|
13
|
+
create: (context) => ({
|
|
14
|
+
Program: (node) => {
|
|
15
|
+
const firstNode = node.body[0];
|
|
16
|
+
if (firstNode === undefined) {
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
const comments = context.sourceCode
|
|
20
|
+
.getCommentsBefore(firstNode)
|
|
21
|
+
.filter((comment) => comment.loc.end.line < firstNode.loc.start.line);
|
|
22
|
+
if (comments.length < 2) {
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
const firstComment = comments[0];
|
|
26
|
+
if (firstComment === undefined) {
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
// eslint-disable-next-line unicorn/prefer-at -- Node >=16.0 support baseline
|
|
30
|
+
const lastComment = comments[comments.length - 1] ?? firstComment;
|
|
31
|
+
// eslint-disable-next-line unicorn/no-array-sort -- Node >=16.0 support baseline
|
|
32
|
+
const sorted = [...comments].sort((a, b) => commentText(a).localeCompare(commentText(b)));
|
|
33
|
+
const isSorted = comments.every((comment, index) => comment === sorted[index]);
|
|
34
|
+
if (isSorted) {
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
context.report({
|
|
38
|
+
fix: (fixer) => fixer.replaceTextRange([firstComment.range[0], lastComment.range[1]], buildReplacement(context.sourceCode, comments)),
|
|
39
|
+
messageId: "incorrectSorting",
|
|
40
|
+
node: firstComment,
|
|
41
|
+
});
|
|
42
|
+
},
|
|
43
|
+
}),
|
|
44
|
+
defaultOptions: [],
|
|
45
|
+
meta: {
|
|
46
|
+
deprecated: false,
|
|
47
|
+
docs: {
|
|
48
|
+
deprecated: false,
|
|
49
|
+
description: "enforce alphabetical ordering of top-of-file comments.",
|
|
50
|
+
frozen: false,
|
|
51
|
+
recommended: false,
|
|
52
|
+
url: "https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/sort-top-comments",
|
|
53
|
+
},
|
|
54
|
+
fixable: "code",
|
|
55
|
+
hasSuggestions: false,
|
|
56
|
+
messages: {
|
|
57
|
+
incorrectSorting: "Top-level comments should be sorted alphabetically.",
|
|
58
|
+
},
|
|
59
|
+
schema: [],
|
|
60
|
+
type: "suggestion",
|
|
61
|
+
},
|
|
62
|
+
name: "sort-top-comments",
|
|
63
|
+
});
|
|
64
|
+
export default rule;
|
|
65
|
+
/* eslint-enable @typescript-eslint/prefer-readonly-parameter-types -- Re-enable after file-scoped fixer callback implementations. */
|
|
66
|
+
//# sourceMappingURL=sort-top-comments.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sort-top-comments.js","sourceRoot":"","sources":["../../src/rules/sort-top-comments.ts"],"names":[],"mappings":"AAAA,gHAAgH;AAIhH,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAM3D,MAAM,WAAW,GAAG,CAAC,OAA6B,EAAU,EAAE,CAC1D,OAAO,CAAC,KAAK,CAAC,IAAI,EAA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|
+
type Options = readonly [];
|
|
4
|
+
/**
|
|
5
|
+
* Enforce consistent spacing and break placement inside switch cases.
|
|
6
|
+
*/
|
|
7
|
+
declare const rule: ReturnType<typeof ruleCreator<Options, MessageIds>>;
|
|
8
|
+
/**
|
|
9
|
+
* Wrapper rule with explicit lifecycle metadata and replacement mapping.
|
|
10
|
+
*/
|
|
11
|
+
declare const deprecatedRule: typeof rule;
|
|
12
|
+
export default deprecatedRule;
|
|
13
|
+
//# sourceMappingURL=switch-case-spacing.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"switch-case-spacing.d.ts","sourceRoot":"","sources":["../../src/rules/switch-case-spacing.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAM3D,KAAK,UAAU,GAAG,WAAW,CAAC;AAE9B,KAAK,OAAO,GAAG,SAAS,EAAE,CAAC;AAuB3B;;GAEG;AACH,QAAA,MAAM,IAAI,EAAE,UAAU,CAAC,OAAO,WAAW,CAAC,OAAO,EAAE,UAAU,CAAC,CAoC5D,CAAC;AAEH;;GAEG;AACH,QAAA,MAAM,cAAc,EAAE,OAAO,IAe3B,CAAC;AAEH,eAAe,cAAc,CAAC"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { ruleCreator } from "../_internal/rule-creator.js";
|
|
2
|
+
import { createReplacementRuleInfo, withDeprecatedRuleLifecycle, } from "../_internal/rule-deprecation.js";
|
|
3
|
+
const isValidCaseBody = (node) => {
|
|
4
|
+
if (node.consequent.length === 0) {
|
|
5
|
+
return true;
|
|
6
|
+
}
|
|
7
|
+
const [firstStatement] = node.consequent;
|
|
8
|
+
// eslint-disable-next-line unicorn/prefer-at -- Node >=16.0 support baseline
|
|
9
|
+
const lastStatement = node.consequent[node.consequent.length - 1];
|
|
10
|
+
if (firstStatement === undefined || lastStatement === undefined) {
|
|
11
|
+
return true;
|
|
12
|
+
}
|
|
13
|
+
const startsOnFollowingLine = firstStatement.loc.start.line > node.loc.start.line;
|
|
14
|
+
const startsWithBlock = firstStatement.type === "BlockStatement";
|
|
15
|
+
const endsWithBreak = lastStatement.type === "BreakStatement" || startsWithBlock;
|
|
16
|
+
return (startsOnFollowingLine || startsWithBlock) && endsWithBreak;
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* Enforce consistent spacing and break placement inside switch cases.
|
|
20
|
+
*/
|
|
21
|
+
const rule = ruleCreator({
|
|
22
|
+
create: (context) => ({
|
|
23
|
+
SwitchCase: (node) => {
|
|
24
|
+
if (isValidCaseBody(node)) {
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
context.report({
|
|
28
|
+
messageId: "forbidden",
|
|
29
|
+
node,
|
|
30
|
+
});
|
|
31
|
+
},
|
|
32
|
+
}),
|
|
33
|
+
defaultOptions: [],
|
|
34
|
+
meta: {
|
|
35
|
+
deprecated: true,
|
|
36
|
+
docs: {
|
|
37
|
+
deprecated: true,
|
|
38
|
+
description: "enforce consistent spacing and break placement in switch cases.",
|
|
39
|
+
frozen: true,
|
|
40
|
+
recommended: false,
|
|
41
|
+
url: "https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/switch-case-spacing",
|
|
42
|
+
},
|
|
43
|
+
hasSuggestions: false,
|
|
44
|
+
messages: {
|
|
45
|
+
forbidden: "Case body should start on a new line and end with break.",
|
|
46
|
+
},
|
|
47
|
+
schema: [],
|
|
48
|
+
type: "suggestion",
|
|
49
|
+
},
|
|
50
|
+
name: "switch-case-spacing",
|
|
51
|
+
});
|
|
52
|
+
/**
|
|
53
|
+
* Wrapper rule with explicit lifecycle metadata and replacement mapping.
|
|
54
|
+
*/
|
|
55
|
+
const deprecatedRule = withDeprecatedRuleLifecycle(rule, {
|
|
56
|
+
message: "Deprecated in favor of @stylistic/switch-colon-spacing.",
|
|
57
|
+
replacedBy: [
|
|
58
|
+
createReplacementRuleInfo({
|
|
59
|
+
plugin: {
|
|
60
|
+
name: "@stylistic",
|
|
61
|
+
url: "https://eslint.style/",
|
|
62
|
+
},
|
|
63
|
+
rule: {
|
|
64
|
+
name: "switch-colon-spacing",
|
|
65
|
+
url: "https://eslint.style/rules/switch-colon-spacing",
|
|
66
|
+
},
|
|
67
|
+
}),
|
|
68
|
+
],
|
|
69
|
+
ruleId: "switch-case-spacing",
|
|
70
|
+
});
|
|
71
|
+
export default deprecatedRule;
|
|
72
|
+
//# sourceMappingURL=switch-case-spacing.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"switch-case-spacing.js","sourceRoot":"","sources":["../../src/rules/switch-case-spacing.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAC3D,OAAO,EACH,yBAAyB,EACzB,2BAA2B,GAC9B,MAAM,kCAAkC,CAAC;AAM1C,MAAM,eAAe,GAAG,CAAC,IAA6B,EAAW,EAAE;IAC/D,IAAI,IAAI,CAAC,UAAU,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC/B,OAAO,IAAI,CAAC;IAChB,CAAC;IAED,MAAM,CAAC,cAAc,CAAC,GAAG,IAAI,CAAC,UAAU,CAAC;IACzC,6EAA6E;IAC7E,MAAM,aAAa,GAAG,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,UAAU,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IAClE,IAAI,cAAc,KAAK,SAAS,IAAI,aAAa,KAAK,SAAS,EAAE,CAAC;QAC9D,OAAO,IAAI,CAAC;IAChB,CAAC;IAED,MAAM,qBAAqB,GACvB,cAAc,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC;IACxD,MAAM,eAAe,GAAG,cAAc,CAAC,IAAI,KAAK,gBAAgB,CAAC;IACjE,MAAM,aAAa,GACf,aAAa,CAAC,IAAI,KAAK,gBAAgB,IAAI,eAAe,CAAC;IAE/D,OAAO,CAAC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alidFormat";
|
|
3
|
+
type Options = readonly [];
|
|
4
|
+
/**
|
|
5
|
+
* Enforce newline boundary formatting for multiline template literals.
|
|
6
|
+
*/
|
|
7
|
+
declare const rule: ReturnType<typeof ruleCreator<Options, MessageIds>>;
|
|
8
|
+
export default rule;
|
|
9
|
+
//# sourceMappingURL=template-literal-format.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"template-literal-format.d.ts","sourceRoot":"","sources":["../../src/rules/template-literal-format.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAE3D,KAAK,UAAU,GAAG,eAAe,CAAC;AAElC,KAAK,OAAO,GAAG,SAAS,EAAE,CAAC;AAkD3B;;GAEG;AACH,QAAA,MAAM,IAAI,EAAE,UAAU,CAAC,OAAO,WAAW,CAAC,OAAO,EAAE,UAAU,CAAC,CAyC5D,CAAC;AAEH,eAAe,IAAI,CAAC"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { ruleCreator } from "../_internal/rule-creator.js";
|
|
2
|
+
const isMultilineTemplate = (node) => node.loc.start.line !== node.loc.end.line;
|
|
3
|
+
const hasExpectedBoundaryNewlines = (node) => {
|
|
4
|
+
const first = node.quasis[0]?.value.raw ?? "";
|
|
5
|
+
// eslint-disable-next-line unicorn/prefer-at -- Node >=16.0 support baseline
|
|
6
|
+
const last = node.quasis[node.quasis.length - 1]?.value.raw ?? "";
|
|
7
|
+
return first.startsWith("\n") && last.endsWith("\n");
|
|
8
|
+
};
|
|
9
|
+
const normalizeTemplate = (sourceText) => {
|
|
10
|
+
const lines = sourceText.split(/\r?\n/u);
|
|
11
|
+
const contentLines = lines.slice(1, -1);
|
|
12
|
+
const indents = contentLines
|
|
13
|
+
.filter((line) => line.trim().length > 0)
|
|
14
|
+
.map((line) => /^\s*/u.exec(line)?.[0].length ?? 0);
|
|
15
|
+
const minIndent = indents.length === 0 ? 0 : Math.min(...indents);
|
|
16
|
+
const normalizedContent = contentLines
|
|
17
|
+
.map((line) => line.length >= minIndent ? line.slice(minIndent) : line)
|
|
18
|
+
.map((line) => ` ${line}`)
|
|
19
|
+
.join("\n");
|
|
20
|
+
// eslint-disable-next-line unicorn/prefer-at -- Node >=16.0 support baseline
|
|
21
|
+
const lastLine = lines[lines.length - 1] ?? "";
|
|
22
|
+
return [
|
|
23
|
+
lines[0],
|
|
24
|
+
normalizedContent,
|
|
25
|
+
lastLine,
|
|
26
|
+
].join("\n");
|
|
27
|
+
};
|
|
28
|
+
const buildFix = (sourceCode, node) => (fixer) => {
|
|
29
|
+
const text = sourceCode.getText(node);
|
|
30
|
+
return fixer.replaceText(node, normalizeTemplate(text));
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* Enforce newline boundary formatting for multiline template literals.
|
|
34
|
+
*/
|
|
35
|
+
const rule = ruleCreator({
|
|
36
|
+
create: (context) => ({
|
|
37
|
+
TemplateLiteral: (node) => {
|
|
38
|
+
if (!isMultilineTemplate(node) ||
|
|
39
|
+
hasExpectedBoundaryNewlines(node)) {
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
context.report({
|
|
43
|
+
fix: buildFix(context.sourceCode, node),
|
|
44
|
+
messageId: "invalidFormat",
|
|
45
|
+
node,
|
|
46
|
+
});
|
|
47
|
+
},
|
|
48
|
+
}),
|
|
49
|
+
defaultOptions: [],
|
|
50
|
+
meta: {
|
|
51
|
+
deprecated: false,
|
|
52
|
+
docs: {
|
|
53
|
+
deprecated: false,
|
|
54
|
+
description: "enforce newline boundary formatting for multiline template literals.",
|
|
55
|
+
frozen: false,
|
|
56
|
+
recommended: false,
|
|
57
|
+
url: "https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/template-literal-format",
|
|
58
|
+
},
|
|
59
|
+
fixable: "code",
|
|
60
|
+
hasSuggestions: false,
|
|
61
|
+
messages: {
|
|
62
|
+
invalidFormat: "Multiline template literals must start and end on their own lines.",
|
|
63
|
+
},
|
|
64
|
+
schema: [],
|
|
65
|
+
type: "layout",
|
|
66
|
+
},
|
|
67
|
+
name: "template-literal-format",
|
|
68
|
+
});
|
|
69
|
+
export default rule;
|
|
70
|
+
//# sourceMappingURL=template-literal-format.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"template-literal-format.js","sourceRoot":"","sources":["../../src/rules/template-literal-format.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAM3D,MAAM,mBAAmB,GAAG,CAAC,IAAkC,EAAW,EAAE,CACxE,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,KAAK,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC;AAE9C,MAAM,2BAA2B,GAAG,CAChC,IAAkC,EAC3B,EAAE;IACT,MAAM,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,GAAG,IAAI,EAAE,CAAC;IAC9C,6EAA6E;IAC7E,MAAM,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,EAAE,KAAK,CAAC,GAAG,IAAI,EAAE,CAAC;IAElE,OAAO,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;AACzD,CAAC,CAAC;AAEF,MAAM,iBAAiB,GAAG,CAAC,UAAkB,EAAU,EAAE;IACrD,MAAM,KAAK,GAAG,UAAU,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;IACzC,MAAM,YAAY,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IACxC,MAAM,OAAO,GAAG,YAAY;SACvB,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,MAAM,GAAG,CAAC,CAAC;SACxC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E;YAC1D,IACI,CAAC,mBAAmB,CAAC,IAAI,CAAC;gBAC1B,2BAA2B,CAAC,IAAI,CAAC,EACnC,CAAC;gBACC,OAAO;YACX,CAAC;YAED,OAAO,CAAC,MAAM,CAAC;gBACX,GAAG,EAAE,QAAQ,CAAC,OAAO,CAAC,UAAU,EAAE,IAAI,CAAC;gBACvC,SAAS,EAAE,eAAe;gBAC1B,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,sEAAsE;YAC1E,MAAM,EAAE,KAAK;YACb,WAAW,EAAE,KAAK;YAClB,GAAG,EAAE,wFAAwF;SAChG;QACD,OAAO,EAAE,MAAM;QACf,cAAc,EAAE,KAAK;QACrB,QAAQ,EAAE;YACN,aAAa,EACT,oEAAoE;SAC3E;QACD,MAAM,EAAE,EAAE;QACV,IAAI,EAAE,QAAQ;KACjB;IACD,IAAI,EAAE,yBAAyB;CAClC,CAAC,CAAC;AAEH,eAAe,IAAI,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ruleCreator } from "../_internal/rule-creator.js";
|
|
2
|
+
type MessageIds = "forbidden" | "suggestWrapInError";
|
|
3
|
+
type Options = readonly [];
|
|
4
|
+
/**
|
|
5
|
+
* Disallow throwing or rejecting values that are not Error-like.
|
|
6
|
+
*/
|
|
7
|
+
declare const rule: ReturnType<typeof ruleCreator<Options, MessageIds>>;
|
|
8
|
+
export default rule;
|
|
9
|
+
//# sourceMappingURL=throw-error.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"throw-error.d.ts","sourceRoot":"","sources":["../../src/rules/throw-error.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAE3D,KAAK,UAAU,GAAG,WAAW,GAAG,oBAAoB,CAAC;AAErD,KAAK,OAAO,GAAG,SAAS,EAAE,CAAC;AA6C3B;;GAEG;AACH,QAAA,MAAM,IAAI,EAAE,UAAU,CAAC,OAAO,WAAW,CAAC,OAAO,EAAE,UAAU,CAAC,CA4I5D,CAAC;AAEH,eAAe,IAAI,CAAC"}
|