-
Notifications
You must be signed in to change notification settings - Fork 984
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore(style): Sort JSON keys in translations/en.json #20785
Conversation
@@ -317,7 +317,7 @@ lint: ##@test Run code style checks | |||
scripts/lint/translations.clj && \ | |||
zprint '{:search-config? true}' -sfc $$ALL_CLOJURE_FILES && \ | |||
sh scripts/lint/trailing-newline.sh && \ | |||
node_modules/.bin/prettier --write . | |||
node_modules/.bin/prettier --check . |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The lint
target shouldn't change files, this should be reserved to the lint-fix
target.
@@ -97,7 +97,8 @@ | |||
"jest-silent-reporter": "^0.5.0", | |||
"nodemon": "^2.0.16", | |||
"nyc": "^14.1.1", | |||
"prettier": "^2.8.8", | |||
"prettier": "^3.3.3", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had to upgrade prettier to latest (above 3.x) because the JSON sort plugin has this requirement.
c64ccf6
to
afbc518
Compare
Jenkins Builds
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wohoo! Thanks for this :)
afbc518
to
afc15cf
Compare
86% of end-end tests have passed
Expected to fail tests (1)Click to expandClass TestWalletOneDevice:
Passed tests (6)Click to expandClass TestWalletOneDevice:
Class TestCommunityOneDeviceMerged:
Class TestWalletMultipleDevice:
Class TestOneToOneChatMultipleSharedDevicesNewUi:
|
Summary
Quick win PR, this one now sorts keys (non-recursively) in
translations/en.json
. The solution uses the prettier plugin https://github.com/Gudahtt/prettier-plugin-sort-json.I opted to only format
translations/en.json
because that's the only file we need to change manually and this speeds up a little bit our already slowlint
andlint-fix
make targets.prettier-plugin-sort-json
version4.0.0
prettier
, from version2.8.8
to3.3.3
.en.json
without thinking too much.Areas that may be impacted
None. I compared my manual sorting with the output from the lib, and no keys were removed for example. Seems to be a robust solution.
Steps to test
make lint
ormake lint-fix
status: ready