From 8eb98ce91450a399df83a43b87bdceffeb54b192 Mon Sep 17 00:00:00 2001 From: Alan Orth Date: Thu, 15 Jun 2023 16:31:28 +0300 Subject: [PATCH 1/3] .eslintrc.json: use plugin:jsonc/recommended-with-json5 The eslint-plugin-jsonc has a recommended configuration for json5. See: https://ota-meshi.github.io/eslint-plugin-jsonc/user-guide/#usage (cherry picked from commit 3a057332569cbc7fd5032eb20b0309bd8e66eccd) --- .eslintrc.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.eslintrc.json b/.eslintrc.json index 888c968b5c..d5832cb406 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -302,7 +302,7 @@ "*.json5" ], "extends": [ - "plugin:jsonc/recommended-with-jsonc" + "plugin:jsonc/recommended-with-json5" ], "rules": { "no-irregular-whitespace": "error", From 4c1220df308a0bbef9e5ec0e56c279bf068677ed Mon Sep 17 00:00:00 2001 From: Alan Orth Date: Tue, 15 Apr 2025 23:55:43 +0300 Subject: [PATCH 2/3] .eslintrc.json: use jsonc/no-irregular-whitespace The eslint-plugin-jsonc documentation recommends turning ESLint's own no-irregular-whitespace plugin off for JSON files in favor of its own jsonc/no-irregular-whitespace plugin. See: https://ota-meshi.github.io/eslint-plugin-jsonc/rules/no-irregular-whitespace.html (cherry picked from commit 5e8571de80b071b2e331e217d2d07a4f9c42f425) --- .eslintrc.json | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.eslintrc.json b/.eslintrc.json index d5832cb406..82f9519c27 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -305,7 +305,10 @@ "plugin:jsonc/recommended-with-json5" ], "rules": { - "no-irregular-whitespace": "error", + // The ESLint core no-irregular-whitespace rule doesn't work well in JSON + // See: https://ota-meshi.github.io/eslint-plugin-jsonc/rules/no-irregular-whitespace.html + "no-irregular-whitespace": "off", + "jsonc/no-irregular-whitespace": "error", "no-trailing-spaces": "error", "jsonc/comma-dangle": [ "error", From a07b7b1f702f0eccb170a8ede1ebe0d559ffbb90 Mon Sep 17 00:00:00 2001 From: Alan Orth Date: Tue, 15 Apr 2025 23:57:19 +0300 Subject: [PATCH 3/3] .eslintrc.json: remove second eslint-plugin-jsonc This seems to have been added twice at some point. (cherry picked from commit 9896eab6ac096849ac576fdd75802f3b1821ac9d) --- .eslintrc.json | 1 - 1 file changed, 1 deletion(-) diff --git a/.eslintrc.json b/.eslintrc.json index 82f9519c27..1151e6831b 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -12,7 +12,6 @@ "eslint-plugin-rxjs", "eslint-plugin-simple-import-sort", "eslint-plugin-import-newlines", - "eslint-plugin-jsonc", "dspace-angular-ts", "dspace-angular-html" ],