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",
  "workbench.settings.editor": "json",

  "update.showReleaseNotes": false,
  "extensions.showRecommendationsOnlyOnDemand": false,
  "workbench.settings.enableNaturalLanguageSearch": false,
  "workbench.enableExperiments": false,
  "npm.fetchOnlinePackageInfo": false
}

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

Update (2018-08-16)

Added some stuff (from “update.showReleaseNotes” to “npm.fetchOnlinePackageInfo”) that are supposed to make Visual Studio Code work fully in offline mode. Nice initiative (better late than never, eh), but sadly there is still an ongoing request with those settings, not sure where it comes from. That’s still fewer requests than before, plus at least I don’t get warning messages when I block the request, so it’s definitely an improvement even if it’s not perfect yet.

Update (2018-09-17)

Added "workbench.settings.editor": "json" to disable the graphical settings editor (going back to text-based JSON editor)

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.

Sorry about the CAPTCHA that requires JS. If you really don't want to enable JS and still want to comment, you can send me your comment via e-mail and I'll post it for you.

Please solve the CAPTCHA below in order to fight spamWordPress CAPTCHA