Linguist: TypeScript file is being JavaScript.

Created on 24 Jul 2017  路  7Comments  路  Source: github/linguist

Some .ts file is treated as JavaScript file.

default

Most helpful comment

Hm. So this file is detected as JavaScript because of the shebang on the first line.

All 7 comments

Oo, you can interpret TypeScript with the Node interpreter??

@pchaigno Did you mean that this file can run directly by Node? If you mean that, I think it can't.

This file contains some variable type declaration that isn't valid JavaScript.

Hm. So this file is detected as JavaScript because of the shebang on the first line.

Haha. shebang make this file to be detected as JavaScript. 馃ぃ

Oo, you can interpret TypeScript with the Node interpreter??

@pchaigno Relevant issue at file-icons which has an explanation:

No, it cannot [execute], but the shebang string gets propagated from the TS source to the JS compiled with聽tsc. If I omit it in the source, it won't appear in the output JS.

This isn't something Linguist currently accommodates, AFAIK. 馃槙

Thanks for the explanation @Alhadis!

@gluons You can override the language detected using Linguist overrides.

@pchaigno OK. I'll try. Thank you.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Sanchez3 picture Sanchez3  路  4Comments

Haroenv picture Haroenv  路  4Comments

arfon picture arfon  路  6Comments

lucasrodes picture lucasrodes  路  6Comments

RafaelPAndrade picture RafaelPAndrade  路  4Comments