0

I am using JSHint for linting and have encountered a problem when using co, within generator in yield statement I get ERROR: line 18 col 28 Missing semicolon.

co(function *() {

let orgAccounts = yield OrgAccount.findAll({accountId: account.id});

}).catch((err) => {
  console.log(err);
});

.jshintrc file looks like:

{
 "expr": true,
 "node": true,
 "esversion": 6,
 "bitwise": true,
 "eqeqeq": true,
 "immed": true,
 "latedef": "nofunc",
 "newcap": true,
 "noarg": true,
 "undef": true,
 "smarttabs": true,
 "asi": true,
 "debug": true,
 "noyield": true
}

How I can fix it?

1 Answers1

0

I changed my .jshintrc file:

{
 "expr": true,
 "node": true,
 "esversion": 6,
 "bitwise": true,
 "eqeqeq": true,
 "immed": true,
 "latedef": "nofunc",
 "newcap": true,
 "noarg": true,
 "undef": true,
 "smarttabs": true,
 "asi": true,
 "debug": true,
 "noyield": true
}

"asi": false to require semicolons.

This option suppresses warnings about missing semicolons. There is a lot of FUD about semicolon spread by quite a few people in the community. The common myths are that semicolons are required all the time (they are not) and that they are unreliable. JavaScript has rules about semicolons which are followed by all browsers so it is up to you to decide whether you should or should not use semicolons in your code.

JSHint Options Reference