Skip to content

forceConsistentCasingInFileNames does not always work with paths compiler option #17617

Closed
@stephenbrady

Description

@stephenbrady

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: #17542 (comment)

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