Skip to content

Commit 885a145

Browse files
authored
Docs: clarify behavior if meta.fixable is omitted (refs #13349) (#13493)
1 parent 1a01b42 commit 885a145

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

docs/developer-guide/working-with-rules.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ The source file for a rule exports an object with the following properties.
6868

6969
* `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
7070

71-
**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.
71+
**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.
7272

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

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

302302
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.
303303

304-
**Important:** Unless the rule [exports](#rule-basics) the `meta.fixable` property, ESLint does not apply fixes even if the rule implements `fix` functions.
304+
**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.
305305

306306
The `fixer` object has the following methods:
307307

0 commit comments

Comments
 (0)