Skip to content

Commit

Permalink
Fix workspace checks in Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
webpro committed Feb 19, 2025
1 parent 3bc0944 commit 4f4d0bf
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/knip/src/ConfigurationChief.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// biome-ignore lint/nursery/noRestrictedImports: ignore
import path from 'node:path';
import picomatch from 'picomatch';
import { partitionCompilers } from './compilers/index.js';
import { DEFAULT_EXTENSIONS, KNIP_CONFIG_LOCATIONS, ROOT_WORKSPACE_NAME } from './constants.js';
Expand All @@ -23,7 +25,7 @@ import { defaultRules } from './util/issue-initializers.js';
import { _load } from './util/loader.js';
import mapWorkspaces from './util/map-workspaces.js';
import { getKeysByValue } from './util/object.js';
import { join, relative, resolve } from './util/path.js';
import { join, relative } from './util/path.js';
import { normalizePluginConfig } from './util/plugin.js';
import { toRegexOrString } from './util/regex.js';
import { unwrapFunction } from './util/unwrap-function.js';
Expand Down Expand Up @@ -289,7 +291,7 @@ export class ConfigurationChief {

private getIncludedWorkspaces() {
if (this.workspace) {
const dir = resolve(this.cwd, this.workspace);
const dir = path.resolve(this.cwd, this.workspace);
if (!isDirectory(dir)) throw new ConfigurationError('Workspace is not a directory');
if (!isFile(join(dir, 'package.json'))) throw new ConfigurationError('Unable to find package.json in workspace');
}
Expand Down

0 comments on commit 4f4d0bf

Please sign in to comment.