macOS and Windows usually ignore letter case in file names, so import { formatPrice } from "./Format.js" finds format.js there. Linux does not, so the same code fails on a Linux server or CI machine. forceConsistentCasingInFileNames makes the checker report the mismatch on case-insensitive systems too (TS1149), so it shows up before the code reaches a Linux machine.
It is on by default in TypeScript 5.9. There is nothing to set; just do not turn it off.
At a glance
| Write | Leave it at the default, true |
|---|---|
| On the command line | --forceConsistentCasingInFileNames |
| Type | boolean |
| Default in TypeScript 5.9 | true |
| TypeScript's description | Ensure that casing is correct in imports. |
The description is quoted from TypeScript's own option list (Apache-2.0); see the notices.
Why this page has no checked example
The result depends on the machine. On a case-insensitive file system, the wrong-case import resolves and the option reports TS1149; on a case-sensitive one, such as most Linux machines, the file is not found at all and the import is a missing-module error, with or without the option. An example checked on one kind of machine would show a different error on the other, so this page describes it instead.
Gotchas
- The option covers imports and the files the config lists. A path your code builds as a string at run time, such as
new URL("./Data.json", import.meta.url), is not checked.
Sources
- TSConfig Reference: forceConsistentCasingInFileNames · TypeScript
Last reviewed 20 October 2026.