-
Notifications
You must be signed in to change notification settings - Fork 463
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
error on for...of statement #176
Comments
The for of statement is a new ES6 feature that has not yet been proven to be a good part. Try arr.every. Recursion is becoming a better approach than looping. |
Could this perhaps be reconsidered? It's been 8 more years, and at least to me, I'm new to JSLint, and really I like it: it is a self-contained, dependency-free tool that just works without npm hell. The one thing I don't like is that jslint cannot parse my loops. |
I think that is a good idea. We could also relax the restrictions on 'let' in scopes. Some of the JSLint rules were to get us thru some standard transitions, and I think those are way behind us now. |
function stmt_for() {
let first;
let the_for = token_now;
if (!option_dict.for) {
// test_cause:
// ["for", "stmt_for", "unexpected_a", "for", 1]
warn("unexpected_a", the_for);
}
check_not_top_level(the_for);
functionage.loop += 1;
advance("(");
token_now.free = true;
if (token_nxt.id === ";") {
... |
Firstly thanks for writing jslint, secondly I found this new for-of loop that javascript has
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for...of
but js lint throws the error
I could always use forEach instead but then I can't break out of the loop
what is your opinion, is the for of loop useful or should I use something else instead.
Thanks
The text was updated successfully, but these errors were encountered: