Skip to content

Commit

Permalink
Add tests with espree v9 (#1622)
Browse files Browse the repository at this point in the history
  • Loading branch information
ota-meshi committed Sep 13, 2021
1 parent 5fe2445 commit eaf6584
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 6 deletions.
11 changes: 6 additions & 5 deletions docs/user-guide/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -265,9 +265,10 @@ See also: "[How to use a custom parser?](#how-to-use-a-custom-parser)" section.
]
```

2. Make sure your tool is set to lint `.vue` files.
- CLI targets only `.js` files by default. You have to specify additional extensions with the `--ext` option or glob patterns. E.g. `eslint "src/**/*.{js,vue}"` or `eslint src --ext .vue`. If you use `@vue/cli-plugin-eslint` and the `vue-cli-service lint` command - you don't have to worry about it.
- If you are having issues with configuring editor, please read [editor integrations](#editor-integrations)
1. Make sure your tool is set to lint `.vue` files.

- CLI targets only `.js` files by default. You have to specify additional extensions with the `--ext` option or glob patterns. E.g. `eslint "src/**/*.{js,vue}"` or `eslint src --ext .vue`. If you use `@vue/cli-plugin-eslint` and the `vue-cli-service lint` command - you don't have to worry about it.
- If you are having issues with configuring editor, please read [editor integrations](#editor-integrations)

### Conflict with [Prettier]

Expand Down Expand Up @@ -384,8 +385,8 @@ See also [ESLint - Specifying Globals > Using configuration files](https://eslin
##### Using ESLint <= v7.x

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.
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 = {
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@
"@types/semver": "^7.2.0",
"@typescript-eslint/parser": "^5.0.0-0",
"@vuepress/plugin-pwa": "^1.4.1",
"acorn": "^8.5.0",
"env-cmd": "^10.1.0",
"eslint": "^7.0.0",
"eslint-config-prettier": "^6.11.0",
Expand All @@ -74,7 +75,7 @@
"eslint-plugin-prettier": "^3.1.3",
"eslint-plugin-vue": "file:.",
"eslint4b": "^7.0.0",
"espree": "^8.0.0",
"espree": "^9.0.0",
"lodash": "^4.17.15",
"mocha": "^7.1.2",
"nyc": "^15.0.1",
Expand Down
8 changes: 8 additions & 0 deletions tests/fixtures/script-indent/static-block-01.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<!--{}-->
<script>
class Foo {
static {
processFn()
}
}
</script>

0 comments on commit eaf6584

Please sign in to comment.