I am facing a challenge with my TypeScript 'snippets' project. It seems that multiple .ts files contain type names (like Foo) that are the same.
//file-a.ts
type Foo = {
}
//file-b.ts
type Foo = {
}
When attempting to compile, I encounter the following error:
error TS2300: Duplicate identifier 'Foo'.
This issue seems confusing to me because these typings should be limited to their respective modules.
The TypeScript version being used is 3.7.5, and in my tsconfig.json file, these properties are defined (all other settings are default):
{
"compilerOptions": {
"target": "es5",
"module": "commonjs",
"outDir": "./dist",
"rootDir": "./src",
"isolatedModules": true,
"strict": true,
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true
}
}
Can someone explain what might be causing this situation? Check out the actual code here.