Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upGlobal return error #148
Comments
This comment has been minimized.
This comment has been minimized.
|
Yes, this is meant to be allowed. |
This comment has been minimized.
This comment has been minimized.
|
I found the issue with I'm going to just remove support for ES6 modules until this is fixed, since it's marked "experimental" in eslint. If people really want ES6 modules, they can use a custom parser like babel-eslint (now supported). |
feross
added a commit
to standard/eslint-config-standard
that referenced
this issue
May 30, 2015
This comment has been minimized.
This comment has been minimized.
|
Hm, actually removing support for modules is likely to be more disruptive than just leaving this bug in there. It's been around since 3.0.0. |
feross
added
the
blocked
label
May 30, 2015
This comment has been minimized.
This comment has been minimized.
|
Reverted in standard/eslint-config-standard@537fbbe |
This comment has been minimized.
This comment has been minimized.
|
I'm happy to wait for this to be fixed in |
This comment has been minimized.
This comment has been minimized.
|
@dcousens cool, sounds good |
This comment has been minimized.
This comment has been minimized.
|
ESLint says this is working as intended:
@dcousens Open to suggestions about how to proceed. |
This comment has been minimized.
This comment has been minimized.
|
@feross well if it isn't possible, I say we stay entirely agnostic and set At least then it will be consistent across development environments (node, browserify or otherwise). IMHO anyway. |
This comment has been minimized.
This comment has been minimized.
Cuel
commented
Jun 2, 2015
|
What if I in index.js wanted to do like this return console.error('missing parameter')As in I'd like to exit without throwing an error. It woudn't be allowed in standard? |
This comment has been minimized.
This comment has been minimized.
|
@Cuel more to the point, it isn't allowed in |
This comment has been minimized.
This comment has been minimized.
|
@Cuel @dcousens I left a comment asking for more clever behavior from eslint here: eslint/eslint#2636 (comment) Feel free to support / share your opinion. |
This comment has been minimized.
This comment has been minimized.
|
@feross ES6 makes this difficult. Perhaps we should just change |
This comment has been minimized.
This comment has been minimized.
|
Agreed. |
dcousens commentedMay 30, 2015
Despite
globalReturnbeingtrue, I still getIllegal return statementwhen I usereturnin a self-contained translation unit (file/module).returnIsn't this behaviour is meant to be allowed?