From 0970278aef51323dedf816fa81b82018082071f0 Mon Sep 17 00:00:00 2001 From: Brad Zacher Date: Tue, 22 Oct 2019 20:59:02 -0700 Subject: [PATCH] fix(typescript-estree): normalize paths to fix cache miss on windows --- packages/typescript-estree/src/create-program/shared.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/typescript-estree/src/create-program/shared.ts b/packages/typescript-estree/src/create-program/shared.ts index a436ec7082d8..ac2dc3d5e62e 100644 --- a/packages/typescript-estree/src/create-program/shared.ts +++ b/packages/typescript-estree/src/create-program/shared.ts @@ -21,8 +21,10 @@ const DEFAULT_COMPILER_OPTIONS: ts.CompilerOptions = { // This narrows the type so we can be sure we're passing canonical names in the correct places type CanonicalPath = string & { __brand: unknown }; const getCanonicalFileName = ts.sys.useCaseSensitiveFileNames - ? (path: string): CanonicalPath => path as CanonicalPath - : (path: string): CanonicalPath => path.toLowerCase() as CanonicalPath; + ? (filePath: string): CanonicalPath => + path.normalize(filePath) as CanonicalPath + : (filePath: string): CanonicalPath => + path.normalize(filePath).toLowerCase() as CanonicalPath; function getTsconfigPath(tsconfigPath: string, extra: Extra): CanonicalPath { return getCanonicalFileName(