You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
From #929 and #1226, I believe that the intended behaviour is that extension-less shebang scripts are seen as TypeScript files, but that does not seems to be the case?
Minimal example:
#!/usr/bin/env -S deno run --allow-all
// filename: hiinterfaceFoo{bar: string;}console.log("Hi");
Running ./hi or deno run hi yields error: Unexpected token `interface`.
The text was updated successfully, but these errors were encountered:
I guess it is more about the default behaviour here: extension-less shebang scripts should be interpreted as TypeScript by default instead of JavaScript.
I'm fine closing this if we don't wish to change that.
zhangyuannie
changed the title
extension-less shebang scripts can not be written in TypeScript
extension-less shebang scripts should be interpreted as TypeScript by default
Jan 26, 2021
I believe #5088 is a better solution/suggestion. Ideally we want to treat JavaScript and TypeScript equally. Technically it isn't a duplicate. I don't think we would consider this suggestion though as it would have significant breaking changes. We interpret TypeScript in strict mode, this means a lot of plain JavaScript would simply error out, which would be a bad experience for those already taking advantage of the feature.
From #929 and #1226, I believe that the intended behaviour is that extension-less shebang scripts are seen as TypeScript files, but that does not seems to be the case?
Minimal example:
Running
./hi
ordeno run hi
yieldserror: Unexpected token `interface`.
The text was updated successfully, but these errors were encountered: