admin管理员组文章数量:1399909
After having done a bad manipulation on WebStorm, I now have errors such as expecting newline or semicolon". For example after an async
or await
. Even having disabled all my rules in Languages Injections
I still have the same problem.
Followed this topic
async function reactEmoji(msg, index) {
index = index - 1
for (let i = 0; i < index; i++) {
let emojiElement = emoji[i]
await msg.react(emojiElement)
}
}
Between async
and function
, I've got this error :
Expecting newline or semicolon
.
After having done a bad manipulation on WebStorm, I now have errors such as expecting newline or semicolon". For example after an async
or await
. Even having disabled all my rules in Languages Injections
I still have the same problem.
Followed this topic
async function reactEmoji(msg, index) {
index = index - 1
for (let i = 0; i < index; i++) {
let emojiElement = emoji[i]
await msg.react(emojiElement)
}
}
Between async
and function
, I've got this error :
Expecting newline or semicolon
.
-
5
Make sure the language level for the project is set to ES6 and not ES5. Go to
Settings->Languages & Frameworks->JavaScript
and set it to ECMAScript 6. – Randy Casburn Commented Jul 18, 2019 at 13:20 - A semicolon is optional in es6+. If you are coding es5, you should consider warning. Otherwise, change the javascript version in the Editor to get rid of this warning. – Artin Falahi Commented Jul 18, 2019 at 13:26
1 Answer
Reset to default 4this can be caused by a lot of different issues. One of the most likely ones is that your language is set to ES5 instead ES6, or even something else.
Old versions of javascript don't even know the async
keyword, resulting in an error between async and function, as async is an unknown variable at this point.
To solve this issue, you can go to Settings -> Leanguages & Frameworks -> Javascript
and check what value is set there. I suppose you'll want to set this to ECMAscript 6
if you are using a transpiler, else you would probably want ES2015/ECMAscript 5.
本文标签: javascriptExpecting newline or semicolon error on WebStormStack Overflow
版权声明:本文标题:javascript - Expecting newline or semicolon error on WebStorm - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744243269a2596888.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论