diff --git a/tools/internal-rules/lib/rules/check-i18n-keys.js b/tools/internal-rules/lib/rules/check-i18n-keys.js index 3fcafaf9..d3c31f8b 100644 --- a/tools/internal-rules/lib/rules/check-i18n-keys.js +++ b/tools/internal-rules/lib/rules/check-i18n-keys.js @@ -21,12 +21,10 @@ module.exports = { function extractKeys(node, parentKey = "") { const keys = []; let properties = node.properties; - let fileContent; - let ast; if (typeof node === "string") { - fileContent = fs.readFileSync(node, "utf8"); - ast = parse(fileContent, { + const fileContent = fs.readFileSync(node, "utf8"); + const ast = parse(fileContent, { sourceType: "module", plugins: ["typescript", "jsx"] });