-
-
Notifications
You must be signed in to change notification settings - Fork 199
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
Future of ecmaFeatures.globalReturn #525
Comments
Option 1 seems cleanest to me as well. We'd be able to give a very clear and actionable error message: |
If we are not aware of any use cases for |
Marking as accepted. |
I would like to work on this. Is this ready to implement? Just to confirm my understanding is correct the changes are
|
We aren’t quite ready to implement this yet. We will need to wait for the new config system to roll out and give advance notice before we remove any existing functionality. |
Is it good to go now? |
Not yet. This will need to happen in the v10.0.0 timeframe, once the old config system has been removed. |
Problem:
globalReturn
can't be used withsourceType:module
, and right now in ESLint we will detect this combination and setglobalReturn
tofalse
. Arguably, this behavior is undesirable because ESLint is silently fixing a problem rather than letting the user know that it happened.We recently just implemented
sourceType: commonjs
, which effectively makesecmaFeatures.globalReturn
obsolete, so there are several options we could pursue going forward:ecmaFeatures.globalReturn
altogether. I think this is the cleanest solution now that we havesourceType: commonjs
, however, we would probably want to throw an error ifecmaFeatures.globalReturn
is specified to let people know that it has been removed.ecmaFeatures.globalReturn
but throw an error if it is used withsourceType: module
. This error would bubble up to ESLint and to the user, allowing them to fix their configuration.In either case, we could remove the logic from ESLint completely.
Thoughts?
The text was updated successfully, but these errors were encountered: