From cc584c0c808c692b51078933a9991e21988d5b12 Mon Sep 17 00:00:00 2001 From: Stefan Dej Date: Tue, 27 Aug 2024 21:10:16 +0200 Subject: [PATCH] chore(prettier): add support to sort locale json files (#1976) --- .prettierrc | 8 +++++++ package-lock.json | 21 +++++++++++++++---- package.json | 3 ++- .../panels/Status/ExcludeObjectDialogMap.vue | 4 ++-- src/locales/da.json | 1 - src/locales/es.json | 1 - src/locales/fr.json | 2 +- src/locales/it.json | 2 +- src/locales/pl.json | 2 +- src/locales/ru.json | 2 +- src/locales/se.json | 2 +- 11 files changed, 34 insertions(+), 14 deletions(-) diff --git a/.prettierrc b/.prettierrc index 456bf2ce1..b0c885617 100644 --- a/.prettierrc +++ b/.prettierrc @@ -18,6 +18,14 @@ "options": { "tabWidth": 2 } + }, + { + "files": "src/locales/*.json", + "options": { + "plugins": ["prettier-plugin-sort-json"], + "jsonRecursiveSort": true, + "jsonSortOrder": "{ \"placeThisFirst\": null, \"/^[a-zA-Z0-9]/\": \"caseInsensitiveNumeric\" }" + } } ] } diff --git a/package-lock.json b/package-lock.json index 255490f1d..cc060d99e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -75,7 +75,8 @@ "eslint-plugin-vue": "^9.0.0", "postcss": "^8.4.31", "postcss-nesting": "^12.0.1", - "prettier": "^3.0.0", + "prettier": "^3.3.3", + "prettier-plugin-sort-json": "^4.0.0", "sass": "~1.32", "start-server-and-test": "^2.0.5", "typescript": "^4.5.5", @@ -8052,9 +8053,9 @@ } }, "node_modules/prettier": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.0.3.tgz", - "integrity": "sha512-L/4pUDMxcNa8R/EthV08Zt42WBO4h1rarVtK0K+QJG0X187OLo7l699jWw0GKuwzkPQ//jMFA/8Xm6Fh3J/DAg==", + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.3.3.tgz", + "integrity": "sha512-i2tDNA0O5IrMO757lfrdQZCc2jPNDVntV0m/+4whiDfWaTKfMNgR7Qz0NAeGz/nRqF4m5/6CLzbP4/liHt12Ew==", "dev": true, "bin": { "prettier": "bin/prettier.cjs" @@ -8066,6 +8067,18 @@ "url": "https://github.com/prettier/prettier?sponsor=1" } }, + "node_modules/prettier-plugin-sort-json": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/prettier-plugin-sort-json/-/prettier-plugin-sort-json-4.0.0.tgz", + "integrity": "sha512-zV5g+bWFD2zAqyQ8gCkwUTC49o9FxslaUdirwivt5GZHcf57hCocavykuyYqbExoEsuBOg8IU36OY7zmVEMOWA==", + "dev": true, + "engines": { + "node": ">=18.0.0" + }, + "peerDependencies": { + "prettier": "^3.0.0" + } + }, "node_modules/pretty-bytes": { "version": "5.6.0", "resolved": "https://registry.npmjs.org/pretty-bytes/-/pretty-bytes-5.6.0.tgz", diff --git a/package.json b/package.json index 65de31342..c97fef7c1 100644 --- a/package.json +++ b/package.json @@ -90,7 +90,8 @@ "eslint-plugin-vue": "^9.0.0", "postcss": "^8.4.31", "postcss-nesting": "^12.0.1", - "prettier": "^3.0.0", + "prettier": "^3.3.3", + "prettier-plugin-sort-json": "^4.0.0", "sass": "~1.32", "start-server-and-test": "^2.0.5", "typescript": "^4.5.5", diff --git a/src/components/panels/Status/ExcludeObjectDialogMap.vue b/src/components/panels/Status/ExcludeObjectDialogMap.vue index 2a5a18dcb..b004817f4 100644 --- a/src/components/panels/Status/ExcludeObjectDialogMap.vue +++ b/src/components/panels/Status/ExcludeObjectDialogMap.vue @@ -62,8 +62,8 @@ hoverName === object.name ? primaryColor : excluded_objects.includes(object.name) - ? '#6668' - : '#bbb' + ? '#6668' + : '#bbb' " @mouseover="showObjectTooltip(object.name)" @mouseout="hideObjectTooltip" diff --git a/src/locales/da.json b/src/locales/da.json index 35e9a865d..6c8049e9d 100644 --- a/src/locales/da.json +++ b/src/locales/da.json @@ -990,7 +990,6 @@ "DbHistoryTotals": "Totalhistorik", "DbMaintenance": "Vedligeholdelse", "DbNavigation": "Navigation", - "DBNavigation": "Navigation", "DbTimelapseSettings": "Timelapse indstillinger", "DbView": "Vis indstillinger", "EstimateValues": { diff --git a/src/locales/es.json b/src/locales/es.json index 7261fdcd7..a71309968 100644 --- a/src/locales/es.json +++ b/src/locales/es.json @@ -1001,7 +1001,6 @@ "DbHistoryTotals": "Historial Totales", "DbMaintenance": "Mantenimiento", "DbNavigation": "Navegación", - "DBNavigation": "Navegación", "DbTimelapseSettings": "Ajustes de Timelapse", "DbView": "Ajustes de Vista", "DbWebcams": "Cámaras web", diff --git a/src/locales/fr.json b/src/locales/fr.json index 87901bd98..9ee45b299 100644 --- a/src/locales/fr.json +++ b/src/locales/fr.json @@ -931,7 +931,7 @@ "DbConsoleHistory": "Historique de la console", "DbHistoryJobs": "Historique des travaux", "DbHistoryTotals": "Historique Totaux", - "DBNavigation": "Navigation", + "DbNavigation": "Navigation", "DbTimelapseSettings": "Réglages Timelapse", "DbView": "Voir les paramètres", "EstimateValues": { diff --git a/src/locales/it.json b/src/locales/it.json index d4a2267fd..cf4572474 100644 --- a/src/locales/it.json +++ b/src/locales/it.json @@ -922,7 +922,7 @@ "DbConsoleHistory": "Cronologia Console", "DbHistoryJobs": "Cronologia Lavori", "DbHistoryTotals": "Cronologia Totali", - "DBNavigation": "Navigazione", + "DbNavigation": "Navigazione", "DbTimelapseSettings": "Impostazioni Timelapse", "DbView": "Vedi Impostazioni ", "EstimateValues": { diff --git a/src/locales/pl.json b/src/locales/pl.json index 7887bada8..844439810 100644 --- a/src/locales/pl.json +++ b/src/locales/pl.json @@ -906,7 +906,7 @@ "DbConsoleHistory": "Historia Konsoli", "DbHistoryJobs": "Historia wydruków", "DbHistoryTotals": "Łączna historia", - "DBNavigation": "Nawigacja", + "DbNavigation": "Nawigacja", "DbTimelapseSettings": "Ustawienia timelapse", "DbView": "Ustawienia", "EstimateValues": { diff --git a/src/locales/ru.json b/src/locales/ru.json index 95b7a368d..a5628c716 100644 --- a/src/locales/ru.json +++ b/src/locales/ru.json @@ -944,7 +944,7 @@ "DbConsoleHistory": "История консоли", "DbHistoryJobs": "История заданий", "DbHistoryTotals": "Всего заданий", - "DBNavigation": "Навигация", + "DbNavigation": "Навигация", "DbTimelapseSettings": "Настройки таймлапса", "DbView": "Настройки отображения", "EstimateValues": { diff --git a/src/locales/se.json b/src/locales/se.json index ec8607981..851b3200d 100644 --- a/src/locales/se.json +++ b/src/locales/se.json @@ -922,7 +922,7 @@ "DbConsoleHistory": "Konsolhistorik", "DbHistoryJobs": "Jobbhistorik", "DbHistoryTotals": "Historik totalt", - "DBNavigation": "Navigering", + "DbNavigation": "Navigering", "DbTimelapseSettings": "Timelapse inställningar", "DbView": "Visa inställningar", "EstimateValues": {