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