-
-
Notifications
You must be signed in to change notification settings - Fork 225
Future of ecmaFeatures.globalReturn #525
Copy link
Copy link
Open
Description
Problem: globalReturn can't be used with sourceType:module, and right now in ESLint we will detect this combination and set globalReturn to false. 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 makes ecmaFeatures.globalReturn obsolete, so there are several options we could pursue going forward:
- We could remove
ecmaFeatures.globalReturnaltogether. I think this is the cleanest solution now that we havesourceType: commonjs, however, we would probably want to throw an error ifecmaFeatures.globalReturnis specified to let people know that it has been removed. - We could keep
ecmaFeatures.globalReturnbut 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?
Reactions are currently unavailable