Skip to content

Commit 2a92b6c

Browse files
Ryan-Diafasttime
andauthored
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 <github@fasttime.org>
1 parent d743ed3 commit 2a92b6c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ ESLint allows you to specify the JavaScript language options you want to support
191191

192192
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.
193193

194-
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.
194+
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 } }`.
195195

196196
Parser options are set in your `.eslintrc.*` file with the `parserOptions` property. The available options are:
197197

0 commit comments

Comments
 (0)