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

Enable JavaScript specific warning behavior #6802

Open
billti opened this issue Feb 1, 2016 · 3 comments
Open

Enable JavaScript specific warning behavior #6802

billti opened this issue Feb 1, 2016 · 3 comments
Labels
Committed The team has roadmapped this issue Domain: JavaScript The issue relates to JavaScript specifically Suggestion An idea for TypeScript VS Code Tracked There is a VS Code equivalent to this issue
Milestone

Comments

@billti
Copy link
Member

billti commented Feb 1, 2016

See #6658 for background.

Currently for JavaScript files we provide a very limited set of errors, mostly for syntax errors. There are a number of grammatical and type errors that would be useful to display also.

Brief notes from ad hoc discussion in the team room include:

  • Move the code that flags TypeScript syntax in JavaScript files for better error handling
  • Add a distinction between errors and warnings to avoid "valid" JavaScript containing errors
  • Make the warnings user configurable as part of the project (i.e. may enable/disable certain warnings)

More detailed design to come...

@egamma
Copy link
Member

egamma commented Feb 20, 2016

From our own usage for Salsa for editing JS, we miss a warning about undefined variables. In eslint:

{
    "rules": {
        "no-undef": 2,
        "no-unused-vars": 1
    }
}

The other warning we got used is the one about unused local variables.

@kitsonk
Copy link
Contributor

kitsonk commented Jun 23, 2016

From #9132, it is clear that point 2 and 3 are valid for these type of issues. When importing just for emitting purposes (e.g. import 'foo.js';) some developers would like to be warned that that file is not resolvable, but many others would be expressly importing something that is only resolvable at run-time. So the ability to a) only have it be a warning and b) allow that warning to be turn off.

@waderyan waderyan added the VS Code Tracked There is a VS Code equivalent to this issue label Sep 14, 2016
@mhegazy mhegazy modified the milestones: Future, TypeScript 2.1 Sep 21, 2016
@akdor1154
Copy link

Hey TS team, there is currently a somewhat relevant discussion to this in #9694. (A flow-style system of allowing fully checked type annotations in comments in .js files). It seems already a little bit contentious and there is a bit of noise in that issue (sorry!)
I have started work on a basic PR to demonstrate this functionality and am willing to do up a proper proposal and even implementation if the team would be open to that. Would this functionality ever be considered?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Committed The team has roadmapped this issue Domain: JavaScript The issue relates to JavaScript specifically Suggestion An idea for TypeScript VS Code Tracked There is a VS Code equivalent to this issue
Projects
None yet
Development

No branches or pull requests

8 participants