diff --git a/eslint.config.js b/eslint.config.js index 07b4400cd..c634d89eb 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -339,7 +339,6 @@ const configs = [ "unicorn/no-return-array-push": "off", "unicorn/prefer-array-from-map": "off", "unicorn/no-error-property-assignment": "off", - "unicorn/prefer-iterator-to-array": "off", // Bug on `"\u{3000}"` "unicorn/no-incorrect-template-string-interpolation": "off", }, diff --git a/scripts/build/builders/javascript-module.js b/scripts/build/builders/javascript-module.js index 1430025cf..af45eb45d 100644 --- a/scripts/build/builders/javascript-module.js +++ b/scripts/build/builders/javascript-module.js @@ -50,11 +50,10 @@ function getEsbuildOptions({ packageConfig, file, cliOptions, buildOptions }) { { module: require.resolve("jest-docblock"), process(text) { - const exports = [ - ...text.matchAll( - /(?<=\n)exports\.(?\w+) = \k;/g, - ), - ].map((match) => match.groups.specifier); + const exports = text + .matchAll(/(?<=\n)exports\.(?\w+) = \k;/g) + .map((match) => match.groups.specifier) + .toArray(); const lines = text.split("\n"); const startMarkLine = lines.findIndex((line) => diff --git a/scripts/build/packages/prettier.js b/scripts/build/packages/prettier.js index 3eacf64e6..afd8f5cde 100644 --- a/scripts/build/packages/prettier.js +++ b/scripts/build/packages/prettier.js @@ -460,11 +460,10 @@ const pluginFiles = [ { module: getPackageFile("ts-api-utils/lib/index.js"), process(text) { - const typescriptVariables = [ - ...text.matchAll( - /import (?\w+) from ["']typescript["']/g, - ), - ].map((match) => match.groups.variable); + const typescriptVariables = text + .matchAll(/import (?\w+) from ["']typescript["']/g) + .map((match) => match.groups.variable) + .toArray(); // Remove `'property' in typescript` check text = text.replaceAll(