pageClass | sidebarDepth | title | description | since |
---|---|---|---|---|
rule-details |
0 |
regexp/no-trivially-nested-assertion |
disallow trivially nested assertions |
v0.9.0 |
💼 This rule is enabled in the ✅ plugin:regexp/recommended
config.
🔧 This rule is automatically fixable by the --fix
CLI option.
disallow trivially nested assertions
Lookaround assertions that only contain another assertion can be simplified.
/* eslint regexp/no-trivially-nested-assertion: "error" */
/* ✓ GOOD */
var foo = /a(?=b)/;
var foo = /a(?!$)/;
/* ✗ BAD */
var foo = /a(?=$)/;
var foo = /a(?=(?!a))/;
Nothing.
This rule was introduced in eslint-plugin-regexp v0.9.0