Skip to content

Commit 035fc4f

Browse files
authored
docs: note that globalReturn applies only with sourceType: "script" (#20630)
1 parent 079bba7 commit 035fc4f

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

docs/src/use/configure/language-options.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ If you are using the built-in ESLint parser, you can additionally change how ESL
4545

4646
- `allowReserved` - allow the use of reserved words as identifiers (if `ecmaVersion` is `3`).
4747
- `ecmaFeatures` - an object indicating which additional language features you'd like to use:
48-
- `globalReturn` - allow `return` statements in the global scope.
48+
- `globalReturn` - allow `return` statements in the global scope. This option only applies when `languageOptions.sourceType` is set to `"script"`. When `languageOptions.sourceType` is set to `"commonjs"`, top-level `return` statements are allowed regardless of this option. When `languageOptions.sourceType` is set to `"module"`, top-level `return` statements are not allowed even if this option is set to `true`.
4949
- `impliedStrict` - enable global [strict mode](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Strict_mode) (if `ecmaVersion` is `5` or greater).
5050
- `jsx` - enable [JSX](https://facebook.github.io/jsx/).
5151

0 commit comments

Comments
 (0)