Skip to content
This repository was archived by the owner on Aug 18, 2021. It is now read-only.

Commit 77c182f

Browse files
author
Kai Cataldo
committed
Add documentation for ecmaFeatures.globalReturn
1 parent 704b512 commit 77c182f

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,15 +81,19 @@ Check out the [ESLint docs](http://eslint.org/docs/rules/) for all possible rule
8181

8282
- `sourceType` can be set to `'module'`(default) or `'script'` if your code isn't using ECMAScript modules.
8383
- `allowImportExportEverywhere` (default `false`) can be set to `true` to allow import and export declarations to appear anywhere a statement is allowed if your build environment supports that. Otherwise import and export declarations can only appear at a program's top level.
84+
- `ecmaFeatures.globalReturn` (default `false`) allow return statements in the global scope when used with `sourceType: "script"`.
8485

85-
**.eslintrc**
86+
**.eslintrc.json**
8687

8788
```json
8889
{
8990
"parser": "babel-eslint",
9091
"parserOptions": {
9192
"sourceType": "module",
9293
"allowImportExportEverywhere": false,
94+
"ecmaFeatures": {
95+
"globalReturn": false
96+
}
9397
}
9498
}
9599
```

test/specs/non-regression.js

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@ function verifyAndAssertMessagesWithSpecificESLint(
2121
parserOptions: {
2222
ecmaVersion: 2018,
2323
ecmaFeatures: {
24-
jsx: true,
25-
experimentalObjectRestSpread: true,
2624
globalReturn: true,
2725
},
2826
sourceType,
@@ -1155,9 +1153,6 @@ describe("verify", () => {
11551153
) {
11561154
const overrideConfig = {
11571155
parserOptions: {
1158-
ecmaFeatures: {
1159-
legacyDecorators: true,
1160-
},
11611156
sourceType,
11621157
},
11631158
};

0 commit comments

Comments
 (0)