diff --git a/.eslintrc.cjs b/.eslintrc.cjs index 6ddcdb6b4ab971..e1188c5820af84 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -108,6 +108,8 @@ module.exports = defineConfig({ ], 'regexp/no-contradiction-with-assertion': 'error', + // in some cases using explicit letter-casing is more performant than the `i` flag + 'regexp/use-ignore-case': 'off', }, overrides: [ { diff --git a/package.json b/package.json index a504c36a815af6..a00d07010de988 100644 --- a/package.json +++ b/package.json @@ -67,7 +67,7 @@ "eslint-define-config": "^1.24.1", "eslint-plugin-import": "^2.28.1", "eslint-plugin-n": "^16.2.0", - "eslint-plugin-regexp": "^1.15.0", + "eslint-plugin-regexp": "^2.1.1", "execa": "^8.0.1", "fs-extra": "^11.1.1", "lint-staged": "^15.0.1", diff --git a/packages/plugin-legacy/src/index.ts b/packages/plugin-legacy/src/index.ts index 5e954c1ba07eb1..71723d2a5a75f5 100644 --- a/packages/plugin-legacy/src/index.ts +++ b/packages/plugin-legacy/src/index.ts @@ -344,7 +344,8 @@ function viteLegacyPlugin(options: Options = {}): Plugin[] { fileName = fileName.replace(/[.-]?\[hash\]/, '-legacy$&') } else { // entry.js -> entry-legacy.js - fileName = fileName.replace(/(.+)\.(.+)/, '$1-legacy.$2') + // entry.min.js -> entry-legacy.min.js + fileName = fileName.replace(/(.+?)\.(.+)/, '$1-legacy.$2') } return fileName diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 317c943b488f5d..bc07017ec7a711 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -106,8 +106,8 @@ importers: specifier: ^16.2.0 version: 16.2.0(eslint@8.51.0) eslint-plugin-regexp: - specifier: ^1.15.0 - version: 1.15.0(eslint@8.51.0) + specifier: ^2.1.1 + version: 2.1.1(eslint@8.51.0) execa: specifier: ^8.0.1 version: 8.0.1 @@ -3233,16 +3233,6 @@ packages: requiresBuild: true optional: true - /@eslint-community/eslint-utils@4.3.0(eslint@8.51.0): - resolution: {integrity: sha512-v3oplH6FYCULtFuCeqyuTd9D2WKO937Dxdq+GmHOLL72TTRriLxz2VLlNfkZRsvj6PKnOPAtuT6dwrs/pA5DvA==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - peerDependencies: - eslint: ^6.0.0 || ^7.0.0 || >=8.0.0 - dependencies: - eslint: 8.51.0 - eslint-visitor-keys: 3.4.3 - dev: true - /@eslint-community/eslint-utils@4.4.0(eslint@8.51.0): resolution: {integrity: sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} @@ -3253,13 +3243,13 @@ packages: eslint-visitor-keys: 3.4.3 dev: true - /@eslint-community/regexpp@4.5.0: - resolution: {integrity: sha512-vITaYzIcNmjn5tF5uxcZ/ft7/RXGrMUIS9HalWckEOF6ESiwXKoMzAQf2UW0aVd6rnOeExTJVd5hmWXucBKGXQ==} + /@eslint-community/regexpp@4.6.2: + resolution: {integrity: sha512-pPTNuaAG3QMH+buKyBIGJs3g/S5y0caxw0ygM3YyE6yJFySwiGGSzA+mM3KJ8QQvzeLh3blwgSonkFjgQdxzMw==} engines: {node: ^12.0.0 || ^14.0.0 || >=16.0.0} dev: true - /@eslint-community/regexpp@4.6.2: - resolution: {integrity: sha512-pPTNuaAG3QMH+buKyBIGJs3g/S5y0caxw0ygM3YyE6yJFySwiGGSzA+mM3KJ8QQvzeLh3blwgSonkFjgQdxzMw==} + /@eslint-community/regexpp@4.9.1: + resolution: {integrity: sha512-Y27x+MBLjXa+0JWDhykM3+JE+il3kHKAEqabfEWq3SDhZjLYb6/BHL/JKFnH3fe207JaXkyDo685Oc2Glt6ifA==} engines: {node: ^12.0.0 || ^14.0.0 || >=16.0.0} dev: true @@ -4973,8 +4963,8 @@ packages: resolution: {integrity: sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA==} engines: {node: '>= 6'} - /comment-parser@1.3.1: - resolution: {integrity: sha512-B52sN2VNghyq5ofvUsqZjmk6YkihBX5vMSChmSK9v4ShjKf3Vk5Xcmgpw4o+iIgtrnM/u5FiMpz9VKb8lpBveA==} + /comment-parser@1.4.0: + resolution: {integrity: sha512-QLyTNiZ2KDOibvFPlZ6ZngVsZ/0gYnE6uTXi5aoDg8ed3AkJAz4sEje3Y8a29hQ1s6A99MZXe47fLAXQ1rTqaw==} engines: {node: '>= 12.0.0'} dev: true @@ -5762,21 +5752,20 @@ packages: semver: 7.5.4 dev: true - /eslint-plugin-regexp@1.15.0(eslint@8.51.0): - resolution: {integrity: sha512-YEtQPfdudafU7RBIFci81R/Q1yErm0mVh3BkGnXD2Dk8DLwTFdc2ITYH1wCnHKim2gnHfPFgrkh+b2ozyyU7ag==} - engines: {node: ^12 || >=14} + /eslint-plugin-regexp@2.1.1(eslint@8.51.0): + resolution: {integrity: sha512-FGa/idrL5tzMCnGylyx8DCWTX3vDuEtE/CVqTx+yYwe5qY3JRppbNVkOVGIkQF0klVlrG+LxwAXRXTUr5yU5uA==} + engines: {node: ^18 || >=20} peerDependencies: - eslint: '>=6.0.0' + eslint: '>=8.44.0' dependencies: - '@eslint-community/eslint-utils': 4.3.0(eslint@8.51.0) - '@eslint-community/regexpp': 4.5.0 - comment-parser: 1.3.1 + '@eslint-community/eslint-utils': 4.4.0(eslint@8.51.0) + '@eslint-community/regexpp': 4.9.1 + comment-parser: 1.4.0 eslint: 8.51.0 - grapheme-splitter: 1.0.4 - jsdoctypeparser: 9.0.0 - refa: 0.11.0 - regexp-ast-analysis: 0.6.0 - scslre: 0.2.0 + jsdoc-type-pratt-parser: 4.0.0 + refa: 0.12.1 + regexp-ast-analysis: 0.7.1 + scslre: 0.3.0 dev: true /eslint-scope@7.2.2: @@ -6412,10 +6401,6 @@ packages: resolution: {integrity: sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==} dev: true - /grapheme-splitter@1.0.4: - resolution: {integrity: sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ==} - dev: true - /graphemer@1.4.0: resolution: {integrity: sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==} dev: true @@ -6892,10 +6877,9 @@ packages: argparse: 2.0.1 dev: true - /jsdoctypeparser@9.0.0: - resolution: {integrity: sha512-jrTA2jJIL6/DAEILBEh2/w9QxCuwmvNXIry39Ay/HVfhE3o2yVV0U44blYkqdHA/OKloJEqvJy0xU+GSdE2SIw==} - engines: {node: '>=10'} - hasBin: true + /jsdoc-type-pratt-parser@4.0.0: + resolution: {integrity: sha512-YtOli5Cmzy3q4dP26GraSOeAhqecewG04hoO8DY56CH4KJ9Fvv5qKWUCCo3HZob7esJQHCv6/+bnTy72xZZaVQ==} + engines: {node: '>=12.0.0'} dev: true /jsesc@0.5.0: @@ -8581,11 +8565,11 @@ packages: strip-indent: 3.0.0 dev: true - /refa@0.11.0: - resolution: {integrity: sha512-486O8/pQXwj9jV0mVvUnTsxq0uknpBnNJ0eCUhkZqJRQ8KutrT1PhzmumdCeM1hSBF2eMlFPmwECRER4IbKXlQ==} + /refa@0.12.1: + resolution: {integrity: sha512-J8rn6v4DBb2nnFqkqwy6/NnTYMcgLA+sLr0iIO41qpv0n+ngb7ksag2tMRl0inb1bbO/esUwzW1vbJi7K0sI0g==} engines: {node: ^12.0.0 || ^14.0.0 || >=16.0.0} dependencies: - '@eslint-community/regexpp': 4.6.2 + '@eslint-community/regexpp': 4.9.1 dev: true /regenerate-unicode-properties@10.1.0: @@ -8609,12 +8593,12 @@ packages: '@babel/runtime': 7.23.2 dev: false - /regexp-ast-analysis@0.6.0: - resolution: {integrity: sha512-OLxjyjPkVH+rQlBLb1I/P/VTmamSjGkvN5PTV5BXP432k3uVz727J7H29GA5IFiY0m7e1xBN7049Wn59FY3DEQ==} + /regexp-ast-analysis@0.7.1: + resolution: {integrity: sha512-sZuz1dYW/ZsfG17WSAG7eS85r5a0dDsvg+7BiiYR5o6lKCAtUrEwdmRmaGF6rwVj3LcmAeYkOWKEPlbPzN3Y3A==} engines: {node: ^12.0.0 || ^14.0.0 || >=16.0.0} dependencies: - '@eslint-community/regexpp': 4.6.2 - refa: 0.11.0 + '@eslint-community/regexpp': 4.9.1 + refa: 0.12.1 dev: true /regexp.prototype.flags@1.5.0: @@ -8855,12 +8839,13 @@ packages: loose-envify: 1.4.0 dev: false - /scslre@0.2.0: - resolution: {integrity: sha512-4hc49fUMmX3jM0XdFUAPBrs1xwEcdHa0KyjEsjFs+Zfc66mpFpq5YmRgDtl+Ffo6AtJIilfei+yKw8fUn3N88w==} + /scslre@0.3.0: + resolution: {integrity: sha512-3A6sD0WYP7+QrjbfNA2FN3FsOaGGFoekCVgTyypy53gPxhbkCIjtO6YWgdrfM+n/8sI8JeXZOIxsHjMTNxQ4nQ==} + engines: {node: ^14.0.0 || >=16.0.0} dependencies: - '@eslint-community/regexpp': 4.6.2 - refa: 0.11.0 - regexp-ast-analysis: 0.6.0 + '@eslint-community/regexpp': 4.9.1 + refa: 0.12.1 + regexp-ast-analysis: 0.7.1 dev: true /scule@1.0.0: