From fcbe2ae045368eb88f4f2a8bdee1207a68a5bf28 Mon Sep 17 00:00:00 2001 From: yosuke ota Date: Mon, 13 Sep 2021 13:19:26 +0900 Subject: [PATCH] Add tests with espree v9 --- docs/user-guide/README.md | 11 ++++++----- package.json | 3 ++- tests/fixtures/script-indent/static-block-01.vue | 8 ++++++++ 3 files changed, 16 insertions(+), 6 deletions(-) create mode 100644 tests/fixtures/script-indent/static-block-01.vue diff --git a/docs/user-guide/README.md b/docs/user-guide/README.md index 39e44d9ab..1a62fbf71 100644 --- a/docs/user-guide/README.md +++ b/docs/user-guide/README.md @@ -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] @@ -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 = { diff --git a/package.json b/package.json index 7076d867e..59855a324 100644 --- a/package.json +++ b/package.json @@ -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", @@ -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", diff --git a/tests/fixtures/script-indent/static-block-01.vue b/tests/fixtures/script-indent/static-block-01.vue new file mode 100644 index 000000000..87bfc6b34 --- /dev/null +++ b/tests/fixtures/script-indent/static-block-01.vue @@ -0,0 +1,8 @@ + +