Skip to content

forceConsistentCasingInFileNames shouldn't compare drive letters #31327

@arcanis

Description

@arcanis

TypeScript Version: master

Search Terms: casing forceConsistentCasingInFileNames differs from already included file name only in casing

Actual behavior:

TypeScript checks whether two files are referenced through similar-but-different casings. This is useful because it prevents portability problems when a project moves from a case-insensitive filesystem to a case-sensitive one. Useful feature, I approve 😃

However, it doesn't special-case the drive letter on Windows. This causes problems where D:/foo is seen as different from d:/foo even though both paths are strictly the same - let my know if I'm missing something here, but afaik the drive letters are by design strictly case insensitive.

This obviously cause issues with resolvers, since they have to return one or the other. We could try to use whatever VSCode uses, but it's pretty fragile and undocumented (VSCode seems to use lowercase letters, but that behavior could likely change especially since the UI shows the paths with uppercase letters).

Expected behavior:

The D:\foo and D:\Foo paths should be reported as similar-but-different, but D:\foo and d:\foo shouldn't.

Playground Link: n/a

Related Issues: n/a

Metadata

Metadata

Assignees

Labels

BugA bug in TypeScriptFixedA PR has been merged for this issue

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions