From 310ea62fa151d5265be8ab81265e0ec82be324f0 Mon Sep 17 00:00:00 2001 From: Keith Maxwell Date: Fri, 8 Feb 2019 08:04:10 +0000 Subject: [PATCH] Docs: Clarify ecmaVersion doesn't imply globals (refs #9812) Before this change users can mistakenly assume that setting parserOptions.ecmaVersion automatically implies the globals from that ecmaVersion are available, in fact globals are controlled by a separate environment setting that is not affected by ecmaVersion. This PR implements the suggestion from https://github.com/eslint/eslint/issues/9812 --- docs/user-guide/configuring.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/user-guide/configuring.md b/docs/user-guide/configuring.md index 1eed790a2e8..6fa35ce2ed6 100644 --- a/docs/user-guide/configuring.md +++ b/docs/user-guide/configuring.md @@ -23,7 +23,7 @@ Please note that supporting JSX syntax is not the same as supporting React. Reac By the same token, supporting ES6 syntax is not the same as supporting new ES6 globals (e.g., new types such as `Set`). For ES6 syntax, use `{ "parserOptions": { "ecmaVersion": 6 } }`; for new ES6 global variables, use `{ "env": -{ "es6": true } }` (this setting enables ES6 syntax automatically). +{ "es6": true } }`. `{ env: { es6: true } }` enables ES6 syntax automatically, but `{ parserOptions: { ecmaVersion: 6 } }` does not enable ES6 globals automatically. Parser options are set in your `.eslintrc.*` file by using the `parserOptions` property. The available options are: * `ecmaVersion` - set to 3, 5 (default), 6, 7, 8, 9, or 10 to specify the version of ECMAScript syntax you want to use. You can also set to 2015 (same as 6), 2016 (same as 7), 2017 (same as 8), 2018 (same as 9), or 2019 (same as 10) to use the year-based naming.