提供两个更加友好的错误提示信息
This commit is contained in:
parent
f6f37ff97b
commit
501f0385d8
|
|
@ -286,7 +286,8 @@ function checkActionDefNameConsistent(filename: string, actionDefNode: ts.Variab
|
|||
const aName = actionNode.typeName.text.slice(0, actionNode.typeName.text.length - 6);
|
||||
const sName = stateNode.typeName.text.slice(0, stateNode.typeName.text.length - 5);
|
||||
|
||||
assert(adfName === aName && aName === sName, `文件${filename}中的ActionDef${name.text}中ActionDef, Action和State的命名规则不一致`);
|
||||
assert(adfName === aName && aName === sName, `文件${filename}中的ActionDef${name.text}中ActionDef, Action和State的命名规则不一致, 需要
|
||||
${adfName}ActionDef, ${adfName}Action, ${adfName}State`);
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -432,7 +433,7 @@ function tryGetStringLiteralValues(
|
|||
}
|
||||
|
||||
if (['state', 'action'].includes(obj)) {
|
||||
assert(values.length > 0);
|
||||
assert(values.length > 0, `${filename}中的${obj} ${node.typeName.getText()}未定义`);
|
||||
const importDeclartion = declaration.parent.parent.parent;
|
||||
|
||||
assert(ts.isImportDeclaration(importDeclartion));
|
||||
|
|
|
|||
Loading…
Reference in New Issue