From 0ebbbd8d7957bc1c38ad3c35718815a49595fa36 Mon Sep 17 00:00:00 2001 From: Denis Pushkarev Date: Tue, 17 Oct 2023 11:28:55 +0700 Subject: [PATCH] update `eslint-plugin-regexp` --- package-lock.json | 6 +- scripts/bundle-tests/package-lock.json | 6 +- tests/eslint/eslint.config.js | 10 ++++ tests/eslint/package-lock.json | 77 ++++++++++++-------------- tests/eslint/package.json | 2 +- tests/observables/package-lock.json | 6 +- 6 files changed, 55 insertions(+), 52 deletions(-) diff --git a/package-lock.json b/package-lock.json index 97e11735cc6c..290e6f3276d0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2354,9 +2354,9 @@ } }, "node_modules/electron-to-chromium": { - "version": "1.4.554", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.554.tgz", - "integrity": "sha512-Q0umzPJjfBrrj8unkONTgbKQXzXRrH7sVV7D9ea2yBV3Oaogz991yhbpfvo2LMNkJItmruXTEzVpP9cp7vaIiQ==" + "version": "1.4.556", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.556.tgz", + "integrity": "sha512-6RPN0hHfzDU8D56E72YkDvnLw5Cj2NMXZGg3UkgyoHxjVhG99KZpsKgBWMmTy0Ei89xwan+rbRsVB9yzATmYzQ==" }, "node_modules/elliptic": { "version": "6.5.4", diff --git a/scripts/bundle-tests/package-lock.json b/scripts/bundle-tests/package-lock.json index 51a092e6ba11..b4bda87ee1aa 100644 --- a/scripts/bundle-tests/package-lock.json +++ b/scripts/bundle-tests/package-lock.json @@ -911,9 +911,9 @@ } }, "node_modules/electron-to-chromium": { - "version": "1.4.554", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.554.tgz", - "integrity": "sha512-Q0umzPJjfBrrj8unkONTgbKQXzXRrH7sVV7D9ea2yBV3Oaogz991yhbpfvo2LMNkJItmruXTEzVpP9cp7vaIiQ==", + "version": "1.4.556", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.556.tgz", + "integrity": "sha512-6RPN0hHfzDU8D56E72YkDvnLw5Cj2NMXZGg3UkgyoHxjVhG99KZpsKgBWMmTy0Ei89xwan+rbRsVB9yzATmYzQ==", "dev": true }, "node_modules/enhanced-resolve": { diff --git a/tests/eslint/eslint.config.js b/tests/eslint/eslint.config.js index 82c65f02845b..7fd922a6f030 100644 --- a/tests/eslint/eslint.config.js +++ b/tests/eslint/eslint.config.js @@ -683,6 +683,8 @@ const base = { 'regexp/confusing-quantifier': ERROR, // enforce consistent escaping of control characters 'regexp/control-character-escape': ERROR, + // enforce single grapheme in string literal + 'regexp/grapheme-string-literal': ERROR, // enforce consistent usage of hexadecimal escape 'regexp/hexadecimal-escape': [ERROR, NEVER], // enforce into your favorite case @@ -712,6 +714,8 @@ const base = { 'regexp/no-empty-group': ERROR, // disallow empty lookahead assertion or empty lookbehind assertion 'regexp/no-empty-lookarounds-assertion': ERROR, + // reports empty string literals in character classes + 'regexp/no-empty-string-literal': ERROR, // disallow escape backspace `([\b])` 'regexp/no-escape-backspace': ERROR, // disallow unnecessary nested lookaround assertions @@ -768,6 +772,10 @@ const base = { 'regexp/no-useless-quantifier': ERROR, // disallow unnecessary range of characters by using a hyphen 'regexp/no-useless-range': ERROR, + // reports any unnecessary set operands + 'regexp/no-useless-set-operand': ERROR, + // reports the string alternatives of a single character in `\q{...}`, it can be placed outside `\q{...}` + 'regexp/no-useless-string-literal': ERROR, // disallow unnecessary `{n,m}`` quantifier 'regexp/no-useless-two-nums-quantifier': ERROR, // disallow quantifiers with a maximum of zero @@ -812,6 +820,8 @@ const base = { 'regexp/prefer-unicode-codepoint-escapes': ERROR, // enforce using `\w` 'regexp/prefer-w': ERROR, + // aims to optimize patterns by simplifying set operations in character classes (with v flag) + 'regexp/simplify-set-operations': ERROR, // sort alternatives if order doesn't matter 'regexp/sort-alternatives': ERROR, // enforces elements order in character class diff --git a/tests/eslint/package-lock.json b/tests/eslint/package-lock.json index 6835cbcd28d1..7895a264f0e9 100644 --- a/tests/eslint/package-lock.json +++ b/tests/eslint/package-lock.json @@ -18,7 +18,7 @@ "eslint-plugin-promise": "^6.1.1", "eslint-plugin-qunit": "^8.0.1", "eslint-plugin-redos": "^4.5.0-beta.4", - "eslint-plugin-regexp": "^1.15.0", + "eslint-plugin-regexp": "^2.0.0", "eslint-plugin-sonarjs": "~0.21.0", "eslint-plugin-unicorn": "^48.0.1", "globals": "^13.23.0", @@ -1337,25 +1337,24 @@ } }, "node_modules/eslint-plugin-regexp": { - "version": "1.15.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-regexp/-/eslint-plugin-regexp-1.15.0.tgz", - "integrity": "sha512-YEtQPfdudafU7RBIFci81R/Q1yErm0mVh3BkGnXD2Dk8DLwTFdc2ITYH1wCnHKim2gnHfPFgrkh+b2ozyyU7ag==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-regexp/-/eslint-plugin-regexp-2.0.0.tgz", + "integrity": "sha512-VT3J6rOt3Lp+Mxw4jfvox5f31Do5UEsgRNXLy2Afl/gv5HiwMu7n+xt4J9bxePC1ds5uXTsPYMOKiCjfXsHapA==", "dev": true, "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", - "@eslint-community/regexpp": "^4.4.0", - "comment-parser": "^1.1.2", - "grapheme-splitter": "^1.0.4", - "jsdoctypeparser": "^9.0.0", - "refa": "^0.11.0", - "regexp-ast-analysis": "^0.6.0", - "scslre": "^0.2.0" + "@eslint-community/regexpp": "^4.9.1", + "comment-parser": "^1.4.0", + "jsdoc-type-pratt-parser": "^4.0.0", + "refa": "^0.12.1", + "regexp-ast-analysis": "^0.7.1", + "scslre": "^0.3.0" }, "engines": { - "node": "^12 || >=14" + "node": "^18 || >=20" }, "peerDependencies": { - "eslint": ">=6.0.0" + "eslint": ">=8.44.0" } }, "node_modules/eslint-plugin-sonarjs": { @@ -1849,12 +1848,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/grapheme-splitter": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/grapheme-splitter/-/grapheme-splitter-1.0.4.tgz", - "integrity": "sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ==", - "dev": true - }, "node_modules/graphemer": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/graphemer/-/graphemer-1.4.0.tgz", @@ -2382,16 +2375,13 @@ "js-yaml": "bin/js-yaml.js" } }, - "node_modules/jsdoctypeparser": { - "version": "9.0.0", - "resolved": "https://registry.npmjs.org/jsdoctypeparser/-/jsdoctypeparser-9.0.0.tgz", - "integrity": "sha512-jrTA2jJIL6/DAEILBEh2/w9QxCuwmvNXIry39Ay/HVfhE3o2yVV0U44blYkqdHA/OKloJEqvJy0xU+GSdE2SIw==", + "node_modules/jsdoc-type-pratt-parser": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/jsdoc-type-pratt-parser/-/jsdoc-type-pratt-parser-4.0.0.tgz", + "integrity": "sha512-YtOli5Cmzy3q4dP26GraSOeAhqecewG04hoO8DY56CH4KJ9Fvv5qKWUCCo3HZob7esJQHCv6/+bnTy72xZZaVQ==", "dev": true, - "bin": { - "jsdoctypeparser": "bin/jsdoctypeparser" - }, "engines": { - "node": ">=10" + "node": ">=12.0.0" } }, "node_modules/jsesc": { @@ -3171,25 +3161,25 @@ ] }, "node_modules/refa": { - "version": "0.11.0", - "resolved": "https://registry.npmjs.org/refa/-/refa-0.11.0.tgz", - "integrity": "sha512-486O8/pQXwj9jV0mVvUnTsxq0uknpBnNJ0eCUhkZqJRQ8KutrT1PhzmumdCeM1hSBF2eMlFPmwECRER4IbKXlQ==", + "version": "0.12.1", + "resolved": "https://registry.npmjs.org/refa/-/refa-0.12.1.tgz", + "integrity": "sha512-J8rn6v4DBb2nnFqkqwy6/NnTYMcgLA+sLr0iIO41qpv0n+ngb7ksag2tMRl0inb1bbO/esUwzW1vbJi7K0sI0g==", "dev": true, "dependencies": { - "@eslint-community/regexpp": "^4.5.0" + "@eslint-community/regexpp": "^4.8.0" }, "engines": { "node": "^12.0.0 || ^14.0.0 || >=16.0.0" } }, "node_modules/regexp-ast-analysis": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/regexp-ast-analysis/-/regexp-ast-analysis-0.6.0.tgz", - "integrity": "sha512-OLxjyjPkVH+rQlBLb1I/P/VTmamSjGkvN5PTV5BXP432k3uVz727J7H29GA5IFiY0m7e1xBN7049Wn59FY3DEQ==", + "version": "0.7.1", + "resolved": "https://registry.npmjs.org/regexp-ast-analysis/-/regexp-ast-analysis-0.7.1.tgz", + "integrity": "sha512-sZuz1dYW/ZsfG17WSAG7eS85r5a0dDsvg+7BiiYR5o6lKCAtUrEwdmRmaGF6rwVj3LcmAeYkOWKEPlbPzN3Y3A==", "dev": true, "dependencies": { - "@eslint-community/regexpp": "^4.5.0", - "refa": "^0.11.0" + "@eslint-community/regexpp": "^4.8.0", + "refa": "^0.12.1" }, "engines": { "node": "^12.0.0 || ^14.0.0 || >=16.0.0" @@ -3471,14 +3461,17 @@ } }, "node_modules/scslre": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/scslre/-/scslre-0.2.0.tgz", - "integrity": "sha512-4hc49fUMmX3jM0XdFUAPBrs1xwEcdHa0KyjEsjFs+Zfc66mpFpq5YmRgDtl+Ffo6AtJIilfei+yKw8fUn3N88w==", + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/scslre/-/scslre-0.3.0.tgz", + "integrity": "sha512-3A6sD0WYP7+QrjbfNA2FN3FsOaGGFoekCVgTyypy53gPxhbkCIjtO6YWgdrfM+n/8sI8JeXZOIxsHjMTNxQ4nQ==", "dev": true, "dependencies": { - "@eslint-community/regexpp": "^4.5.0", - "refa": "^0.11.0", - "regexp-ast-analysis": "^0.6.0" + "@eslint-community/regexpp": "^4.8.0", + "refa": "^0.12.0", + "regexp-ast-analysis": "^0.7.0" + }, + "engines": { + "node": "^14.0.0 || >=16.0.0" } }, "node_modules/semver": { diff --git a/tests/eslint/package.json b/tests/eslint/package.json index 44edb1ebed66..579abef318f8 100644 --- a/tests/eslint/package.json +++ b/tests/eslint/package.json @@ -13,7 +13,7 @@ "eslint-plugin-promise": "^6.1.1", "eslint-plugin-qunit": "^8.0.1", "eslint-plugin-redos": "^4.5.0-beta.4", - "eslint-plugin-regexp": "^1.15.0", + "eslint-plugin-regexp": "^2.0.0", "eslint-plugin-sonarjs": "~0.21.0", "eslint-plugin-unicorn": "^48.0.1", "globals": "^13.23.0", diff --git a/tests/observables/package-lock.json b/tests/observables/package-lock.json index 205e455676c4..46bfbfa231d8 100644 --- a/tests/observables/package-lock.json +++ b/tests/observables/package-lock.json @@ -640,9 +640,9 @@ } }, "node_modules/electron-to-chromium": { - "version": "1.4.554", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.554.tgz", - "integrity": "sha512-Q0umzPJjfBrrj8unkONTgbKQXzXRrH7sVV7D9ea2yBV3Oaogz991yhbpfvo2LMNkJItmruXTEzVpP9cp7vaIiQ==", + "version": "1.4.556", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.556.tgz", + "integrity": "sha512-6RPN0hHfzDU8D56E72YkDvnLw5Cj2NMXZGg3UkgyoHxjVhG99KZpsKgBWMmTy0Ei89xwan+rbRsVB9yzATmYzQ==", "dev": true, "peer": true },