TypeScript: `forceConsistentCasingInFileNames` does not always work with `paths` compiler option

TypeScript Version: 2.4.2

Code

// Base tsconfig at /Users/a_user/a_repo/core.json
{
  "compilerOptions": {
    "forceConsistentCasingInFileNames": true,
    "baseUrl": "",
    "paths": {
      "*": [ "*", "src/*" ]
    }
  }
}

// tsconfig at /Users/a_user/a_repo/tsconfig.json
{
  "extends": "./core"
}

// Source file in /Users/a_user/a_repo/src/foo.ts
const v = 1;
export default v;

// Source file in /Users/a_user/a_repo/src/bar.ts
import v from "foo";

Expected behavior: No compiler errors/warnings

Actual behavior:

error TS1149: File name '/Users/a_user/a_repo/src/foo.ts' differs from already included file name '/users/a_user/a_repo/src/foo.ts' only in casing.

This is running on OS X 10.9.5 (default case-insensitive HFS file system).

I am only able to reproduce the issue when using configuration inheritance. Using an absolute path with the expected casing for baseUrl resolves the issue.

This issue is filed off of these remarks: https://github.com/Microsoft/TypeScript/issues/17542#issuecomment-319296988

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Reactions: 5
  • Comments: 17 (9 by maintainers)

Most upvoted comments

A similarish bugfix related to consistent casing shipped in 2.7.2, which as it happens released today. Does it fix your issues?

should be in 2.6, scheduled for October

Oh interesting. Well I may have stumbled onto a different repro of the same bug. I only have one tsconfig.json in my project, but this still fails for me. I ran a search on my file system, and the only other tsconfig file anywhere is in node_modules, which I’ve explicitly excluded.