Quantcast
Channel: Active questions tagged visual-studio-code - Stack Overflow
Viewing all articles
Browse latest Browse all 98422

How to change the default import hint in VSCode from ES6 to commonjs?

$
0
0

I've a small piece of JavaScript that I open on Visual Studio Code, I then enable @ts-check to get type hinting from TypeScript definition files.

When I refer to a type that comes from a different import VSCode will give the hint and add the following code to the beginning of the file:

import { SomeType } from 'some-module';

This is correct if I'm working on ES6 but currently I'm targetting to older runtimes and would prefer to get the generated code be written using the commonjs syntax:

var SomeType = require('some-module').SomeType;

Is there any configuration I can change to achieve this behavior?


Viewing all articles
Browse latest Browse all 98422

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>