A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://eslint.org/docs/latest/rules/no-div-regex below:

no-div-regex - ESLint - Pluggable JavaScript Linter

no-div-regex

Disallow equal signs explicitly at the beginning of regular expressions

🔧 Fixable

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

❄️ Frozen

This rule is currently frozen and is not accepting feature requests.

Table of Contents

Characters /= at the beginning of a regular expression literal can be confused with a division assignment operator.

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

1

Rule Details

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:

Examples of correct code for this rule:

Version

This rule was introduced in ESLint v0.1.0.

Resources

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4