Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to disable global variable from lib.dom.d.ts?

I'm using Visual studio code to develop nodeJS apps and already have an eslint configuration to lint undeclared variables.

But in recent VSCode versions, some undeclared variable are not linted anymore. like event, name, crypto, ...

When reaching the variable definition, it is actually declared in the file Microsoft VS Code Insiders\resources\app\extensions\node_modules\typescript\lib\lib.dom.d.ts

I can't see any reason why those variables should be declared globally for nodeJS apps. How can I disable the global definition of thoses variables?

like image 478
Damien Leroux Avatar asked Oct 17 '18 08:10

Damien Leroux


1 Answers

You can exclude dom suggestions by setting "lib": ["es6"] in a jsconfig.json:

{
    "compilerOptions": {
        "target": "ES6",
        "lib": ["es6"]
    },
    "exclude": [
        "node_modules",
        "**/node_modules/*"
    ]
}
like image 83
Matt Bierner Avatar answered Sep 20 '22 08:09

Matt Bierner