Skip to content Skip to sidebar Skip to footer

Why Do I Get Intellisense In Vscode When Using `require` But Not When Using `import`

In VS Code, when I import jquery using import $ from 'jquery';, Intellisense isn't working. This is what I get: However, when using the require syntax, const $ = require('jquery')

Solution 1:

This is know bug. https://github.com/Microsoft/vscode-react-native/issues/61

Fix is already available in Insiders build. Or you can wait for the stable version 1.0, which will be released in few days.

Solution 2:

Starting from version 1 (released April 14th 2016), you need a jsconfig.json file at the root of your project with the following content in order to enable Intellisense with the import syntax:

"compilerOptions":{"target":"ES6","allowSyntheticDefaultImports":true}

Post a Comment for "Why Do I Get Intellisense In Vscode When Using `require` But Not When Using `import`"