Files
tsgo/testdata/baselines/reference/tsc/forceConsistentCasingInFileNames/two-files-exist-on-disk-that-differs-only-in-casing.js

2.0 KiB

currentDirectory::/home/src/workspaces/project
useCaseSensitiveFileNames::true
Input::
//// [/home/src/workspaces/project/D.ts] *new*
export const x = 10;
//// [/home/src/workspaces/project/c.ts] *new*
import {x} from "./D"
//// [/home/src/workspaces/project/d.ts] *new*
export const y = 20;
//// [/home/src/workspaces/project/tsconfig.json] *new*
{
"files": ["c.ts", "d.ts"]
}
 
tsgo
ExitStatus:: DiagnosticsPresent_OutputsGenerated
Output::
c.ts:1:17 - error TS1261: Already included file name '/home/src/workspaces/project/D.ts' differs from file name '/home/src/workspaces/project/d.ts' only in casing.
The file is in the program because:
Imported via "./D" from file '/home/src/workspaces/project/c.ts'
Part of 'files' list in tsconfig.json
 
1 import {x} from "./D"
~~~~~
 
tsconfig.json:2:23 - File is matched by 'files' list specified here.
2 "files": ["c.ts", "d.ts"]
~~~~~~
 
 
Found 1 error in c.ts:1
 
//// [/home/src/tslibs/TS/Lib/lib.es2025.full.d.ts] *Lib*
/// <reference no-default-lib="true"/>
interface Boolean {}
interface Function {}
interface CallableFunction {}
interface NewableFunction {}
interface IArguments {}
interface Number { toExponential: any; }
interface Object {}
interface RegExp {}
interface String { charAt: any; }
interface Array<T> { length: number; [n: number]: T; }
interface ReadonlyArray<T> {}
interface SymbolConstructor {
(desc?: string | number): symbol;
for(name: string): symbol;
readonly toStringTag: symbol;
}
declare var Symbol: SymbolConstructor;
interface Symbol {
readonly [Symbol.toStringTag]: string;
}
declare const console: { log(msg: any): void; };
//// [/home/src/workspaces/project/D.js] *new*
export const x = 10;
 
//// [/home/src/workspaces/project/c.js] *new*
export {};
 
//// [/home/src/workspaces/project/d.js] *new*
export const y = 20;