From 0daecd1632e9b45cb54b4d9e3d237a7d37408dcc Mon Sep 17 00:00:00 2001 From: Stefan Wullems Date: Thu, 27 Aug 2020 19:48:31 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#47078=20eslint:=20?= =?UTF-8?q?suggestion=20property=20to=20docs=20=20by=20@stefan-wullems?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * eslint: suggestion property to docs Add the suggestion property to the docs object and boyscout some docs. * add test case --- types/eslint/eslint-tests.ts | 1 + types/eslint/index.d.ts | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/types/eslint/eslint-tests.ts b/types/eslint/eslint-tests.ts index 58d19c4441..5bfc8a0dec 100644 --- a/types/eslint/eslint-tests.ts +++ b/types/eslint/eslint-tests.ts @@ -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' }}; diff --git a/types/eslint/index.d.ts b/types/eslint/index.d.ts index 3654d815b8..8ecea57fc4 100644 --- a/types/eslint/index.d.ts +++ b/types/eslint/index.d.ts @@ -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';