Find and disable/filter DOM intelliSense recommendations in VS Code

后端 未结 1 531
佛祖请我去吃肉
佛祖请我去吃肉 2021-01-26 09:30

I have a blank/new .js file. For some reason intelliSense/autocomplete is recommending things that I do not recognize nor do I know where they are coming from. Is t

1条回答
  •  醉话见心
    2021-01-26 09:54

    You probably want something like this in your jsconfig.json file:

    {
      "compilerOptions": {
    
          "lib": ["es6", "esnext"]  // or whatever in there, just not "dom"
          // intellisense will show you all the possible entries
    
       },
          "exclude": [
            "node_modules",
            "**/node_modules/*"
      ],
    }
    

    See github issue: getting rid of DOM types. I assume the lib option is "defining the context" of your project and without limiting it as in the example above you are getting much more "context" than you wish, you are getting the dom option.

    And in general see vscode docs on jsconfig.

    0 讨论(0)
提交回复
热议问题