From b0d22e3eff18ea7f08189134c07cddceaec69a09 Mon Sep 17 00:00:00 2001 From: Bryan Mishkin <698306+bmish@users.noreply.github.com> Date: Thu, 8 Jul 2021 02:16:45 -0400 Subject: [PATCH] Docs: Mention benefit of providing `meta.docs.url` (#14774) Perhaps the top benefit of rules providing the `meta.docs.url` property with a link to their documentation is that IDEs / code editors can then provide a helpful link on rule violations. Developers often find this link useful to better understand a violation and learn how to fix it. However, many rule authors are unaware of this feature and thus exclude the property because they don't see the value of it. Mentioning this feature in ESLint's rule documentation should help encourage greater adoption of this property. Note that there is also a lint rule to require and autofix this property: https://github.com/not-an-aardvark/eslint-plugin-eslint-plugin/blob/master/docs/rules/require-meta-docs-url.md --- docs/developer-guide/working-with-rules.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/developer-guide/working-with-rules.md b/docs/developer-guide/working-with-rules.md index c15f77c4cd1..77e05da1034 100644 --- a/docs/developer-guide/working-with-rules.md +++ b/docs/developer-guide/working-with-rules.md @@ -61,7 +61,7 @@ The source file for a rule exports an object with the following properties. * `description` (string) provides the short description of the rule in the [rules index](../rules/) * `category` (string) specifies the heading under which the rule is listed in the [rules index](../rules/) * `recommended` (boolean) is whether the `"extends": "eslint:recommended"` property in a [configuration file](../user-guide/configuring/configuration-files.md#extending-configuration-files) enables the rule - * `url` (string) specifies the URL at which the full documentation can be accessed + * `url` (string) specifies the URL at which the full documentation can be accessed (enabling code editors to provide a helpful link on highlighted rule violations) * `suggestion` (boolean) specifies whether rules can return suggestions (defaults to false if omitted) In a custom rule or plugin, you can omit `docs` or include any properties that you need in it.