-
Notifications
You must be signed in to change notification settings - Fork 459
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
Bug report: ')' after argument in arrow function expression #379
Comments
thx for reporting. this seems to be a legacy-bug (pre v2020.11.6) that might need a parser update. i'll take a closer look at it this weekend. |
should be fixed in pr #384, with new warning forbidding [side-effect] statements within fat-arrow (jslint expect fat-arrows to only contain expressions) jslint still warns against your code, but warning is a bit clearer:
the new warning applies to following fat-arrow examples where it encounters a statement keyword: (x) => async ...
(x) => await ...
(x) => break ...
(x) => const ...
(x) => continue ...
(x) => debugger ...
(x) => delete ...
(x) => do ...
(x) => export ...
(x) => for ...
(x) => function ...
(x) => if ...
(x) => import ...
(x) => let ...
(x) => return ...
(x) => switch ...
(x) => throw ...
(x) => try ...
(x) => var ...
(x) => while ...
(x) => with ... closing issue as fixed, but feel free to re-open if you think there's a better-way to deal with the cryptic warnings. |
thank you ! |
- test - migrate all tests to use jstestDescribe(), jstestIt() - fs - rename jslint-wrapper-files to jslint_wrapper_xxx.xxx - bugfix - fix issue jslint-org#382 - make fart-related warnings more readable - bugfix - fix issue jslint-org#382 - fix warnings against destructured fart - bugfix - fix issue jslint-org#379 - warn against naked-statement in fart. - update commonjs-wrapper jslint.cjs to load jslint in strict-mode.
- test - migrate all tests to use jstestDescribe(), jstestIt() - fs - rename jslint-wrapper-files to jslint_wrapper_xxx.xxx - bugfix - fix issue #382 - make fart-related warnings more readable - bugfix - fix issue #382 - fix warnings against destructured fart - bugfix - fix issue #379 - warn against naked-statement in fart. - update commonjs-wrapper jslint.cjs to load jslint in strict-mode.
Describe the bug
In the Code snippet jslint complains about the ')' after the argument x. It wants it to match to the '(' of the .forEach, I guess.
But if I leave it out it complains about not wrapping the argument x in parantheses.
v2021.11.20
Expected behavior
I expect either jslint complains about me using arrow functions instead of a function declaration
or jslint does not complain at all.
The text was updated successfully, but these errors were encountered: