From 838170e2004bd0c27c68ba510b153edf951c0310 Mon Sep 17 00:00:00 2001 From: Craigory Coppola Date: Mon, 6 Jun 2022 20:09:25 -0400 Subject: [PATCH] fix(linter): relative paths should be correct on windows (#10604) --- packages/workspace/src/utils/runtime-lint-utils.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/workspace/src/utils/runtime-lint-utils.ts b/packages/workspace/src/utils/runtime-lint-utils.ts index a1620a14446a8..d2f90e9644e36 100644 --- a/packages/workspace/src/utils/runtime-lint-utils.ts +++ b/packages/workspace/src/utils/runtime-lint-utils.ts @@ -10,7 +10,7 @@ import { joinPathFragments, FileData, } from '@nrwl/devkit'; -import { join } from 'path'; +import { join, relative } from 'path'; import { workspaceRoot } from './app-root'; import { getPath, pathExists } from './graph-utils'; import { existsSync } from 'fs'; @@ -207,7 +207,7 @@ export function onlyLoadChildren( } export function getSourceFilePath(sourceFileName: string, projectPath: string) { - return normalizePath(sourceFileName).substring(projectPath.length + 1); + return normalizePath(relative(projectPath, sourceFileName)); } export function hasBannedImport(