Skip to content

Commit

Permalink
Add precommit check for keyset.json & context.json
Browse files Browse the repository at this point in the history
  • Loading branch information
Marginy605 committed Jan 25, 2024
1 parent a95a7f3 commit 53c5339
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .lintstagedrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,8 @@
],
"src/i18n-keysets/**/!({keyset,context}).json": [
"node scripts/i18n-keysets-sort.js"
],
"src/i18n-keysets/**/({keyset,context}).json": [
"node scripts/i18n-keysets-clear.js"
]
}
13 changes: 13 additions & 0 deletions scripts/i18n-keysets-clear.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/**
* Because of move to Weblate we don't need keyset.json & context.json files
*/

const keysetFiles = process.argv.slice(2);
if (keysetFiles.length) {
console.error(
`It it prohibited to add keyset.json and context.json files:\n\n${keysetFiles.join('\n')}`,
);
process.exitCode = 1;
} else {
process.exitCode = 0;
}

0 comments on commit 53c5339

Please sign in to comment.