Merge pull request #33663 from overleaf/td-en-json-sort-hook

Sort staged locale files in the pre-commit hook

GitOrigin-RevId: fb3a155be52495305372c5c5cc54c2f50e88c417
This commit is contained in:
Tim Down
2026-05-28 08:05:22 +00:00
committed by Copybot
parent 52a8a447aa
commit 287e619967
@@ -0,0 +1,9 @@
import fs from 'fs'
const file = process.argv[2]
if (!file) {
console.error('Usage: node sort-locale-file.js <path>')
process.exit(1)
}
const obj = JSON.parse(fs.readFileSync(file, 'utf8'))
fs.writeFileSync(file, JSON.stringify(obj, Object.keys(obj).sort(), 2) + '\n')