Skip to content

Commit 4f4d0bf

Browse files
committed
Fix workspace checks in Windows
1 parent 3bc0944 commit 4f4d0bf

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

packages/knip/src/ConfigurationChief.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// biome-ignore lint/nursery/noRestrictedImports: ignore
2+
import path from 'node:path';
13
import picomatch from 'picomatch';
24
import { partitionCompilers } from './compilers/index.js';
35
import { DEFAULT_EXTENSIONS, KNIP_CONFIG_LOCATIONS, ROOT_WORKSPACE_NAME } from './constants.js';
@@ -23,7 +25,7 @@ import { defaultRules } from './util/issue-initializers.js';
2325
import { _load } from './util/loader.js';
2426
import mapWorkspaces from './util/map-workspaces.js';
2527
import { getKeysByValue } from './util/object.js';
26-
import { join, relative, resolve } from './util/path.js';
28+
import { join, relative } from './util/path.js';
2729
import { normalizePluginConfig } from './util/plugin.js';
2830
import { toRegexOrString } from './util/regex.js';
2931
import { unwrapFunction } from './util/unwrap-function.js';
@@ -289,7 +291,7 @@ export class ConfigurationChief {
289291

290292
private getIncludedWorkspaces() {
291293
if (this.workspace) {
292-
const dir = resolve(this.cwd, this.workspace);
294+
const dir = path.resolve(this.cwd, this.workspace);
293295
if (!isDirectory(dir)) throw new ConfigurationError('Workspace is not a directory');
294296
if (!isFile(join(dir, 'package.json'))) throw new ConfigurationError('Unable to find package.json in workspace');
295297
}

0 commit comments

Comments
 (0)