【发布时间】:2016-10-08 05:50:48
【问题描述】:
ES6 模板文字上的documentation 具有以下语法示例:
`string text ${expression} string text`
接下来,我的功能是:
function madLib (verb, adjective, noun) {
return `We shall ${verb} the ${adjective} ${noun}.`;
}
在控制台中,按预期输出:
We shall fly the iridescent zoo.
但是,eslinter 包在第一个反引号时抱怨一个致命的解析错误,引用
Unexpected character '`'
这是为什么?
(文字上的 SO post 是关于语法错误——找不到任何其他相关的 eslinter 帖子。)
【问题讨论】:
标签: ecmascript-6 atom-editor eslint template-literals