eslint-plugin-escompat
Advanced tools
Comparing version 2.1.2 to 2.1.3
@@ -8,3 +8,17 @@ module.exports = (context, badBrowser) => ({ | ||
'CallExpression[callee.name="RegExp"], NewExpression[callee.name="RegExp"]'(node) { | ||
if (node.arguments[1] && node.arguments[1].value.includes('s')) { | ||
const [, flags] = node.arguments; | ||
if ( | ||
flags && | ||
( | ||
( | ||
flags.type === 'Literal' && | ||
typeof flags.value === 'string' && | ||
flags.value.includes('s') | ||
) || | ||
( | ||
flags.type === 'TemplateLiteral' && | ||
flags.quasis.some(({value: {raw}}) => raw.includes('s')) | ||
) | ||
) | ||
) { | ||
context.report(node, `RegExp "s" flag is not supported in ${badBrowser}`) | ||
@@ -11,0 +25,0 @@ } |
{ | ||
"name": "eslint-plugin-escompat", | ||
"version": "2.1.2", | ||
"version": "2.1.3", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "keywords": [], |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
12909
200