From be526654b3e54ec6623b6d102622ed0dd6c0f5a0 Mon Sep 17 00:00:00 2001 From: freshgum <85623267+freshgum-bubbles@users.noreply.github.com> Date: Mon, 9 Oct 2023 16:00:54 +0100 Subject: [PATCH 1/3] Fix rendering of tsconfig.json files in GitHub's web view Tell GitHub to render `tsconfig.json` files in the web view as JSON With Comments. This was something I discovered [while working on a project](https://github.com/freshgum-bubbles/typedi/blob/develop/tsconfig.typedoc.json). Support is also added for separate `tsconfig.*.json` files, which seem to be rather popular for using different values for different scenarios / environments. Happy to remove this if it doesn't align with the project goals. --- .gitattributes | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .gitattributes diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..e2244bc --- /dev/null +++ b/.gitattributes @@ -0,0 +1,5 @@ +# Fix how tsconfig.json files are displayed in GitHub's web view, +# by telling it to read said files as JSON With Comments, the +# JSON extension used by TypeScript. +tsconfig.*.json linguist-language=JSON-with-Comments +tsconfig.json linguist-language=JSON-with-Comments From ba91a237baf4f713cc7377c46f2d8ef9d1d84a0f Mon Sep 17 00:00:00 2001 From: freshgum <85623267+freshgum-bubbles@users.noreply.github.com> Date: Mon, 9 Oct 2023 16:06:21 +0100 Subject: [PATCH 2/3] Fix rendering of VSCode config in GitHub's web view --- .gitattributes | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitattributes b/.gitattributes index e2244bc..dc4bf36 100644 --- a/.gitattributes +++ b/.gitattributes @@ -3,3 +3,6 @@ # JSON extension used by TypeScript. tsconfig.*.json linguist-language=JSON-with-Comments tsconfig.json linguist-language=JSON-with-Comments + +# Also fix how Visual Studio Code configuration files are read. +vscode/*.json linguist-language=JSON-with-Comments From 43730d6c532f877afd0592718d260980206094cd Mon Sep 17 00:00:00 2001 From: freshgum <85623267+freshgum-bubbles@users.noreply.github.com> Date: Mon, 9 Oct 2023 16:06:59 +0100 Subject: [PATCH 3/3] Fix VSCode folder path in gitattributes --- .gitattributes | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitattributes b/.gitattributes index dc4bf36..dafe081 100644 --- a/.gitattributes +++ b/.gitattributes @@ -5,4 +5,4 @@ tsconfig.*.json linguist-language=JSON-with-Comments tsconfig.json linguist-language=JSON-with-Comments # Also fix how Visual Studio Code configuration files are read. -vscode/*.json linguist-language=JSON-with-Comments +.vscode/*.json linguist-language=JSON-with-Comments