function checkFunction(node) {
			const scope = sourceCode.getScope(node);
			const regExpVar = astUtils.getVariableByName(scope, "RegExp");
			const shadowed = regExpVar && regExpVar.defs.length > 0;
			const patternNode = node.arguments[0];

			if (
				node.callee.type === "Identifier" &&
				node.callee.name === "RegExp" &&
				isString(patternNode) &&
				!shadowed
			) {
				const pattern = patternNode.value;
				const rawPattern = patternNode.raw.slice(1, -1);
				const rawPatternStartRange = patternNode.range[0] + 1;
				let flags;

				if (node.arguments.length < 2) {
					// It has no flags.
					flags = "";
				} else {
					const flagsNode = node.arguments[1];

					if (isString(flagsNode)) {
						flags = flagsNode.value;
					} else {
						// The flags cannot be determined.
						return;
					}
				}

				checkRegex(
					node,
					pattern,
					rawPattern,
					rawPatternStartRange,
					flags,
				);
			}
		}
Validate strings passed to the RegExp constructor
@param {ASTNode} node node to validate
@returns {void}
@private