I'm trying to use Visual Studio Code to edit files in a react starter kit project. The React project uses Babel for trans-piling, and so it has only .js
files instead of .ts
files. I would like VS Code to provide proper intellisense for these files...including new async/await Javascript keywords.
So far I can only get intellisense to work properly if I rename the extension of files from .js
to .ts
, but I don't want to convert the whole project just to suit my personal tool choices.
Is there a way to make VS Code treat .js
files as if they were .ts
files...simply for the sake of ES7 intellisense? I spotted a thread of discussion about this, but I'm not sure what options are available today. I also tried adding a tsconfig.json file that looks like this:
{
"compilerOptions": {
"target": "es6" //An "es7" option is not yet legal
},
"filesGlob": [
"./**/*.js",
"!./node_modules/**/*.js"
]
}
I hoped this would trick Typescript into acknowledging .js
files, but no luck.
Ultimately I would just like to have ES7 intellisense in VS Code. If there is an entirely different way to achieve this, that would also be welcome. For that matter, if there is an alternative to VS Code that provides the equivalent of intellisense for ES7 Javascript, I'm interested to know about that too.