From 9380ba17865d2e53284ac033c02f0e9611d5f0b4 Mon Sep 17 00:00:00 2001 From: "Nicholas C. Zakas" Date: Fri, 15 Oct 2021 17:54:26 -0700 Subject: [PATCH] Docs: Describe range in rule docs (fixes #14162) --- docs/developer-guide/working-with-rules.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/developer-guide/working-with-rules.md b/docs/developer-guide/working-with-rules.md index d784701c5ad..269789e7188 100644 --- a/docs/developer-guide/working-with-rules.md +++ b/docs/developer-guide/working-with-rules.md @@ -321,6 +321,8 @@ The `fixer` object has the following methods: * `replaceText(nodeOrToken, text)` - replaces the text in the given node or token * `replaceTextRange(range, text)` - replaces the text in the given range +A range is a two-item array containing character indices inside of the source code. The first item is the start of the range (inclusive) and the second item is the end of the range (exclusive). Every node and token has a `range` property to identify the source code range they represent. + The above methods return a `fixing` object. The `fix()` function can return the following values: