Enable unicorn/prefer-iterator-to-array rule (#19366)

This commit is contained in:
fisker Cheung authored and GitHub committed 2026-06-16 03:11:33 +08:00
1 parent b636ad6856
commit 69531daf17
3 files changed
+8 -11

No files matched your search

+4 -5
View File
@@ -50,11 +50,10 @@ function getEsbuildOptions({ packageConfig, file, cliOptions, buildOptions }) {
{
module: require.resolve("jest-docblock"),
process(text) {
const exports = [
...text.matchAll(
/(?<=\n)exports\.(?<specifier>\w+) = \k<specifier>;/g,
),
].map((match) => match.groups.specifier);
const exports = text
.matchAll(/(?<=\n)exports\.(?<specifier>\w+) = \k<specifier>;/g)
.map((match) => match.groups.specifier)
.toArray();
const lines = text.split("\n");
const startMarkLine = lines.findIndex((line) =>
+4 -5
View File
@@ -460,11 +460,10 @@ const pluginFiles = [
{
module: getPackageFile("ts-api-utils/lib/index.js"),
process(text) {
const typescriptVariables = [
...text.matchAll(
/import (?<variable>\w+) from ["']typescript["']/g,
),
].map((match) => match.groups.variable);
const typescriptVariables = text
.matchAll(/import (?<variable>\w+) from ["']typescript["']/g)
.map((match) => match.groups.variable)
.toArray();
// Remove `'property' in typescript` check
text = text.replaceAll(