Intellisense studio visual code not working for dojo amd code

I have an app.js file with dojo amd template code as follows:

require(["dojo/dom", ..], function(dom){
  dom.byId('someId').innerHTML = "test";
});

And using tsd, I installed dojo.d.ts

And also the created jsconfig.json file:

{
  "compilerOptions": {
  "target": "ES6",
    "module": "commonjs"
  }
}

But intellisense is not working. Am I doing something wrong?

+4
source share
1 answer

I'm doing something wrong

Yes. require(["dojo/dom", ..], function(dom){the variable domwill have an output type any.

Fix

Use import/requireand compile with --module amd: http://basarat.gitbooks.io/typescript/content/docs/project/modules.html

0
source

Source: https://habr.com/ru/post/1598333/


All Articles