Skip to content
Permalink
Browse files

Docs: clarify behavior if `meta.fixable` is omitted (refs #13349) (#1…

  • Loading branch information
mdjermanovic committed Jul 18, 2020
1 parent 1a01b42 commit 885a1455691265db88dc0befe9b48a69d69e8b9c
Showing with 2 additions and 2 deletions.
  1. +2 −2 docs/developer-guide/working-with-rules.md
@@ -68,7 +68,7 @@ The source file for a rule exports an object with the following properties.

* `fixable` (string) is either `"code"` or `"whitespace"` if the `--fix` option on the [command line](../user-guide/command-line-interface.md#fix) automatically fixes problems reported by the rule

**Important:** Without the `fixable` property, ESLint does not [apply fixes](#applying-fixes) even if the rule implements `fix` functions. Omit the `fixable` property if the rule is not fixable.
**Important:** the `fixable` property is mandatory for fixable rules. If this property isn't specified, ESLint will throw an error whenever the rule attempts to produce a fix. Omit the `fixable` property if the rule is not fixable.

* `schema` (array) specifies the [options](#options-schemas) so ESLint can prevent invalid [rule configurations](../user-guide/configuring.md#configuring-rules)

@@ -301,7 +301,7 @@ context.report({

Here, the `fix()` function is used to insert a semicolon after the node. Note that a fix is not immediately applied, and may not be applied at all if there are conflicts with other fixes. After applying fixes, ESLint will run all of the enabled rules again on the fixed code, potentially applying more fixes. This process will repeat up to 10 times, or until no more fixable problems are found. Afterwards, any remaining problems will be reported as usual.

**Important:** Unless the rule [exports](#rule-basics) the `meta.fixable` property, ESLint does not apply fixes even if the rule implements `fix` functions.
**Important:** The `meta.fixable` property is mandatory for fixable rules. ESLint will throw an error if a rule that implements `fix` functions does not [export](#rule-basics) the `meta.fixable` property.

The `fixer` object has the following methods:

0 comments on commit 885a145

Please sign in to comment.
You can’t perform that action at this time.