diff --git a/.README/rules/check-examples.md b/.README/rules/check-examples.md index 26d4632e9..f2883a060 100644 --- a/.README/rules/check-examples.md +++ b/.README/rules/check-examples.md @@ -181,7 +181,7 @@ expression-oriented rules will be used by default as well: |Context|everywhere| |Tags|`example`| |Recommended|false| -|Options| *See above* | +|Options|`allowInlineConfig`, `baseConfig`, `captionRequired`, `checkDefaults`, `checkEslintrc`, `checkParams`, `checkProperties`, `configFile`, `exampleCodeRegex`, `matchingFileName`, `matchingFileNameDefaults`, `matchingFileNameParams`, `matchingFileNameProperties`, `noDefaultExampleRules`, `paddedIndent`, `rejectExampleCodeRegex`, `reportUnusedDisableDirectives`| ## Failing examples diff --git a/.README/rules/check-indentation.md b/.README/rules/check-indentation.md index 03c6517cb..f860f40fb 100644 --- a/.README/rules/check-indentation.md +++ b/.README/rules/check-indentation.md @@ -51,7 +51,7 @@ report a padding issue: |Context|everywhere| |Tags|N/A| |Recommended|false| -|Options| `excludeTags` | +|Options|`excludeTags`| ## Failing examples diff --git a/.README/rules/check-line-alignment.md b/.README/rules/check-line-alignment.md index 742ce3d06..f5859d0d0 100644 --- a/.README/rules/check-line-alignment.md +++ b/.README/rules/check-line-alignment.md @@ -54,7 +54,7 @@ Default to the empty string (no indent). ||| |---|---| |Context|everywhere| -|Options|(a string matching `"always"`, `"never"`, or `"any"` and optional object with `tags`, `customSpacings`, `preserveMainDescriptionPostDelimiter`, and `wrapIndent`)| +|Options|string ("always", "never", "any") followed by object with `customSpacings`, `preserveMainDescriptionPostDelimiter`, `tags`, `wrapIndent`| |Tags|`param`, `property`, `returns` and others added by `tags`| |Aliases|`arg`, `argument`, `prop`, `return`| |Recommended|false| diff --git a/.README/rules/check-param-names.md b/.README/rules/check-param-names.md index ef296e501..dcea0efa0 100644 --- a/.README/rules/check-param-names.md +++ b/.README/rules/check-param-names.md @@ -86,7 +86,7 @@ that are available and actually used in the function. ||| |---|---| |Context|`ArrowFunctionExpression`, `FunctionDeclaration`, `FunctionExpression`| -|Options|`allowExtraTrailingParamDocs`, `checkDestructured`, `checkRestProperty`, `checkTypesPattern`, `useDefaultObjectProperties`, `disableExtraPropertyReporting`| +|Options|`allowExtraTrailingParamDocs`, `checkDestructured`, `checkRestProperty`, `checkTypesPattern`, `disableExtraPropertyReporting`, `enableFixer`, `useDefaultObjectProperties`| |Tags|`param`| |Aliases|`arg`, `argument`| |Recommended|true| diff --git a/.README/rules/check-types.md b/.README/rules/check-types.md index e800ad06c..c980e6a9f 100644 --- a/.README/rules/check-types.md +++ b/.README/rules/check-types.md @@ -164,7 +164,7 @@ permitted. |Aliases|`constructor`, `const`, `extends`, `var`, `arg`, `argument`, `prop`, `return`, `exception`, `yield`| |Closure-only|`package`, `private`, `protected`, `public`, `static`| |Recommended|true| -|Options|`noDefaults`, `exemptTagContexts`, `unifyParentAndChildTypeChecks`| +|Options|`exemptTagContexts`, `noDefaults`, `unifyParentAndChildTypeChecks`| |Settings|`preferredTypes`, `mode`, `structuredTags`| ## Failing examples diff --git a/.README/rules/check-values.md b/.README/rules/check-values.md index 41f303c7d..8dd5fada0 100644 --- a/.README/rules/check-values.md +++ b/.README/rules/check-values.md @@ -56,7 +56,7 @@ Whether to enable validation that `@variation` must be a number. Defaults to |Context|everywhere| |Tags|`@version`, `@since`, `@kind`, `@license`, `@author`, `@variation`| |Recommended|true| -|Options|`allowedAuthors`, `allowedLicenses`, `licensePattern`| +|Options|`allowedAuthors`, `allowedLicenses`, `licensePattern`, `numericOnlyVariation`| |Settings|`tagNamePreference`| ## Failing examples diff --git a/.README/rules/match-description.md b/.README/rules/match-description.md index 0e01425b7..e829014ed 100644 --- a/.README/rules/match-description.md +++ b/.README/rules/match-description.md @@ -161,7 +161,7 @@ section of our README for more on the expected format. |Aliases|`@desc`| |Recommended|false| |Settings|| -|Options|`contexts`, `tags` (accepts tags with names and optional type such as 'param', 'arg', 'argument', 'property', and 'prop', and accepts arbitrary list of other tags with an optional type (but without names), e.g., 'returns', 'return'), `mainDescription`, `matchDescription`| +|Options|`contexts`, `mainDescription`, `matchDescription`, `message`, `tags`| ## Failing examples diff --git a/.README/rules/multiline-blocks.md b/.README/rules/multiline-blocks.md index e6173f6c1..6cbdb182a 100644 --- a/.README/rules/multiline-blocks.md +++ b/.README/rules/multiline-blocks.md @@ -96,7 +96,7 @@ cannot be reliably added after the tag either). |Tags|Any (though `singleLineTags` and `multilineTags` control the application)| |Recommended|true| |Settings|| -|Options|`noZeroLineText`, `noSingleLineBlocks`, `singleLineTags`, `noMultilineBlocks`, `minimumLengthForMultiline`, `multilineTags`, `allowMultipleTags`, `noFinalLineText`| +|Options|`allowMultipleTags`, `minimumLengthForMultiline`, `multilineTags`, `noFinalLineText`, `noMultilineBlocks`, `noSingleLineBlocks`, `noZeroLineText`, `singleLineTags`| ## Failing examples diff --git a/.README/rules/no-multi-asterisks.md b/.README/rules/no-multi-asterisks.md index 7556ad5e0..1ba882026 100644 --- a/.README/rules/no-multi-asterisks.md +++ b/.README/rules/no-multi-asterisks.md @@ -54,7 +54,7 @@ Prevent the likes of this: |Tags|(any)| |Recommended|true| |Settings|| -|Options|`preventAtEnd`, `preventAtMiddleLines`| +|Options|`allowWhitespace`, `preventAtEnd`, `preventAtMiddleLines`| ## Failing examples diff --git a/.README/rules/no-undefined-types.md b/.README/rules/no-undefined-types.md index 5f830ca8e..3d856f206 100644 --- a/.README/rules/no-undefined-types.md +++ b/.README/rules/no-undefined-types.md @@ -69,7 +69,7 @@ An option object may have the following keys: |Aliases|`constructor`, `const`, `extends`, `var`, `arg`, `argument`, `prop`, `return`, `exception`, `yield`| |Closure-only|`package`, `private`, `protected`, `public`, `static`| |Recommended|true| -|Options|`definedTypes`, `markVariablesAsUsed`, `disableReporting`| +|Options|`definedTypes`, `disableReporting`, `markVariablesAsUsed`| |Settings|`preferredTypes`, `mode`, `structuredTags`| diff --git a/.README/rules/require-asterisk-prefix.md b/.README/rules/require-asterisk-prefix.md index e6b162f01..b8d2e3223 100644 --- a/.README/rules/require-asterisk-prefix.md +++ b/.README/rules/require-asterisk-prefix.md @@ -43,7 +43,7 @@ which applies to the main jsdoc block description. |---|---| |Context|everywhere| |Tags|All or as limited by the `tags` option| -|Options|(a string matching `"always"|"never"` and optional object with `tags`)| +|Options|string ("always", "never", "any") followed by object with `tags`| ## Failing examples diff --git a/.README/rules/require-description-complete-sentence.md b/.README/rules/require-description-complete-sentence.md index 96bedc03c..32b2599d1 100644 --- a/.README/rules/require-description-complete-sentence.md +++ b/.README/rules/require-description-complete-sentence.md @@ -68,7 +68,7 @@ nouns, for example). |Tags|doc block, `param`, `returns`, `description`, `property`, `summary`, `file`, `classdesc`, `todo`, `deprecated`, `throws`, 'yields' and others added by `tags`| |Aliases|`arg`, `argument`, `return`, `desc`, `prop`, `fileoverview`, `overview`, `exception`, `yield`| |Recommended|false| -|Options|`tags`, `abbreviations`, `newlineBeforeCapsAssumesBadSentenceEnd`| +|Options|`abbreviations`, `newlineBeforeCapsAssumesBadSentenceEnd`, `tags`| ## Failing examples diff --git a/.README/rules/require-description.md b/.README/rules/require-description.md index 9bd3fbb64..0582936cd 100644 --- a/.README/rules/require-description.md +++ b/.README/rules/require-description.md @@ -42,7 +42,7 @@ An options object may have any of the following properties: | Tags | `description` or jsdoc block | | Aliases | `desc` | | Recommended | false | -| Options | `contexts`, `exemptedBy`, `descriptionStyle`, `checkConstructors`, `checkGetters`, `checkSetters` | +| Options |`checkConstructors`, `checkGetters`, `checkSetters`, `contexts`, `descriptionStyle`, `exemptedBy`| | Settings | `ignoreReplacesDocs`, `overrideReplacesDocs`, `augmentsExtendsReplacesDocs`, `implementsReplacesDocs` | ## Failing examples diff --git a/.README/rules/require-example.md b/.README/rules/require-example.md index 9e01bf89f..abf294f50 100644 --- a/.README/rules/require-example.md +++ b/.README/rules/require-example.md @@ -66,7 +66,7 @@ Defaults to `true`. |Context|`ArrowFunctionExpression`, `FunctionDeclaration`, `FunctionExpression`; others when `contexts` option enabled| |Tags|`example`| |Recommended|false| -|Options|`exemptedBy`, `exemptNoArguments`, `contexts`, `checkConstructors`, `checkGetters`, `checkSetters`, `enableFixer`| +|Options|`checkConstructors`, `checkGetters`, `checkSetters`, `contexts`, `enableFixer`, `exemptedBy`, `exemptNoArguments`| |Settings|`ignoreReplacesDocs`, `overrideReplacesDocs`, `augmentsExtendsReplacesDocs`, `implementsReplacesDocs`| # Failing examples diff --git a/.README/rules/require-hyphen-before-param-description.md b/.README/rules/require-hyphen-before-param-description.md index 56acdf55e..bb490f176 100644 --- a/.README/rules/require-hyphen-before-param-description.md +++ b/.README/rules/require-hyphen-before-param-description.md @@ -35,7 +35,7 @@ other tags besides the `@param` tag (or the `@arg` tag if so set): |Tags|`param` and optionally other tags within `tags`| |Aliases|`arg`, `argument`; potentially `prop` or other aliases| |Recommended|false| -|Options|a string matching `"always" or "never"` followed by an optional object with a `tags` property| +|Options|string ("always", "never") followed by object with `tags`| ## Failing examples diff --git a/.README/rules/require-param-description.md b/.README/rules/require-param-description.md index 04b46be58..3f73e2ae0 100644 --- a/.README/rules/require-param-description.md +++ b/.README/rules/require-param-description.md @@ -45,7 +45,7 @@ section of our README for more on the expected format. |Tags|`param`| |Aliases|`arg`, `argument`| |Recommended|true| -|Options|`setDefaultDestructuredRootDescription`, `defaultDestructuredRootDescription`, `contexts`| +|Options|`contexts`, `defaultDestructuredRootDescription`, `setDefaultDestructuredRootDescription`| |Settings|`exemptDestructuredRootsFromChecks`| ## Failing examples diff --git a/.README/rules/require-param-type.md b/.README/rules/require-param-type.md index d0d69068d..82772966b 100644 --- a/.README/rules/require-param-type.md +++ b/.README/rules/require-param-type.md @@ -44,7 +44,7 @@ section of our README for more on the expected format. |Tags|`param`| |Aliases|`arg`, `argument`| |Recommended|true| -|Options|`setDefaultDestructuredRootType`, `defaultDestructuredRootType`, `contexts`| +|Options|`contexts`, `defaultDestructuredRootType`, `setDefaultDestructuredRootType`| |Settings|`exemptDestructuredRootsFromChecks`| ## Failing examples diff --git a/.README/rules/require-param.md b/.README/rules/require-param.md index 797abbc46..6fc671384 100644 --- a/.README/rules/require-param.md +++ b/.README/rules/require-param.md @@ -377,7 +377,7 @@ supplied as default values. Defaults to `false`. | Tags | `param` | | Aliases | `arg`, `argument` | |Recommended | true| -| Options | `autoIncrementBase`, `checkDestructured`, `checkDestructuredRoots`, `contexts`, `enableFixer`, `enableRootFixer`, `enableRestElementFixer`, `checkRestProperty`, `exemptedBy`, `checkConstructors`, `checkGetters`, `checkSetters`, `checkTypesPattern`, `unnamedRootBase`, `useDefaultObjectProperties`| +| Options |`autoIncrementBase`, `checkConstructors`, `checkDestructured`, `checkDestructuredRoots`, `checkGetters`, `checkRestProperty`, `checkSetters`, `checkTypesPattern`, `contexts`, `enableFixer`, `enableRestElementFixer`, `enableRootFixer`, `exemptedBy`, `unnamedRootBase`, `useDefaultObjectProperties`| | Settings | `ignoreReplacesDocs`, `overrideReplacesDocs`, `augmentsExtendsReplacesDocs`, `implementsReplacesDocs`| ## Failing examples diff --git a/.README/rules/require-returns-check.md b/.README/rules/require-returns-check.md index 7dede5c67..af1ab4f17 100644 --- a/.README/rules/require-returns-check.md +++ b/.README/rules/require-returns-check.md @@ -44,7 +44,7 @@ Will also report if multiple `@returns` tags are present. |Context|`ArrowFunctionExpression`, `FunctionDeclaration`, `FunctionExpression`| |Tags|`returns`| |Aliases|`return`| -|Options|`exemptAsync`, `reportMissingReturnForUndefinedTypes`| +|Options|`exemptAsync`, `exemptGenerators`, `reportMissingReturnForUndefinedTypes`| |Recommended|true| ## Failing examples diff --git a/.README/rules/require-returns.md b/.README/rules/require-returns.md index 807ea4e59..240c7dd27 100644 --- a/.README/rules/require-returns.md +++ b/.README/rules/require-returns.md @@ -51,7 +51,7 @@ Will also report if multiple `@returns` tags are present. | Tags | `returns` | | Aliases | `return` | |Recommended|true| -| Options | `checkConstructors`, `checkGetters`, `contexts`, `exemptedBy`, `forceRequireReturn`, `forceReturnsWithAsync` | +| Options |`checkConstructors`, `checkGetters`, `contexts`, `exemptedBy`, `forceRequireReturn`, `forceReturnsWithAsync`| | Settings | `ignoreReplacesDocs`, `overrideReplacesDocs`, `augmentsExtendsReplacesDocs`, `implementsReplacesDocs` | ## Failing examples diff --git a/.README/rules/require-throws.md b/.README/rules/require-throws.md index 0f6874353..01068c0e7 100644 --- a/.README/rules/require-throws.md +++ b/.README/rules/require-throws.md @@ -39,7 +39,7 @@ on why TypeScript doesn't offer such a feature. | Tags | `throws` | | Aliases | `exception` | |Recommended|true| -| Options | `contexts`, `exemptedBy` | +| Options |`contexts`, `exemptedBy`| | Settings | `ignoreReplacesDocs`, `overrideReplacesDocs`, `augmentsExtendsReplacesDocs`, `implementsReplacesDocs` | ## Failing examples diff --git a/.README/rules/require-yields-check.md b/.README/rules/require-yields-check.md index f391a4c99..af2bb4fdc 100644 --- a/.README/rules/require-yields-check.md +++ b/.README/rules/require-yields-check.md @@ -44,7 +44,7 @@ Will also report if multiple `@yields` tags are present. |Tags|`yields`| |Aliases|`yield`| |Recommended|true| -|Options|`checkGeneratorsOnly`| +|Options|`checkGeneratorsOnly`, `contexts`, `exemptedBy`, `next`| ## Failing examples diff --git a/.README/rules/require-yields.md b/.README/rules/require-yields.md index 7d8d8ad10..69fd6ca78 100644 --- a/.README/rules/require-yields.md +++ b/.README/rules/require-yields.md @@ -65,7 +65,7 @@ option to expect a non-standard `@next` tag. |Tags|`yields`| |Aliases|`yield`| |Recommended|true| -| Options | `contexts`, `exemptedBy`, `withGeneratorTag`, `nextWithGeneratorTag`, `forceRequireYields`, `next` | +| Options |`contexts`, `exemptedBy`, `forceRequireNext`, `forceRequireYields`, `next`, `nextWithGeneratorTag`, `withGeneratorTag`| | Settings | `ignoreReplacesDocs`, `overrideReplacesDocs`, `augmentsExtendsReplacesDocs`, `implementsReplacesDocs` | ## Failing examples diff --git a/.README/rules/sort-tags.md b/.README/rules/sort-tags.md index bce540370..14544a517 100644 --- a/.README/rules/sort-tags.md +++ b/.README/rules/sort-tags.md @@ -244,7 +244,7 @@ such tags. Do not use with `true` if you are using `tag-lines` and `always`. |Tags|any| |Recommended|false| |Settings|| -|Options|`tagSequence`, `alphabetizeExtras`, `linesBetween`, `reportTagGroupSpacing`, `reportIntraTagGroupSpacing`| +|Options|`alphabetizeExtras`, `linesBetween`, `reportIntraTagGroupSpacing`, `reportTagGroupSpacing`, `tagSequence`| ## Failing examples diff --git a/.README/rules/tag-lines.md b/.README/rules/tag-lines.md index 81b341ab3..f7d459b7e 100644 --- a/.README/rules/tag-lines.md +++ b/.README/rules/tag-lines.md @@ -66,7 +66,7 @@ following keys: |Tags|Any| |Recommended|true| |Settings|N/A| -|Options|(a string matching `"always"`, `"never"`, or `"any"` and optional object with `count`, `applyToEndTag`, `startLines`, `endLines`)| +|Options|string ("always", "any", "never") followed by object with `applyToEndTag`, `count`, `endLines`, `startLines`, `tags`| ## Failing examples diff --git a/.README/rules/text-escaping.md b/.README/rules/text-escaping.md index 520b4c40a..0416152eb 100644 --- a/.README/rules/text-escaping.md +++ b/.README/rules/text-escaping.md @@ -33,7 +33,7 @@ This option escapes the first backtick (`` ` ``) in a paired sequence. |Tags|``| |Recommended|false| |Settings|| -|Options|| +|Options|`escapeHTML`, `escapeMarkdown`| ## Failing examples diff --git a/.npmignore b/.npmignore index 4bf551011..1f22ff515 100755 --- a/.npmignore +++ b/.npmignore @@ -1,5 +1,6 @@ coverage src +bin test .* *.log diff --git a/docs/rules/check-examples.md b/docs/rules/check-examples.md index f4bd4d092..5f57ad60b 100644 --- a/docs/rules/check-examples.md +++ b/docs/rules/check-examples.md @@ -212,7 +212,7 @@ expression-oriented rules will be used by default as well: |Context|everywhere| |Tags|`example`| |Recommended|false| -|Options| *See above* | +|Options|`allowInlineConfig`, `baseConfig`, `captionRequired`, `checkDefaults`, `checkEslintrc`, `checkParams`, `checkProperties`, `configFile`, `exampleCodeRegex`, `matchingFileName`, `matchingFileNameDefaults`, `matchingFileNameParams`, `matchingFileNameProperties`, `noDefaultExampleRules`, `paddedIndent`, `rejectExampleCodeRegex`, `reportUnusedDisableDirectives`| diff --git a/docs/rules/check-indentation.md b/docs/rules/check-indentation.md index 8cc47f22f..2396a14d5 100644 --- a/docs/rules/check-indentation.md +++ b/docs/rules/check-indentation.md @@ -64,7 +64,7 @@ report a padding issue: |Context|everywhere| |Tags|N/A| |Recommended|false| -|Options| `excludeTags` | +|Options|`excludeTags`| diff --git a/docs/rules/check-line-alignment.md b/docs/rules/check-line-alignment.md index 65af867e2..0d55e9a0f 100644 --- a/docs/rules/check-line-alignment.md +++ b/docs/rules/check-line-alignment.md @@ -79,7 +79,7 @@ Default to the empty string (no indent). ||| |---|---| |Context|everywhere| -|Options|(a string matching `"always"`, `"never"`, or `"any"` and optional object with `tags`, `customSpacings`, `preserveMainDescriptionPostDelimiter`, and `wrapIndent`)| +|Options|string ("always", "never", "any") followed by object with `customSpacings`, `preserveMainDescriptionPostDelimiter`, `tags`, `wrapIndent`| |Tags|`param`, `property`, `returns` and others added by `tags`| |Aliases|`arg`, `argument`, `prop`, `return`| |Recommended|false| diff --git a/docs/rules/check-param-names.md b/docs/rules/check-param-names.md index 1462b782f..cca4fbd4b 100644 --- a/docs/rules/check-param-names.md +++ b/docs/rules/check-param-names.md @@ -123,7 +123,7 @@ that are available and actually used in the function. ||| |---|---| |Context|`ArrowFunctionExpression`, `FunctionDeclaration`, `FunctionExpression`| -|Options|`allowExtraTrailingParamDocs`, `checkDestructured`, `checkRestProperty`, `checkTypesPattern`, `useDefaultObjectProperties`, `disableExtraPropertyReporting`| +|Options|`allowExtraTrailingParamDocs`, `checkDestructured`, `checkRestProperty`, `checkTypesPattern`, `disableExtraPropertyReporting`, `enableFixer`, `useDefaultObjectProperties`| |Tags|`param`| |Aliases|`arg`, `argument`| |Recommended|true| diff --git a/docs/rules/check-types.md b/docs/rules/check-types.md index ba4dbbe63..bc5fb4d8e 100644 --- a/docs/rules/check-types.md +++ b/docs/rules/check-types.md @@ -183,7 +183,7 @@ permitted. |Aliases|`constructor`, `const`, `extends`, `var`, `arg`, `argument`, `prop`, `return`, `exception`, `yield`| |Closure-only|`package`, `private`, `protected`, `public`, `static`| |Recommended|true| -|Options|`noDefaults`, `exemptTagContexts`, `unifyParentAndChildTypeChecks`| +|Options|`exemptTagContexts`, `noDefaults`, `unifyParentAndChildTypeChecks`| |Settings|`preferredTypes`, `mode`, `structuredTags`| diff --git a/docs/rules/check-values.md b/docs/rules/check-values.md index 8e0d2f9ff..17d3b4dca 100644 --- a/docs/rules/check-values.md +++ b/docs/rules/check-values.md @@ -78,7 +78,7 @@ Whether to enable validation that `@variation` must be a number. Defaults to |Context|everywhere| |Tags|`@version`, `@since`, `@kind`, `@license`, `@author`, `@variation`| |Recommended|true| -|Options|`allowedAuthors`, `allowedLicenses`, `licensePattern`| +|Options|`allowedAuthors`, `allowedLicenses`, `licensePattern`, `numericOnlyVariation`| |Settings|`tagNamePreference`| diff --git a/docs/rules/match-description.md b/docs/rules/match-description.md index c2bf7c574..1f198523d 100644 --- a/docs/rules/match-description.md +++ b/docs/rules/match-description.md @@ -186,7 +186,7 @@ section of our README for more on the expected format. |Aliases|`@desc`| |Recommended|false| |Settings|| -|Options|`contexts`, `tags` (accepts tags with names and optional type such as 'param', 'arg', 'argument', 'property', and 'prop', and accepts arbitrary list of other tags with an optional type (but without names), e.g., 'returns', 'return'), `mainDescription`, `matchDescription`| +|Options|`contexts`, `mainDescription`, `matchDescription`, `message`, `tags`| diff --git a/docs/rules/multiline-blocks.md b/docs/rules/multiline-blocks.md index 2f1a48e1e..9bfa0a4df 100644 --- a/docs/rules/multiline-blocks.md +++ b/docs/rules/multiline-blocks.md @@ -120,7 +120,7 @@ cannot be reliably added after the tag either). |Tags|Any (though `singleLineTags` and `multilineTags` control the application)| |Recommended|true| |Settings|| -|Options|`noZeroLineText`, `noSingleLineBlocks`, `singleLineTags`, `noMultilineBlocks`, `minimumLengthForMultiline`, `multilineTags`, `allowMultipleTags`, `noFinalLineText`| +|Options|`allowMultipleTags`, `minimumLengthForMultiline`, `multilineTags`, `noFinalLineText`, `noMultilineBlocks`, `noSingleLineBlocks`, `noZeroLineText`, `singleLineTags`| diff --git a/docs/rules/no-multi-asterisks.md b/docs/rules/no-multi-asterisks.md index 955418882..ac48654f4 100644 --- a/docs/rules/no-multi-asterisks.md +++ b/docs/rules/no-multi-asterisks.md @@ -68,7 +68,7 @@ Prevent the likes of this: |Tags|(any)| |Recommended|true| |Settings|| -|Options|`preventAtEnd`, `preventAtMiddleLines`| +|Options|`allowWhitespace`, `preventAtEnd`, `preventAtMiddleLines`| diff --git a/docs/rules/no-undefined-types.md b/docs/rules/no-undefined-types.md index 0c4b3ac39..70f3ca070 100644 --- a/docs/rules/no-undefined-types.md +++ b/docs/rules/no-undefined-types.md @@ -79,7 +79,7 @@ An option object may have the following keys: |Aliases|`constructor`, `const`, `extends`, `var`, `arg`, `argument`, `prop`, `return`, `exception`, `yield`| |Closure-only|`package`, `private`, `protected`, `public`, `static`| |Recommended|true| -|Options|`definedTypes`, `markVariablesAsUsed`, `disableReporting`| +|Options|`definedTypes`, `disableReporting`, `markVariablesAsUsed`| |Settings|`preferredTypes`, `mode`, `structuredTags`| diff --git a/docs/rules/require-asterisk-prefix.md b/docs/rules/require-asterisk-prefix.md index d3b383ded..597bde3af 100644 --- a/docs/rules/require-asterisk-prefix.md +++ b/docs/rules/require-asterisk-prefix.md @@ -53,7 +53,7 @@ which applies to the main jsdoc block description. |---|---| |Context|everywhere| |Tags|All or as limited by the `tags` option| -|Options|(a string matching `"always"|"never"` and optional object with `tags`)| +|Options|string ("always", "never", "any") followed by object with `tags`| diff --git a/docs/rules/require-description-complete-sentence.md b/docs/rules/require-description-complete-sentence.md index 611b33dda..37a6ae025 100644 --- a/docs/rules/require-description-complete-sentence.md +++ b/docs/rules/require-description-complete-sentence.md @@ -90,7 +90,7 @@ nouns, for example). |Tags|doc block, `param`, `returns`, `description`, `property`, `summary`, `file`, `classdesc`, `todo`, `deprecated`, `throws`, 'yields' and others added by `tags`| |Aliases|`arg`, `argument`, `return`, `desc`, `prop`, `fileoverview`, `overview`, `exception`, `yield`| |Recommended|false| -|Options|`tags`, `abbreviations`, `newlineBeforeCapsAssumesBadSentenceEnd`| +|Options|`abbreviations`, `newlineBeforeCapsAssumesBadSentenceEnd`, `tags`| diff --git a/docs/rules/require-description.md b/docs/rules/require-description.md index 8a9df6aad..7a344a453 100644 --- a/docs/rules/require-description.md +++ b/docs/rules/require-description.md @@ -52,7 +52,7 @@ An options object may have any of the following properties: | Tags | `description` or jsdoc block | | Aliases | `desc` | | Recommended | false | -| Options | `contexts`, `exemptedBy`, `descriptionStyle`, `checkConstructors`, `checkGetters`, `checkSetters` | +| Options |`checkConstructors`, `checkGetters`, `checkSetters`, `contexts`, `descriptionStyle`, `exemptedBy`| | Settings | `ignoreReplacesDocs`, `overrideReplacesDocs`, `augmentsExtendsReplacesDocs`, `implementsReplacesDocs` | diff --git a/docs/rules/require-example.md b/docs/rules/require-example.md index 5b3a76923..62c320286 100644 --- a/docs/rules/require-example.md +++ b/docs/rules/require-example.md @@ -98,7 +98,7 @@ Defaults to `true`. |Context|`ArrowFunctionExpression`, `FunctionDeclaration`, `FunctionExpression`; others when `contexts` option enabled| |Tags|`example`| |Recommended|false| -|Options|`exemptedBy`, `exemptNoArguments`, `contexts`, `checkConstructors`, `checkGetters`, `checkSetters`, `enableFixer`| +|Options|`checkConstructors`, `checkGetters`, `checkSetters`, `contexts`, `enableFixer`, `exemptedBy`, `exemptNoArguments`| |Settings|`ignoreReplacesDocs`, `overrideReplacesDocs`, `augmentsExtendsReplacesDocs`, `implementsReplacesDocs`| diff --git a/docs/rules/require-hyphen-before-param-description.md b/docs/rules/require-hyphen-before-param-description.md index 288eea5a3..033ab0617 100644 --- a/docs/rules/require-hyphen-before-param-description.md +++ b/docs/rules/require-hyphen-before-param-description.md @@ -48,7 +48,7 @@ other tags besides the `@param` tag (or the `@arg` tag if so set): |Tags|`param` and optionally other tags within `tags`| |Aliases|`arg`, `argument`; potentially `prop` or other aliases| |Recommended|false| -|Options|a string matching `"always" or "never"` followed by an optional object with a `tags` property| +|Options|string ("always", "never") followed by object with `tags`| diff --git a/docs/rules/require-param-description.md b/docs/rules/require-param-description.md index 337b71bd3..ec29ce3ea 100644 --- a/docs/rules/require-param-description.md +++ b/docs/rules/require-param-description.md @@ -64,7 +64,7 @@ section of our README for more on the expected format. |Tags|`param`| |Aliases|`arg`, `argument`| |Recommended|true| -|Options|`setDefaultDestructuredRootDescription`, `defaultDestructuredRootDescription`, `contexts`| +|Options|`contexts`, `defaultDestructuredRootDescription`, `setDefaultDestructuredRootDescription`| |Settings|`exemptDestructuredRootsFromChecks`| diff --git a/docs/rules/require-param-type.md b/docs/rules/require-param-type.md index f2ccd2310..2630efb57 100644 --- a/docs/rules/require-param-type.md +++ b/docs/rules/require-param-type.md @@ -63,7 +63,7 @@ section of our README for more on the expected format. |Tags|`param`| |Aliases|`arg`, `argument`| |Recommended|true| -|Options|`setDefaultDestructuredRootType`, `defaultDestructuredRootType`, `contexts`| +|Options|`contexts`, `defaultDestructuredRootType`, `setDefaultDestructuredRootType`| |Settings|`exemptDestructuredRootsFromChecks`| diff --git a/docs/rules/require-param.md b/docs/rules/require-param.md index 1fe956e84..0d7e820fc 100644 --- a/docs/rules/require-param.md +++ b/docs/rules/require-param.md @@ -447,7 +447,7 @@ supplied as default values. Defaults to `false`. | Tags | `param` | | Aliases | `arg`, `argument` | |Recommended | true| -| Options | `autoIncrementBase`, `checkDestructured`, `checkDestructuredRoots`, `contexts`, `enableFixer`, `enableRootFixer`, `enableRestElementFixer`, `checkRestProperty`, `exemptedBy`, `checkConstructors`, `checkGetters`, `checkSetters`, `checkTypesPattern`, `unnamedRootBase`, `useDefaultObjectProperties`| +| Options |`autoIncrementBase`, `checkConstructors`, `checkDestructured`, `checkDestructuredRoots`, `checkGetters`, `checkRestProperty`, `checkSetters`, `checkTypesPattern`, `contexts`, `enableFixer`, `enableRestElementFixer`, `enableRootFixer`, `exemptedBy`, `unnamedRootBase`, `useDefaultObjectProperties`| | Settings | `ignoreReplacesDocs`, `overrideReplacesDocs`, `augmentsExtendsReplacesDocs`, `implementsReplacesDocs`| diff --git a/docs/rules/require-returns-check.md b/docs/rules/require-returns-check.md index 0e72282f4..c692ddfe5 100644 --- a/docs/rules/require-returns-check.md +++ b/docs/rules/require-returns-check.md @@ -54,7 +54,7 @@ Will also report if multiple `@returns` tags are present. |Context|`ArrowFunctionExpression`, `FunctionDeclaration`, `FunctionExpression`| |Tags|`returns`| |Aliases|`return`| -|Options|`exemptAsync`, `reportMissingReturnForUndefinedTypes`| +|Options|`exemptAsync`, `exemptGenerators`, `reportMissingReturnForUndefinedTypes`| |Recommended|true| diff --git a/docs/rules/require-returns.md b/docs/rules/require-returns.md index 9f5a68ac3..34d67f841 100644 --- a/docs/rules/require-returns.md +++ b/docs/rules/require-returns.md @@ -61,7 +61,7 @@ Will also report if multiple `@returns` tags are present. | Tags | `returns` | | Aliases | `return` | |Recommended|true| -| Options | `checkConstructors`, `checkGetters`, `contexts`, `exemptedBy`, `forceRequireReturn`, `forceReturnsWithAsync` | +| Options |`checkConstructors`, `checkGetters`, `contexts`, `exemptedBy`, `forceRequireReturn`, `forceReturnsWithAsync`| | Settings | `ignoreReplacesDocs`, `overrideReplacesDocs`, `augmentsExtendsReplacesDocs`, `implementsReplacesDocs` | diff --git a/docs/rules/require-throws.md b/docs/rules/require-throws.md index 9a79c4f91..20d3d9f92 100644 --- a/docs/rules/require-throws.md +++ b/docs/rules/require-throws.md @@ -49,7 +49,7 @@ on why TypeScript doesn't offer such a feature. | Tags | `throws` | | Aliases | `exception` | |Recommended|true| -| Options | `contexts`, `exemptedBy` | +| Options |`contexts`, `exemptedBy`| | Settings | `ignoreReplacesDocs`, `overrideReplacesDocs`, `augmentsExtendsReplacesDocs`, `implementsReplacesDocs` | diff --git a/docs/rules/require-yields-check.md b/docs/rules/require-yields-check.md index 2c4f342b3..39f909467 100644 --- a/docs/rules/require-yields-check.md +++ b/docs/rules/require-yields-check.md @@ -54,7 +54,7 @@ Will also report if multiple `@yields` tags are present. |Tags|`yields`| |Aliases|`yield`| |Recommended|true| -|Options|`checkGeneratorsOnly`| +|Options|`checkGeneratorsOnly`, `contexts`, `exemptedBy`, `next`| diff --git a/docs/rules/require-yields.md b/docs/rules/require-yields.md index f0c984a4d..dc0b0b7eb 100644 --- a/docs/rules/require-yields.md +++ b/docs/rules/require-yields.md @@ -75,7 +75,7 @@ option to expect a non-standard `@next` tag. |Tags|`yields`| |Aliases|`yield`| |Recommended|true| -| Options | `contexts`, `exemptedBy`, `withGeneratorTag`, `nextWithGeneratorTag`, `forceRequireYields`, `next` | +| Options |`contexts`, `exemptedBy`, `forceRequireNext`, `forceRequireYields`, `next`, `nextWithGeneratorTag`, `withGeneratorTag`| | Settings | `ignoreReplacesDocs`, `overrideReplacesDocs`, `augmentsExtendsReplacesDocs`, `implementsReplacesDocs` | diff --git a/docs/rules/sort-tags.md b/docs/rules/sort-tags.md index f879615ee..084c1191e 100644 --- a/docs/rules/sort-tags.md +++ b/docs/rules/sort-tags.md @@ -272,7 +272,7 @@ such tags. Do not use with `true` if you are using `tag-lines` and `always`. |Tags|any| |Recommended|false| |Settings|| -|Options|`tagSequence`, `alphabetizeExtras`, `linesBetween`, `reportTagGroupSpacing`, `reportIntraTagGroupSpacing`| +|Options|`alphabetizeExtras`, `linesBetween`, `reportIntraTagGroupSpacing`, `reportTagGroupSpacing`, `tagSequence`| diff --git a/docs/rules/tag-lines.md b/docs/rules/tag-lines.md index 45cc70b32..d1f270e0c 100644 --- a/docs/rules/tag-lines.md +++ b/docs/rules/tag-lines.md @@ -94,7 +94,7 @@ following keys: |Tags|Any| |Recommended|true| |Settings|N/A| -|Options|(a string matching `"always"`, `"never"`, or `"any"` and optional object with `count`, `applyToEndTag`, `startLines`, `endLines`)| +|Options|string ("always", "any", "never") followed by object with `applyToEndTag`, `count`, `endLines`, `startLines`, `tags`| diff --git a/docs/rules/text-escaping.md b/docs/rules/text-escaping.md index 8b22128ed..a879f6cec 100644 --- a/docs/rules/text-escaping.md +++ b/docs/rules/text-escaping.md @@ -52,7 +52,7 @@ This option escapes the first backtick (`` ` ``) in a paired sequence. |Tags|``| |Recommended|false| |Settings|| -|Options|| +|Options|`escapeHTML`, `escapeMarkdown`| diff --git a/package.json b/package.json index dba63a054..6705c300b 100644 --- a/package.json +++ b/package.json @@ -24,6 +24,7 @@ "@babel/plugin-transform-flow-strip-types": "^7.21.0", "@babel/preset-env": "^7.21.5", "@babel/register": "^7.21.0", + "@es-joy/escodegen": "^3.5.1", "@es-joy/jsdoc-eslint-parser": "^0.19.0", "@hkdobrev/run-if-changed": "^0.3.1", "@semantic-release/commit-analyzer": "^9.0.2", @@ -48,6 +49,7 @@ "decamelize": "^5.0.1", "eslint": "8.41.0", "eslint-config-canonical": "~41.0.4", + "espree": "^9.5.2", "gitdown": "^3.1.5", "glob": "^10.2.6", "husky": "^8.0.3", @@ -120,8 +122,9 @@ "tsc": "tsc", "build": "rimraf ./dist && cross-env NODE_ENV=production babel ./src --out-dir ./dist --copy-files --source-maps --ignore ./src/bin/*.js --no-copy-ignored", "check-docs": "babel-node ./src/bin/generateDocs.js --check", - "create-docs": "babel-node ./src/bin/generateDocs.js", + "create-docs": "npm run create-options && babel-node ./src/bin/generateDocs.js", "create-rule": "babel-node ./src/bin/generateRule.js", + "create-options": "node ./src/bin/generateOptions.mjs", "install-offline": "pnpm install --prefer-offline --no-audit", "lint": "npm run lint-arg -- .", "lint-arg": "eslint --report-unused-disable-directives", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 9c4313239..ac905926a 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -51,6 +51,9 @@ devDependencies: '@babel/register': specifier: ^7.21.0 version: 7.21.0(@babel/core@7.21.8) + '@es-joy/escodegen': + specifier: ^3.5.1 + version: 3.5.1 '@es-joy/jsdoc-eslint-parser': specifier: ^0.19.0 version: 0.19.0 @@ -123,6 +126,9 @@ devDependencies: eslint-config-canonical: specifier: ~41.0.4 version: 41.0.4(@babel/plugin-syntax-flow@7.21.4)(@babel/plugin-transform-react-jsx@7.21.5)(@types/node@20.2.3)(eslint@8.41.0)(graphql@16.6.0)(typescript@5.0.4) + espree: + specifier: ^9.5.2 + version: 9.5.2 gitdown: specifier: ^3.1.5 version: 3.1.5 @@ -1465,6 +1471,24 @@ packages: dev: true optional: true + /@es-joy/escodegen@3.5.1: + resolution: {integrity: sha512-+ZFIB5hRBEwmbVc6LLb9zIgR5aNkluUHsqg2VfDLYf3aeDmF8uA7q614zKhwc7n0nh9Qh9XnYfzYgJNoyWSveg==} + engines: {node: '>=6.0'} + hasBin: true + dependencies: + '@es-joy/estraverse': 6.0.0 + esprima: 4.0.1 + esutils: 2.0.3 + optionator: 0.9.1 + optionalDependencies: + source-map: 0.7.4 + dev: true + + /@es-joy/estraverse@6.0.0: + resolution: {integrity: sha512-lk61BuRPDm3KCm2x8Y629+szoRuChn83kG8ll+CniQM07u5dRVzQRkBFnn/hCdL+Urdsj4/6qeOJWr+QRRkKgw==} + engines: {node: '>=4.0'} + dev: true + /@es-joy/jsdoc-eslint-parser@0.19.0: resolution: {integrity: sha512-PvggHK8390M0S/KyS2hUriNu83TLpOv2fjtuKdqE7+SeIKh7o6BgbCVjh0nxbMKVWToG2rGAaMGbOQIhxcq3ew==} engines: {node: '>=12.0.0'} @@ -8907,6 +8931,13 @@ packages: engines: {node: '>=0.10.0'} dev: true + /source-map@0.7.4: + resolution: {integrity: sha512-l3BikUxvPOcn5E74dZiq5BGsTb5yEwhaTSzccU6t4sDOH8NWJCstKO5QT2CvtFoK6F0saL7p9xHAqHOlCPJygA==} + engines: {node: '>= 8'} + requiresBuild: true + dev: true + optional: true + /spawn-error-forwarder@1.0.0: resolution: {integrity: sha512-gRjMgK5uFjbCvdibeGJuy3I5OYz6VLoVdsOJdA6wV0WlfQVLFueoqMxwwYD9RODdgb6oUIvlRlsyFSiQkMKu0g==} dev: true diff --git a/src/bin/generateOptions.mjs b/src/bin/generateOptions.mjs new file mode 100644 index 000000000..b906b1068 --- /dev/null +++ b/src/bin/generateOptions.mjs @@ -0,0 +1,85 @@ +import { + generate, +} from '@es-joy/escodegen'; +import decamelize from 'decamelize'; +import { + parse, +} from 'espree'; +import esquery from 'esquery'; +import { + readdir, + readFile, + writeFile, +} from 'fs/promises'; +import { + join, +} from 'path'; + +const rulesDir = './src/rules'; + +const dirContents = await readdir(rulesDir); + +for (const file of dirContents) { + if (!file.endsWith('.js')) { + continue; + } + + const fileContents = await readFile(join(rulesDir, file), 'utf8'); + // console.log('file', file); + const ast = parse(fileContents, { + ecmaVersion: 2_022, + sourceType: 'module', + }); + const results = esquery.query( + ast, + 'ExportDefaultDeclaration[declaration.callee.name="iterateJsdoc"]' + + ' Property[key.name="meta"] Property[key.name="schema"]', + ); + if (results[0]?.value) { + const schema = generate(results[0]?.value); + + // eslint-disable-next-line no-eval -- Need some parser + const json = eval('JSON.stringify(' + schema + ', null, 2)'); + const parsed = JSON.parse(json); + + let initial = ''; + if (Array.isArray(parsed)) { + if (!parsed.length) { + // eslint-disable-next-line no-console -- CLI + console.log('skipping no options', file); + continue; + } + + if (parsed.length >= 2) { + if (parsed.length >= 3 || parsed[0].type !== 'string') { + // eslint-disable-next-line no-console -- CLI + console.log('unexpectedly large schema', file); + continue; + // throw new Error('Unexpected long schema array'); + } + + initial = `string (${parsed[0].enum.map((item) => { + return `"${item}"`; + }).join(', ')}) followed by object with `; + parsed.shift(); + } + } + + const obj = Array.isArray(parsed) ? parsed[0] : parsed; + + const hyphenatedRule = decamelize(file, { + separator: '-', + }).replace(/\.js$/u, '.md'); + const docPath = join('.README/rules', hyphenatedRule); + + const ruleDocs = (await readFile(docPath, 'utf8')) + .replace(/(\|\s*Options\s*\|)([^|]*)(\|)?/u, `$1${ + initial + + Object.keys(obj.properties).map((key) => { + return `\`${key}\``; + }).join(', ') + }$3`); + + await writeFile(docPath, ruleDocs); + } +}