From 2a92b6cc9520a27255520369206556e9841a3af8 Mon Sep 17 00:00:00 2001 From: Cheol-Won <76567238+Ryan-Dia@users.noreply.github.com> Date: Wed, 2 Aug 2023 13:04:08 +0900 Subject: [PATCH] docs: update with "Specifying Parser Options" (#17435) * docs: update with "Specifying Parser Options" * docs : reapply lint * Update docs/src/use/configure/language-options.md * docs : reapply lint --------- Co-authored-by: Francesco Trotta --- docs/src/use/configure/language-options.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/src/use/configure/language-options.md b/docs/src/use/configure/language-options.md index a89224780ac..4bcd63e3c98 100644 --- a/docs/src/use/configure/language-options.md +++ b/docs/src/use/configure/language-options.md @@ -191,7 +191,7 @@ ESLint allows you to specify the JavaScript language options you want to support Please note that supporting JSX syntax is not the same as supporting React. React applies specific semantics to JSX syntax that ESLint doesn't recognize. We recommend using [eslint-plugin-react](https://github.com/jsx-eslint/eslint-plugin-react) if you are using React. -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 } }`. Setting `{ "env": { "es6": true } }` enables ES6 syntax automatically, but `{ "parserOptions": { "ecmaVersion": 6 } }` does not enable ES6 globals automatically. +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 } }`. Setting `{ "env": { "es6": true } }` enables ES6 syntax automatically, but `{ "parserOptions": { "ecmaVersion": 6 } }` does not enable ES6 globals automatically. In summary, to support only ES6 syntax, use `{ "parserOptions": { "ecmaVersion": 6 } }`, and to support both ES6 syntax and new ES6 global variables, such as `Set` and others, use `{ "env": { "es6": true } }`. Parser options are set in your `.eslintrc.*` file with the `parserOptions` property. The available options are: