I am new to ES6 and been trying to figure out how to rewrite this.
I am receiving the ff: in my eslint
server.listen(config.site.port, config.site.host, function (err) { if (err) { throw err; } });
I tried reading the specs and try it out but can't seem to figure out what to do if it has if
condition. https://eslint.org/docs/rules/prefer-arrow-callback
Thanks a lot.
The prefer-arrow-callback should be fixed by:
server.listen(config.site.port, config.site.host, (err) => {
if (err) {
throw err;
}
});
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.