Skip to content

Commit 550e07b

Browse files
committed
Change legacy base config so that vue-eslint-parser is only used for .vue
1 parent 45f10de commit 550e07b

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

docs/user-guide/index.md

+3-4
Original file line numberDiff line numberDiff line change
@@ -154,13 +154,12 @@ If you have issues with these, please also refer to the [FAQ](#does-not-work-wel
154154

155155
### Running ESLint from the command line
156156

157-
If you want to run `eslint` from the command line, make sure you include the `.vue` extension using [the `--ext` option](https://eslint.org/docs/user-guide/configuring#specifying-target-files-to-lint) or a glob pattern, because ESLint targets only `.js` files by default.
157+
If you want to run `eslint` from the command line, ESLint will automatically check for the `.vue` extension if you use the config provided by the plugin.
158158

159159
Examples:
160160

161161
```bash
162-
eslint --ext .js,.vue src
163-
eslint "src/**/*.{js,vue}"
162+
eslint src
164163
```
165164

166165
::: tip
@@ -393,7 +392,7 @@ See also: "[How to use a custom parser?](#how-to-use-a-custom-parser)" section.
393392

394393
1. Make sure your tool is set to lint `.vue` files.
395394

396-
- 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.
395+
- Make sure you are using the shareable config provided by `eslint-plugin-vue`.
397396
- If you are having issues with configuring editor, please read [editor integrations](#editor-integrations)
398397

399398
### Conflict with [Prettier]

lib/configs/base.js

+7-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
* in order to update its content execute "npm run update"
55
*/
66
module.exports = {
7-
parser: require.resolve('vue-eslint-parser'),
87
parserOptions: {
98
ecmaVersion: 2020,
109
sourceType: 'module'
@@ -17,5 +16,11 @@ module.exports = {
1716
rules: {
1817
'vue/comment-directive': 'error',
1918
'vue/jsx-uses-vars': 'error'
20-
}
19+
},
20+
overrides: [
21+
{
22+
files: '*.vue',
23+
parser: require.resolve('vue-eslint-parser')
24+
}
25+
]
2126
}

0 commit comments

Comments
 (0)