From 6cee84650596bdba427dc0df1e3ba820d3eb1312 Mon Sep 17 00:00:00 2001 From: benalleng Date: Thu, 22 Feb 2024 13:18:14 -0500 Subject: [PATCH] further modify eslint rule --- tools/internal-rules/lib/rules/check-i18n-keys.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) 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"] });