Enable unicorn/prefer-iterator-to-array rule (#19366)
This commit is contained in:
1 parent
b636ad6856
commit
69531daf17
3 files changed
+8
-11
No files matched your search
@@ -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) =>
|
||||
|
||||
@@ -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(
|
||||
|
||||
Reference in new issue
Block a user