From 3a6e443e198157d9c002157d3498569fb1e37026 Mon Sep 17 00:00:00 2001 From: George Kalpakas Date: Sun, 17 Feb 2019 15:10:32 +0200 Subject: [PATCH] build: update VSCode settings to limit auto-formatting on save to JS/TS files (#28784) Previously, auto-formatting on save was enabled for all file types, which meant also using default VSCode formatting settings for files where this was not desirable - for example HTML files (such as angular.io and docs examples templates) and JSON files (such as Firebase configurations). This was problematic for the following reasons: - Unlike with JS/TS files, the formatting of other file types is not checked/enforced on CI. - Formatting is subject to default VSCode settings and everyone's local VSCode settings overrides. - Especially for docs examples files, changing the layout might require updating the wording in corresponding guides (e.g. when referring to line-numbers). If we decide that we do want to lint those other file types as well (which sounds like a good idea), we should do it in a way that ensures consistent formatting and check the formatting on CI. PR Close #28784 --- .vscode/settings.json | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index 0fa0d13829..b51f0348c6 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,5 +1,10 @@ { - "editor.formatOnSave": true, + "[javascript]": { + "editor.formatOnSave": true, + }, + "[typescript]": { + "editor.formatOnSave": true, + }, // Please install http://clang.llvm.org/docs/ClangFormat.html in VSCode to take advantage of clang-format "clang-format.executable": "${workspaceRoot}/node_modules/.bin/clang-format", "files.watcherExclude": { @@ -16,4 +21,4 @@ "**/dist": true, }, "git.ignoreLimitWarning": true, -} \ No newline at end of file +}