javascriptnode.jstypescriptvisual-studio-codecommonjs

How do I disable: [js] File is a CommonJS module; it may be converted to an ES6 module


The following warning is what I want to disable when working in a javascript file: "File is a CommonJS module. It may be converted to an ES6 module."

[File is a CommonJS module. It may be converted to an ES6 module.

I can not find a solution in my vscode settings. Help is very appreciated as this is really annoying.


Solution

  • This is a new feature added in Visual Studio Code called "Suggestion Code Actions". "Suggestion Code Actions" are enabled by default in JavaScript and TypeScript.

    You can disable them by setting: "typescript.suggestionActions.enabled": false or "javascript.suggestionActions.enabled": false in your user/workspace settings. The documentation can be found here.

    (Image provided by Yusuf Yaşar.)