ts-oak-plugin/lib/core/jsxLiteralChecker.js

35 lines
1.1 KiB
JavaScript

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.JsxLiteralChecker = void 0;
class JsxLiteralChecker {
constructor(pwd, config, program, typeChecker, tsLib) {
this.pwd = pwd;
this.config = config;
this.program = program;
this.typeChecker = typeChecker;
this.tsLib = tsLib;
// i18n 数据缓存
this.localeDataCache = new Map();
this.tFunctionCalls = new Map();
}
checkFile(sourceFile) {
// 收集 t() 函数调用
const tCalls = this.collectTFunctionCalls(sourceFile);
// 检查 i18n keys
return this.checkI18nKeys(sourceFile, tCalls);
}
collectTFunctionCalls(sourceFile) {
// 复用原有的 isTCall 逻辑
const calls = [];
// ...
return calls;
}
checkI18nKeys(sourceFile, calls) {
// 复用原有的 checkI18nKeys 逻辑
const diagnostics = [];
// ...
return diagnostics;
}
}
exports.JsxLiteralChecker = JsxLiteralChecker;
//# sourceMappingURL=jsxLiteralChecker.js.map