TomSawyer
TomSawyer

Reputation: 3820

VSCode intellisense doesn't work with ES6 import?

I'm stucking with this trouble for days.

import abc from './abc' doesn't work, the abc.xyz() or any function inside it will not be suggested. Even the file abc.js will not be suggested

I have to use abc = required('./abc.js') and things work fine. Both file suggestion and method will be available

I've tried to added jsconfig.json and force it to use "module":"es6" but didn't work either.

Already got react native tools installed. Couldn't get it work eventually.

Edit: i found out that module.exports = User doesn't work anymore. I have to write export default User if i want to access to all the method, since when and how to get old school export works?

Upvotes: 4

Views: 3949

Answers (1)

supra28
supra28

Reputation: 1636

Change your jsconfig.json to

{
    "compilerOptions": {
        "target": "es6"
    },
    "exclude": [
        "node_modules"
    ]
}

and then you might need to restart VScode

the option module is used for typescript, more on this here

Upvotes: 2

Related Questions