Skip to content


My Visual Studio Code config file (TypeScript-oriented)

Just to find it easily whenever I switch computer, my Visual Studio Code user settings file (for TypeScript development):

{
    "telemetry.enableCrashReporter": false,
    "telemetry.enableTelemetry": false,
    "typescript.disableAutomaticTypeAcquisition": true,
    "files.exclude": {
        "**/*.js": { "when": "$(basename).ts"}
    },
    "git.enabled": false,
    "git.path": null,
    "git.autofetch": false,
    "workbench.iconTheme": null,
    "typescript.tsdk": "/usr/local/lib/node_modules/typescript/lib",
    "typescript.autoImportSuggestions.enabled": false,
    "update.channel": "none",
    "extensions.autoUpdate": false,
    "php.executablePath": "D:\\PROG\\PROGRAMMING\\xampp-7.0.8\\php\\php.exe",
    "php.suggest.basic": false,
    "editor.insertSpaces": true,
    "editor.tabSize": 2,
    "files.eol": "\n"
}

It should be quite self-explaining in most part, but what these settings do is:
– disable telemetry and crash reporter
disable checking for mismatch between VSCode’s TypeScript and the globally installed TypeScript (“typescript.check.tscVersion”=false) (which gives a pretty annoying warning that can’t be permanently dismissed and shouldn’t be a problem if you update everything regularly) This was apparently removed at some point
– disable Automatic Type Acquisition (ATA)
– hide .js files when a .ts file of the same name exists
– disable Git integration (probably the 3 settings I used are a bit redundant though), although in the end I reactivated it because it’s pretty convenient to spot which lines you recently edited
– disable the file icon theme (“workbench.iconTheme” = null), which was enabled by default in version 1.13 and looks pretty nice indeed, but wastes too much space IMO and is a bit useless if your project is well-organized
– use my globally-installed, up-to-date TypeScript, rather than the one included in VSCode (which can be a bit outdated sometimes). NB: you can use npm list -g typescript to find out where your TypeScript package is globally installed
– disable Auto imports (added in TypeScript 2.6), because they seem buggy ATM and tend to import lots of unwanted trash for no good reason
– disable update-checking (“update.channel” = “none” and “extensions.autoUpdate” = false): my original hope was to prevent VSCode from sending mysterious and unsolicited network requests, but despite auto-update and extensions updates being turned off it still sends network requests :/
– use 2 spaces as indent instead of tabs. Note that by default VSCode already replaces tabs with spaces (editor.insertSpaces is true), but it uses 4 instead of 2 (editor.tabSize is 4 by default)
– use LF (rather than CR,LF – “\r\n”) as default line ending

Update (2017-12-21)

Added some stuff for PHP (for the PHP IntelliSense plugin)
{
“php.executablePath”: “C:\\…..\\php\\php.exe”,
“php.suggest.basic”: false
}
– php.executablePath gives the path to the PHP binary
– php.suggest.basic is set to false to avoid conflicts between the plugin and the native (basic) PHP auto-completion

Posted in JavaScript / TypeScript / Node.js.


0 Responses

Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.



Some HTML is OK

or, reply to this post via trackback.

Please solve the CAPTCHA below in order to fight spamWordPress CAPTCHA