TS5055

error TS5055: Cannot write file because it would overwrite input file. Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files.

Broken Code ❌

1
tsc mycode.js --allowJs

Fixed Code ✔️

1
tsc mycode.js --allowJs --outDir dist

Alternatively, you can also skip compiling code (if you just want to check the types of your code):

1
tsc mycode.js --allowJs --noEmit