Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Salsa - no support to treat files without a suffix as .js files, they are always treated as .ts files #7291

Closed
egamma opened this issue Feb 29, 2016 · 2 comments
Labels
API Relates to the public API for TypeScript Bug A bug in TypeScript Fixed A PR has been merged for this issue

Comments

@egamma
Copy link
Member

egamma commented Feb 29, 2016

extracted and summarized from microsoft/vscode#3508

Applications generated with the express generator have a file www without suffix but with the shebang

#!/usr/bin/env node

Code detects the file as a JS file and passes it to the tsserver. However, the tsserver treats this file as a .ts file and this results in type errors in a JS file.

To reproduce:

Notice that there are errors from TS reported in this file,

@egamma egamma added the Salsa label Feb 29, 2016
@zhengbli zhengbli self-assigned this Mar 2, 2016
@zhengbli zhengbli added the Bug A bug in TypeScript label Mar 2, 2016
@zhengbli
Copy link
Contributor

zhengbli commented Mar 3, 2016

This may require a tsserver API change to support opening a file as a specified ScriptKind, which will solve a more general category of issues.

@zhengbli
Copy link
Contributor

With #7954, opening a file as a specific script kind is now supported.

@zhengbli zhengbli added the Fixed A PR has been merged for this issue label Apr 19, 2016
@microsoft microsoft locked and limited conversation to collaborators Jun 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
API Relates to the public API for TypeScript Bug A bug in TypeScript Fixed A PR has been merged for this issue
Projects
None yet
Development

No branches or pull requests

3 participants