How to disable this warning?
@ynwd Add this to your user/workspace settings: "javascript.validate.enable": false
Is there no way to keep the general validation feature enabled and turn off only this specific warning, a la eslint, jslint, jshint, etc.?
As @jeffmcmahan said. This is a really strange one, frankly. Why marking as an error the fact that one is using CommonJS module rather than ES6 ones? There are clearly lots of cases where the former is still the only available option.
I recently upgraded to 1.22.0 and this started happening to me as well. Eslint passes checks and this only happens on the first occurrence.
@gcphost - I'm not sure I understand. First, notice the dots at the left margin.
If you hover over any part of the function declaration, the validation message appears.
I love VS Code, so I can't help worrying that this is a step toward displacing built-in support for JavaScript with support for something we might call "idiomatic JavaScript React (Babel)," on the assumption that this is what every developer should want. Hope not.
@jeffmcmahan I'm only seeing it on the first require:
I saw what you're seeing once but can't find it again.
@gcphost - I had not noticed it on require
yet. I see it everywhere on the first exports.foo
or module.exports
, per file.
Seems odd for a validation tool to mark exports.foo
invalid, and mark export function foo () {...
as valid, when this is the inverse of what even the latest JS runtime will do.
These are suggestions/hints. They visually indicate that vscode can perform an action to possibly refactor/improve your code, but they are not treated as errors. You can disable them by adding "javascript.suggestionActions.enabled": false
to your user settings
One bug is that the ...
should only show on the first line of the module.exports
suggestion. I've opened https://github.com/Microsoft/vscode/issues/47346 to track this. We'll also be into allowing you to suppress individual types of suggestions in the future, but for now the javascript.suggestionActions.enabled
setting is all or nothing
Hi thanks for all the info, I am developing on Node.js so using "import" statements is for now a no-go as it's not the default behaviour and an experimental feature requiring to have .mjs files etc..
I'd love to keep those suggestions but can we have a more granular parameter to inform when we prefer to keep writing applications in CommonJS?
@vvo - I think @mjbvz already answered that question.
I use the High Contrast theme, and this behaviour is really bad:
All my files are 100% like this, all lines, and wherever I put the mouse, the message appears... It's unbearable.
I had to use "javascript.suggestionActions.enabled": false
. Looking forward to see the granular parameter to fix this. Thanks!
I updated this to be a bad experience
This really shouldn't be enabled by default.
In some Node-only projects there's a conscious decision to not use Babel and stick with CommonJS. This shouldn't be always on.
And what if I would like to keep "javascript.suggestionActions.enabled": false
?
Can't we just disable this specific rule like with eslint or others ?
Because I suppose disabling this will disable all [js]
warnings, which I don't want ...
Thanks in advance :)
@SherlockStd - @mjbvz already said:
I've opened #47346 to track this. We'll also be into allowing you to suppress individual types of suggestions in the future, but for now the javascript.suggestionActions.enabled setting is all or nothing
Given the status of module interop discussions and the absence of any shipped, complete module system (e.g. including bare imports), this suggested actions feels very premature.
This is very annoying. From release to release VSCode team keeps adding opinionated features that can not be disabled without a totall opt-out of many features that actually make vscode appealing.
I am a node-js developer, and I don't want to use ES6 syntax on imports neither on exports, there is more javascript apart from the browser and babel world.
This is not only a cosmetic thing, this avoids proper linting and automatic indentation to work properly, so it actually work against other useful features.
This is horrible, I'm very disappointed 馃槶
Strange and sadly annoying.
I don't understand why this is closed. The problem exists
me too
I've locked this issue because +1 comments are causing people to miss that there is already is a solution to disable these hints. Posting again to make it clear:
These are suggestions/hints. They visually indicate that vscode can perform an action to possibly refactor/improve your code, but they are not treated as errors.
You can disable them by adding
"javascript.suggestionActions.enabled": false
to your user settings
Most helpful comment
This really shouldn't be enabled by default.