From ac3f8ae29dc7aed1bb361496596c68a4032f183d Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 29 Aug 2024 17:58:09 +0000 Subject: [PATCH] Update dependency readdirp to v4 (#570) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Karl Horky --- package.json | 2 +- pnpm-lock.yaml | 10 ++++++++-- src/checks/eslintConfigIsValid.ts | 5 +++-- src/checks/stylelintConfigIsValid.ts | 10 ++++++---- 4 files changed, 18 insertions(+), 9 deletions(-) diff --git a/package.json b/package.json index 92529f43..a99313b2 100644 --- a/package.json +++ b/package.json @@ -50,7 +50,7 @@ "listr2": "8.2.4", "node-fetch": "3.3.2", "p-reduce": "3.0.0", - "readdirp": "3.6.0", + "readdirp": "4.0.1", "semver": "7.6.3", "top-user-agents": "2.1.22" }, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 42ad91b1..12c3dc58 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -59,8 +59,8 @@ importers: specifier: 3.0.0 version: 3.0.0 readdirp: - specifier: 3.6.0 - version: 3.6.0 + specifier: 4.0.1 + version: 4.0.1 semver: specifier: 7.6.3 version: 7.6.3 @@ -3582,6 +3582,10 @@ packages: resolution: {integrity: sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==} engines: {node: '>=8.10.0'} + readdirp@4.0.1: + resolution: {integrity: sha512-GkMg9uOTpIWWKbSsgwb5fA4EavTR+SG/PMPoAY8hkhHfEEY0/vqljY+XHqtDf2cr2IJtoNRDbrrEpZUiZCkYRw==} + engines: {node: '>= 14.16.0'} + rechoir@0.6.2: resolution: {integrity: sha512-HFM8rkZ+i3zrV+4LQjwQ0W+ez98pApMGM3HUrN04j3CqzPOzl9nmP15Y8YXNm8QHGv/eacOVEjqhmWpkRV0NAw==} engines: {node: '>= 0.10'} @@ -8635,6 +8639,8 @@ snapshots: dependencies: picomatch: 2.3.1 + readdirp@4.0.1: {} + rechoir@0.6.2: dependencies: resolve: 1.22.8 diff --git a/src/checks/eslintConfigIsValid.ts b/src/checks/eslintConfigIsValid.ts index 318ec6ce..b555ddef 100644 --- a/src/checks/eslintConfigIsValid.ts +++ b/src/checks/eslintConfigIsValid.ts @@ -68,8 +68,9 @@ export default async function eslintConfigIsValid() { const eslintDisableOccurrences = []; for await (const { path } of readdirp('.', { - directoryFilter: ['!.git', '!.next', '!node_modules'], - fileFilter: ['*.js', '*.jsx', '*.ts', '*.tsx'], + directoryFilter: (dir) => + !['.git', '.next', 'node_modules'].includes(dir.basename), + fileFilter: (file) => /\.(?:js|jsx|ts|tsx)$/.test(file.basename), })) { const fileContents = await fs.readFile(path, 'utf-8'); if (/eslint-disable|eslint [a-z0-9@/-]+: (0|off)/.test(fileContents)) { diff --git a/src/checks/stylelintConfigIsValid.ts b/src/checks/stylelintConfigIsValid.ts index 7244322a..633b28f7 100644 --- a/src/checks/stylelintConfigIsValid.ts +++ b/src/checks/stylelintConfigIsValid.ts @@ -77,10 +77,12 @@ export default config;`; const stylelintDisableOccurrences = []; for await (const { path } of readdirp('.', { - directoryFilter: ['!.git', '!.next', '!node_modules'], - fileFilter: supportedStylelintFileExtensions.map( - (fileExtension) => `*.${fileExtension}`, - ), + directoryFilter: (dir) => + !['.git', '.next', 'node_modules'].includes(dir.basename), + fileFilter: (file) => + new RegExp(`\\.(?:${supportedStylelintFileExtensions.join('|')})$`).test( + file.basename, + ), })) { const fileContents = await fs.readFile(path, 'utf-8'); if (fileContents.includes('stylelint-disable')) {