Remove RegExp lookbehind assertions used to fix "Polynomial regular expression used on uncontrolled data" because they are not supported in Safari, add eslint-plugin-es rule no-regexp-lookbehind-assertions to prevent regressions.

This commit is contained in:
David Anson 2022-02-13 16:57:09 -08:00
parent f46ee0732f
commit 7c1550cbe9
5 changed files with 9 additions and 5 deletions

View file

@ -17,7 +17,7 @@ const languageJavaScript = /js|javascript/i;
function cleanJsdocRulesFromEslintConfig(config) {
const cleanedConfig = { ...config };
for (const rule in config.rules) {
if (/^(jsdoc|node|unicorn)\//.test(rule)) {
if (/^(es|jsdoc|node|unicorn)\//.test(rule)) {
delete cleanedConfig.rules[rule];
}
}