Versions

no-div-regex

Disallow division operators explicitly at the beginning of regular expressions

🔧 Fixable

Some problems reported by this rule are automatically fixable by the --fix command line option

要求铰链字词转义为除法运算符。

function bar() { return /=foo/; }

规则细节

这是用来消除除法运算符的歧义,以免混淆用户。

使用此规则的错误示例:

/*eslint no-div-regex: "error"*/

function bar() { return /=foo/; }

使用此规则的正确示例:

/*eslint no-div-regex: "error"*/

function bar() { return /[=]foo/; }

Version

This rule was introduced in ESLint v0.1.0.

Resources