From 90c602802b6e330b79c42f282e9a615c583e32d7 Mon Sep 17 00:00:00 2001 From: Ben Perlmutter <57849986+bpmutter@users.noreply.github.com> Date: Tue, 4 Oct 2022 14:24:33 -0400 Subject: [PATCH] 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 Co-authored-by: Nicholas C. Zakas --- docs/src/developer-guide/working-with-rules.md | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/docs/src/developer-guide/working-with-rules.md b/docs/src/developer-guide/working-with-rules.md index 16412b575de..ed304b78bad 100644 --- a/docs/src/developer-guide/working-with-rules.md +++ b/docs/src/developer-guide/working-with-rules.md @@ -335,7 +335,7 @@ The `fix()` function can return the following values: * An array which includes `fixing` objects. * An iterable object which enumerates `fixing` objects. Especially, the `fix()` function can be a generator. -If you make a `fix()` function which returns multiple `fixing` objects, those `fixing` objects must not be overlapped. +If you make a `fix()` function which returns multiple `fixing` objects, those `fixing` objects must not overlap. Best practices for fixes: @@ -377,6 +377,13 @@ context.report({ }); ``` +#### Conflicting Fixes + +Conflicting fixes are fixes that apply different changes to the same part of the source code. +There is no way to specify which of the conflicting fixes is applied. + +For example, if two fixes want to modify characters 0 through 5, only one is applied. + ### Providing Suggestions 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.