From af6de679751e8c29de69ef9f55cefe1ffa639f56 Mon Sep 17 00:00:00 2001 From: Ben Perlmutter Date: Thu, 29 Sep 2022 22:08:00 -0400 Subject: [PATCH 1/2] docs: Conflicting fixes Provide additional documentation on conflicting fixes. Fixes #13721 --- 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..cb773fb46c5 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 a string. +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. From d6343d969e1db66fa24f75c1cb115e1118c47d1d Mon Sep 17 00:00:00 2001 From: Ben Perlmutter <57849986+bpmutter@users.noreply.github.com> Date: Mon, 3 Oct 2022 20:18:14 -0400 Subject: [PATCH 2/2] Update docs/src/developer-guide/working-with-rules.md Co-authored-by: Nicholas C. Zakas --- docs/src/developer-guide/working-with-rules.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/src/developer-guide/working-with-rules.md b/docs/src/developer-guide/working-with-rules.md index cb773fb46c5..ed304b78bad 100644 --- a/docs/src/developer-guide/working-with-rules.md +++ b/docs/src/developer-guide/working-with-rules.md @@ -379,7 +379,7 @@ context.report({ #### Conflicting Fixes -Conflicting fixes are fixes that apply different changes to the same part of a string. +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.