From 9a401f75be84959fed46eebba47a0c325512df59 Mon Sep 17 00:00:00 2001 From: Stefan Dej Date: Fri, 16 Aug 2024 23:13:17 +0200 Subject: [PATCH] chore(prettier): add support to sort locale json files Signed-off-by: Stefan Dej --- .prettierrc | 8 ++++++++ package-lock.json | 21 +++++++++++++++++---- package.json | 3 ++- 3 files changed, 27 insertions(+), 5 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 5032e8e7c..1ed30c1c1 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.0", "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 2c22cbcb3..0b505abf5 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.0", "typescript": "^4.5.5",