TypeScript Compiler Options

forceConsistentCasingInFileNames — TypeScript compiler option

Checks inconsistent filename casing for portability. On case-sensitive systems a wrong-case import can fail resolution even with this option disabled. Match the actual filename. These tests demonstrate Linux behavior, not Windows or macOS behavior. Default in 5.8.3: true. Create the labeled files in an isolated project and run tsc -p tsconfig.json. Expected diagnostics: []. Expected emitted files: none. Local project fixture, not a single-file editor.

Formal Syntax & Structure

typescript syntaxtypescript
{  "compilerOptions": {    "forceConsistentCasingInFileNames": true  }}

Parameters & Attributes

NameTypeDescription
forceConsistentCasingInFileNamesbooleanSet in compilerOptions; default in 5.8.3: true.

Working Example

Example Snippettypescript
// File: tsconfig.json (omit this label){  "compilerOptions": {    "target": "ES2022",    "module": "CommonJS",    "strict": true,    "types": [],    "noEmitOnError": true,    "outDir": "dist",    "forceConsistentCasingInFileNames": true,    "noEmit": true  },  "files": [    "main.ts",    "Value.ts"  ]}// File: main.tsimport { value } from "./Value";const checked: number = value;// File: Value.tsexport const value = 3;
TypeScript Reference