TS6504
File 'mycode.js' is a JavaScript file. Did you mean to enable the 'allowJs' option?
Broken Code ❌
tsc mycode.jsFixed Code ✔️
You have to enable the "allowJS" flag in your "tsconfig.json" file:
{
"compilerOptions": {
"allowJs": true
}
}Alternatively, you can enable it through the TypeScript Compiler CLI:
tsc mycode.js --allowJs