Skip to content

Commit 90c6028

Browse files
bpmutternzakas
andauthored
docs: Conflicting fixes (#16366)
* docs: Conflicting fixes Provide additional documentation on conflicting fixes. Fixes #13721 * Update docs/src/developer-guide/working-with-rules.md Co-authored-by: Nicholas C. Zakas <nicholas@humanwhocodes.com> Co-authored-by: Nicholas C. Zakas <nicholas@humanwhocodes.com>
1 parent 5a3fe70 commit 90c6028

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

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

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ The `fix()` function can return the following values:
335335
* An array which includes `fixing` objects.
336336
* An iterable object which enumerates `fixing` objects. Especially, the `fix()` function can be a generator.
337337

338-
If you make a `fix()` function which returns multiple `fixing` objects, those `fixing` objects must not be overlapped.
338+
If you make a `fix()` function which returns multiple `fixing` objects, those `fixing` objects must not overlap.
339339

340340
Best practices for fixes:
341341

@@ -377,6 +377,13 @@ context.report({
377377
});
378378
```
379379

380+
#### Conflicting Fixes
381+
382+
Conflicting fixes are fixes that apply different changes to the same part of the source code.
383+
There is no way to specify which of the conflicting fixes is applied.
384+
385+
For example, if two fixes want to modify characters 0 through 5, only one is applied.
386+
380387
### Providing Suggestions
381388

382389
In some cases fixes aren't appropriate to be automatically applied, for example, if a fix potentially changes functionality or if there are multiple valid ways to fix a rule depending on the implementation intent (see the best practices for [applying fixes](#applying-fixes) listed above). In these cases, there is an alternative `suggest` option on `context.report()` that allows other tools, such as editors, to expose helpers for users to manually apply a suggestion.

0 commit comments

Comments
 (0)