Improve heuristic

This commit is contained in:
Manav Rathi 2024-04-06 11:44:27 +05:30
parent 8695f46b43
commit d00211964b
No known key found for this signature in database

View file

@ -4,9 +4,9 @@
#
# Caveat emptor. Uses a heuristic grep, not perfect.
jq -r 'keys[]' packages/next/locales/en-US/translation.json | head | while read key
jq -r 'keys[]' packages/next/locales/en-US/translation.json | while read key
do
if ! git grep --quiet --fixed 't("'$key'")' -- :^'**/translation.json'
if ! git grep --quiet --fixed '"'$key'"' -- :^'**/translation.json'
then
echo "possibly unused key ${key}"
fi