From d00a2e8920c7a22a71c82bae4025d9a73a267554 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 | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index 3fd1d447d0..b51f0348c6 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,4 +1,12 @@ { + "[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": { "**/.git/objects/**": true, "**/.git/subtree-cache/**": true, @@ -12,4 +20,5 @@ "**/bazel-out": true, "**/dist": true, }, -} \ No newline at end of file + "git.ignoreLimitWarning": true, +}