-
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: Fart function with destructuring #382
Comments
its a long-running bug that jslint crashes with cryptic-warnings when parsing fat-arrows that are anything but toy-case. the crashing-and-cryptic-warning-part should ideally be fixed, when maintainers find the time to do so. whether destructuring in fat-arrows should be tolerated however, is up to debate. |
Thank you for your quick response. I cannot think of any issues with destructuring a parameter on a fart function but if that is to be avoided I guess there should be a mention on the help page. Probably when jslint gets smarter it might produce a more helpful error message. |
should be fixed by following 2 pr's:
// old warning
Expected 'function' before '('.
pickOne: ({one}) => one
Expected '{' and instead saw '=>'.
pickOne: ({one}) => one
// new warning
Use 'function (...)', not '(...) =>' when arrow functions become too complex.
pickOne: ({one}) => one |
- 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
Wondering what is the violation of using a fart function here
v2021.12.20
Expected behavior
Should allow usage of fart function
The text was updated successfully, but these errors were encountered: