You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+13-5Lines changed: 13 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,6 +15,8 @@ You can try this plugin on the Web.
15
15
## :grey_exclamation: Requirements
16
16
17
17
-[ESLint](http://eslint.org/)`>=3.18.0`.
18
+
-`>=4.7.0` to use `eslint --fix`.
19
+
-`>=4.14.0` to use with `babel-eslint`.
18
20
- Node.js `>=4.0.0`
19
21
20
22
## :cd: Installation
@@ -235,14 +237,20 @@ If you already use other parser (e.g. `"parser": "babel-eslint"`), please move i
235
237
236
238
The `vue-eslint-parser` uses the parser which is set by `parserOptions.parser` to parse scripts.
237
239
238
-
### Can my javascript code have increased indentation?
240
+
### Why doesn't it work on .vue file?
239
241
240
-
It depends on the version of eslint you're using.
242
+
1. Make sure you don't have `eslint-plugin-html` in your config. The `eslint-plugin-html` extracts the content from `<script>` tags, but `eslint-vue-plugin` requires `<script>` tags and `<template>` tags in order to distinguish template and script in single file components.
241
243
242
-
[indent](https://eslint.org/docs/rules/indent) rule in `eslint@3.x` makes it possible, but if you use `eslint@4.x` be aware that this rule has been rewritten and is more strict now, thus it doesn't allow to have increased initial indentation.
244
+
```diff
245
+
"plugins": [
246
+
"vue",
247
+
- "html"
248
+
]
249
+
```
243
250
244
-
You can however use [indent-legacy](https://eslint.org/docs/rules/indent-legacy) rule instead.
245
-
More informations [here](https://eslint.org/docs/user-guide/migrating-to-4.0.0#indent-rewrite).
251
+
2. Make sure your tool is set to lint `.vue` files.
252
+
- CLI targets only `.js` files by default. You have to specify additional extensions by `--ext` option or glob patterns. E.g. `eslint "src/**/*.{js,vue}"` or `eslint src --ext .vue`.
253
+
- VSCode targets only JavaScript or HTML files by default. You have to add `{"autoFix": true, "language": "vue"}` into `eslint.validate` entry.
0 commit comments