Skip to content

Commit

Permalink
Docs: Mention benefit of providing meta.docs.url (#14774)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
bmish committed Jul 8, 2021
1 parent 000cc79 commit b0d22e3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/developer-guide/working-with-rules.md
Expand Up @@ -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.
Expand Down

0 comments on commit b0d22e3

Please sign in to comment.