Open
Labels
CommittedThe team has roadmapped this issueThe team has roadmapped this issueDomain: JavaScriptThe issue relates to JavaScript specificallyThe issue relates to JavaScript specificallySuggestionAn idea for TypeScriptAn idea for TypeScriptVS Code TrackedThere is a VS Code equivalent to this issueThere is a VS Code equivalent to this issue
Milestone
Description
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...
Reacted by Grant Mathews, Christopher Radek, Noj Vek, Kagami Sascha Rosylight, Aaron Beall, Jannick Garthen, stephen, Anton Abilov, evandeininger, Nathan and 3 more
Metadata
Metadata
Assignees
Labels
CommittedThe team has roadmapped this issueThe team has roadmapped this issueDomain: JavaScriptThe issue relates to JavaScript specificallyThe issue relates to JavaScript specificallySuggestionAn idea for TypeScriptAn idea for TypeScriptVS Code TrackedThere is a VS Code equivalent to this issueThere is a VS Code equivalent to this issue
Activity
egamma commentedon 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 commentedon 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.akdor1154 commentedon Jan 14, 2017
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?