Skip to content

Commit

Permalink
Fix TS issues (use matcher pkg that we have types for)
Browse files Browse the repository at this point in the history
  • Loading branch information
webpro committed Sep 22, 2024
1 parent 397bb94 commit 438a4e6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions scripts/knip.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { join, relative } from 'node:path';

import fg from 'fast-glob';
import type { KnipConfig } from 'knip';
import { isMatch } from 'picomatch';
import { match } from 'minimatch';

// Files we want to exclude from analysis should be negated project patterns, not `ignores`
// docs: https://knip.dev/guides/configuring-project-files
Expand Down Expand Up @@ -74,9 +74,9 @@ export const addBundlerEntries = async (config: KnipConfig) => {
const workspaceDirectories = workspaceDirs.map((dir) => relative(baseDir, join(baseDir, dir)));
for (const wsDir of workspaceDirectories) {
for (const configKey of Object.keys(baseConfig.workspaces)) {
if (isMatch(wsDir, configKey)) {
if (match([wsDir], configKey)) {
const manifest = await import(join(baseDir, wsDir, 'package.json'));
const configEntries = config.workspaces[configKey].entry ?? [];
const configEntries: string[] = Array.isArray(config.workspaces[configKey].entry) ? config.workspaces[configKey].entry : [];
const bundler = manifest?.bundler;
for (const value of Object.values(bundler ?? {})) {
if (Array.isArray(value)) {
Expand Down

0 comments on commit 438a4e6

Please sign in to comment.