File tree 1 file changed +6
-4
lines changed
1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -361,20 +361,22 @@ module.exports = {
361
361
362
362
##### Using ESLint <= v7.x
363
363
364
- The parser ` espree ` that comes with ` ESLint ` doesn't understand the syntax of ES2022, so it can't parse Top Level ` await ` either.
365
- However, the ` vue-eslint-parser ` used by ` eslint-plugin-vue ` can use ` espree ` v8, which understands ES2022 by configuration.
364
+ 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.
365
+ However, ` espree ` v8+ can understand the syntax of ES2022 and parse the Top Level ` await ` .
366
+ You install ` espree ` v8+ and specify ` "espree" ` and ES2022 in your configuration, the parser will be able to parse it.
366
367
367
368
``` js
368
369
module .exports = {
369
370
parser: ' vue-eslint-parser' ,
370
371
parserOptions: {
371
- ecmaVersion: 2022 , // If you specify 2022, espree >= v8.x will be used automatically.
372
+ parser: ' espree' , // <-
373
+ ecmaVersion: 2022 , // <-
372
374
sourceType: ' module'
373
375
},
374
376
}
375
377
```
376
378
377
- However, note that the AST generated by ` espree ` v8 may not work well with some rules of ` ESLint ` v7.
379
+ However, note that the AST generated by ` espree ` v8+ may not work well with some rules of ` ESLint ` v7.x .
378
380
379
381
<!--
380
382
##### Using ESLint >= v8.x
You can’t perform that action at this time.
0 commit comments