no-div-regex
要求使用正则表达式来避免分部操作器。
function bar() { return /=foo/; }
规则细节
这用于消除分部操作器的歧义,不会混淆用户。
此规则的错误代码示例:
/*eslint no-div-regex: "error"*/
function bar() { return /=foo/; }
此规则的正确代码示例:
/*eslint no-div-regex: "error"*/
function bar() { return /\=foo/; }
相关规则
- no-control-regex
- no-regex-spaces
版本
该规则在 ESLint 0.1.0中引入。
资源
本文档系腾讯云开发者社区成员共同维护,如有问题请联系 cloudcommunity@tencent.com