Skip to content

Commit

Permalink
update doc
Browse files Browse the repository at this point in the history
  • Loading branch information
ota-meshi committed Jul 2, 2021
1 parent 2655921 commit 92389e5
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions docs/user-guide/README.md
Expand Up @@ -359,20 +359,22 @@ module.exports = {

##### Using ESLint <= v7.x

The parser `espree` that comes with `ESLint` doesn't understand the syntax of ES2022, so it can't parse Top Level `await` either.
However, the `vue-eslint-parser` used by `eslint-plugin-vue` can use `espree` v8, which understands ES2022 by configuration.
The parser `espree` that comes with `ESLint` v7.x doesn't understand the syntax of ES2022, so it can't parse the Top Level `await` either.
However, `espree` v8+ can understand the syntax of ES2022 and parse the Top Level `await`.
You install `espree` v8+ and specify `"espree"` and ES2022 in your configuration, the parser will be able to parse it.

```js
module.exports = {
parser: 'vue-eslint-parser',
parserOptions: {
ecmaVersion: 2022, // If you specify 2022, espree >= v8.x will be used automatically.
parser: 'espree', // <-
ecmaVersion: 2022, // <-
sourceType: 'module'
},
}
```

However, note that the AST generated by `espree` v8 may not work well with some rules of `ESLint` v7.
However, note that the AST generated by `espree` v8+ may not work well with some rules of `ESLint` v7.x.

<!--
##### Using ESLint >= v8.x
Expand Down

0 comments on commit 92389e5

Please sign in to comment.