diff --git a/docs/src/rules/no-div-regex.md b/docs/src/rules/no-div-regex.md index ccc7287dcbe..cb30420e700 100644 --- a/docs/src/rules/no-div-regex.md +++ b/docs/src/rules/no-div-regex.md @@ -8,7 +8,7 @@ related_rules: -Require regex literals to escape division operators. +Characters `/=` at the beginning of a regular expression literal can be confused with a division assignment operator. ```js function bar() { return /=foo/; } @@ -16,7 +16,7 @@ function bar() { return /=foo/; } ## Rule Details -This is used to disambiguate the division operator to not confuse users. +This rule forbids equal signs (`=`) after the slash (`/`) at the beginning of a regular expression literal, because the characters `/=` can be confused with a division assignment operator. Examples of **incorrect** code for this rule: diff --git a/lib/rules/no-div-regex.js b/lib/rules/no-div-regex.js index dd1c5782a58..0ecd302b2f9 100644 --- a/lib/rules/no-div-regex.js +++ b/lib/rules/no-div-regex.js @@ -15,7 +15,7 @@ module.exports = { type: "suggestion", docs: { - description: "Disallow division operators explicitly at the beginning of regular expressions", + description: "Disallow equal signs explicitly at the beginning of regular expressions", recommended: false, url: "https://eslint.org/docs/rules/no-div-regex" },