fix(tools): Validate server-side keys (#40643)

Adds the `api-server` code to the key validation script to include keys
that are specifically used on the server-side only.

Signed-off-by: nhcarrigan <nhcarrigan@gmail.com>
This commit is contained in:
Nicholas Carrigan (he/him)
2021-01-08 08:39:28 -08:00
committed by Mrugesh Mohapatra
parent c7fc86c7bc
commit b0aaff19dc

View File

@ -54,9 +54,12 @@ const readComponentCode = filePath => {
};
const clientCodebase = readComponentCode(path.join(process.cwd() + '/src'));
const serverCodebase = readComponentCode(
path.join(process.cwd() + '/../api-server/server')
);
for (const key of keyStrings) {
if (!clientCodebase.includes(key)) {
if (!clientCodebase.includes(key) && !serverCodebase.includes(key)) {
console.warn(`The translation key '${key}' appears to be unused.`);
}
}