Disable intellisense for default typescript libraries in VSCODE
In order to control which libraries are loaded in your project and are providing intellisense/autocomplete you need to configure lib
property [array type] of compilerOptions
in your tsconfig.json
file.
If lib
property is not configured, TypeScript will automatically load following libraries:
- For target ES5: DOM, ES5, ScriptHost.
- For target ES6: DOM, ES6, DOM.Iterable, ScriptHost.
Example configuration in tsconfig.json
file could look like this:
{
"compilerOptions": {
"target": "es5",
"lib": [
"es2017"
]
}
}
This would load only libraries for ECMAScript 2017 intellisense.
You can read more about compiler options, including lib
here: https://www.typescriptlang.org/docs/handbook/compiler-options.html
Open the Settings editor File > Preferences > Settings (Code > Preferences > Settings
on macOS
snippets :
To disable basic TypeScript snippets you can set editor.snippetSuggestions
to "none"
in your settings file. If you'd like to see snippets, you can specify the order relative to suggestions; at the top ("top")
, at the bottom ("bottom")
, or inlined ordered alphabetically ("inline")
. The default is "inline"
JSDoc support:
To disable JSDoc comment suggestions in TypeScript, set "typescript.suggest.completeJSDocs": false
Auto imports:
You can disable auto imports by setting "typescript.autoImportSuggestions.enabled": false
Formatting:
set "typescript.format.enable"
to false
to disable it.
JSX and auto-closing tags:
Set "typescript.autoClosingTags"
to false
to disable JSX tag closing.
Unused variables and unreachable code:
To disable fading out of unused code, set "editor.showUnused"
to false
. You can also disable fading of unused code only in TypeScriptScript by setting,
"[typescript]": {
"editor.showUnused": false
},
"[typescriptreact]": {
"editor.showUnused": false
},
Code suggestions:
Set "typescript.suggestionActions.enabled
" to false
to disable suggestions.
You can read more on https://code.visualstudio.com/docs/languages/typescript