TS6504

File 'mycode.js' is a JavaScript file. Did you mean to enable the 'allowJs' option?

Broken Code ❌

tsc mycode.js

Fixed Code ✔️

You have to enable the "allowJS" flag in your "tsconfig.json" file:

tsconfig.json
{
  "compilerOptions": {
    "allowJs": true
  }
}

Alternatively, you can enable it through the TypeScript Compiler CLI:

tsc mycode.js --allowJs