🤖 Merge PR #47078 eslint: suggestion property to docs by @stefan-wullems

* eslint: suggestion property to docs

Add the suggestion property to the docs object and boyscout some docs.

* add test case
This commit is contained in:
Stefan Wullems 2020-08-27 19:48:31 +02:00 committed by GitHub
parent 352d27df82
commit 0daecd1632
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 0 deletions

View File

@ -277,6 +277,7 @@ rule = { create(context) { return {}; }, meta: {
category: 'Possible Errors',
recommended: true,
url: 'https://eslint.org/docs/rules/no-console',
suggestion: true
}
}};
rule = { create(context) { return {}; }, meta: { fixable: 'whitespace' }};

View File

@ -286,10 +286,16 @@ export namespace Rule {
interface RuleMetaData {
docs?: {
/** provides the short description of the rule in the [rules index](https://eslint.org/docs/rules/) */
description?: string;
/** specifies the heading under which the rule is listed in the [rules index](https://eslint.org/docs/rules/) */
category?: string;
/** is whether the `"extends": "eslint:recommended"` property in a [configuration file](https://eslint.org/docs/user-guide/configuring#extending-configuration-files) enables the rule */
recommended?: boolean;
/** specifies the URL at which the full documentation can be accessed */
url?: string;
/** specifies whether rules can return suggestions (defaults to false if omitted) */
suggestion?: boolean
};
messages?: { [messageId: string]: string };
fixable?: 'code' | 'whitespace';