mirror of
https://github.com/openharmony/developtools_ace-ets2bundle.git
synced 2026-07-19 16:43:34 -04:00
@@ -30,8 +30,8 @@ function preProcess(source: string): string {
|
||||
if (/\.ets$/.test(this.resourcePath)) {
|
||||
const result: ReplaceResult = sourceReplace(source, this.resourcePath);
|
||||
const newContent: string = result.content;
|
||||
const log: LogInfo[] = result.log;
|
||||
log.concat(validateUISyntax(source, newContent, this.resourcePath, this.resourceQuery));
|
||||
const log: LogInfo[] = result.log.concat(validateUISyntax(source, newContent,
|
||||
this.resourcePath, this.resourceQuery));
|
||||
if (log.length) {
|
||||
emitLogInfo(this, log);
|
||||
}
|
||||
|
||||
@@ -189,7 +189,8 @@ function validateEntryCount(result: DecoratorResult, fileQuery: string,
|
||||
if (result.entryCount !== 1 && fileQuery === '?entry') {
|
||||
log.push({
|
||||
type: LogType.ERROR,
|
||||
message: `A page must have one and only one '@Entry' decorator with a struct.`,
|
||||
message: `A page configured in 'config.json' must have one and only one '@Entry' `
|
||||
+ `decorator with a struct.`,
|
||||
fileName: fileName
|
||||
});
|
||||
}
|
||||
@@ -266,8 +267,13 @@ function checkDecorators(node: ts.MissingDeclaration | ts.ExportAssignment, resu
|
||||
addLog(LogType.WARN, message, component.pos, log, sourceFile);
|
||||
}
|
||||
if (BUILDIN_STYLE_NAMES.has(componentName)) {
|
||||
const message: string =
|
||||
`The struct '${componentName}' cannot have the same name as the built-in attribute '${componentName}'.`;
|
||||
const message: string = `The struct '${componentName}' cannot have the same name ` +
|
||||
`as the built-in attribute '${componentName}'.`;
|
||||
addLog(LogType.ERROR, message, component.pos, log, sourceFile);
|
||||
}
|
||||
if (INNER_COMPONENT_NAMES.has(componentName)) {
|
||||
const message: string = `The struct '${componentName}' cannot have the same name ` +
|
||||
`as the built-in component '${componentName}'.`;
|
||||
addLog(LogType.ERROR, message, component.pos, log, sourceFile);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user