You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is this something you'd be interested in taking in as a core rule here? I'd imagine it wouldn't be something to enable in the recommended config to start given these descriptions aren't used by the default markdown docs generator. But it might be useful long-term as an opt-in option to enforce that the descriptions live in the page somehow?
For a concrete example, in typescript-eslint, the no-explicit-any rule defines descriptions:
schema: [{type: 'object',additionalProperties: false,properties: {fixToUnknown: {description:
'Whether to enable auto-fixing in which the `any` type is converted to the `unknown` type.',type: 'boolean',},ignoreRestArgs: {description: 'Whether to ignore rest parameter arrays.',type: 'boolean',},},},],
interfaceOptions{/** * Whether to enable auto-fixing in which the `any` type is converted to the `unknown` type. */fixToUnknown?: boolean;/** * Whether to ignore rest parameter arrays. */ignoreRestArgs?: boolean;}constdefaultOptions: Options=[{fixToUnknown: false,ignoreRestArgs: false},];
The text was updated successfully, but these errors were encountered:
I like this idea. I've always wanted to make schemas more helpful. Maybe a dedicated rule for it called require-meta-schema-description (as it goes beyond require-meta-schema).
Related to description, including the default property to specify the default value for an option can also be useful for documentation purposes. Maybe another rule require-meta-schema-default for this.
Porting over from typescript-eslint/typescript-eslint#5392: it's theoretically possible for docs generators to use the JSON schema
description
fields on rule options per https://json-schema.org/draft/2020-12/json-schema-core.html#name-schema-vocabularies. That way auto-generated rule docs can automatically be set up with those descriptions.Is this something you'd be interested in taking in as a core rule here? I'd imagine it wouldn't be something to enable in the recommended config to start given these descriptions aren't used by the default markdown docs generator. But it might be useful long-term as an opt-in option to enforce that the descriptions live in the page somehow?
For a concrete example, in typescript-eslint, the
no-explicit-any
rule defines descriptions:...and then https://typescript-eslint.io/rules/no-explicit-any/#options includes them as JSDoc options:
The text was updated successfully, but these errors were encountered: