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.globalReturn altogether. I think this is the cleanest solution now that we have sourceType: commonjs, however, we would probably want to throw an error if ecmaFeatures.globalReturn is specified to let people know that it has been removed.
- We could keep
ecmaFeatures.globalReturn but throw an error if it is used with sourceType: 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?
Problem:
globalReturncan't be used withsourceType:module, and right now in ESLint we will detect this combination and setglobalReturntofalse. 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.globalReturnobsolete, so there are several options we could pursue going forward: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.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?