Skip to content

Commit

Permalink
Docs: Minor tweaks to working with rules page (#9824)
Browse files Browse the repository at this point in the history
  • Loading branch information
platinumazure committed Jan 8, 2018
1 parent 54b329a commit ccfce15
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions docs/developer-guide/working-with-rules.md
Expand Up @@ -2,10 +2,11 @@

**Note:** This page covers the most recent rule format for ESLint >= 3.0.0. There is also a [deprecated rule format](./working-with-rules-deprecated.md).

Each rule in ESLint has two files named with its identifier (for example, `no-extra-semi`).
Each rule in ESLint has three files named with its identifier (for example, `no-extra-semi`).

* in the `lib/rules` directory: a source file (for example, `no-extra-semi.js`)
* in the `tests/lib/rules` directory: a test file (for example, `no-extra-semi.js`)
* in the `docs/rules` directory: a Markdown documentation file (for example, `no-extra-semi.md`)

**Important:** If you submit a **core** rule to the ESLint repository, you **must** follow some conventions explained below.

Expand All @@ -28,7 +29,8 @@ module.exports = {
docs: {
description: "disallow unnecessary semicolons",
category: "Possible Errors",
recommended: true
recommended: true,
url: "https://eslint.org/docs/rules/no-extra-semi"
},
fixable: "code",
schema: [] // no options
Expand All @@ -52,6 +54,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.md#extending-configuration-files) enables the rule
* `url` (string) specifies the URL at which the full documentation can be accessed

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 ccfce15

Please sign in to comment.