-
Notifications
You must be signed in to change notification settings - Fork 111
Open
Description
报错信息:
TypeError: Cannot read property 'type' of null(~/lib/js/rules/arrow-body-style.js). (syntax)
TypeError: Cannot read property 'type' of null
at validate (/Users/xxx/xxx/fecs/lib/js/rules/arrow-body-style.js:77:54)引发出错的代码片段:
err => {
return;
}分析:
if (asNeeded && firstNode && firstNode.type === 'ReturnStatement') {
if (!needMaps[firstNode.argument.type]) {
report(node);
}
}firstNode.argument 为 null 导致,应该需要提前判断一下吧
Metadata
Metadata
Assignees
Labels
No labels