From 35f3254d5f8027f75a6cb35b58bea10037003be8 Mon Sep 17 00:00:00 2001 From: "Nicholas C. Zakas" Date: Sun, 17 Oct 2021 08:46:29 -0700 Subject: [PATCH] Docs: Describe range in rule docs (fixes #14162) (#15174) --- 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: