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(