Skip to content

Docs: update README.md #393

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 24, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 13 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ You can try this plugin on the Web.
## :grey_exclamation: Requirements

- [ESLint](http://eslint.org/) `>=3.18.0`.
- `>=4.7.0` to use `eslint --fix`.
- `>=4.14.0` to use with `babel-eslint`.
- Node.js `>=4.0.0`

## :cd: Installation
Expand Down Expand Up @@ -234,14 +236,20 @@ If you already use other parser (e.g. `"parser": "babel-eslint"`), please move i

The `vue-eslint-parser` uses the parser which is set by `parserOptions.parser` to parse scripts.

### Can my javascript code have increased indentation?
### Why doesn't it work on .vue file?

It depends on the version of eslint you're using.
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.

[indent](https://eslint.org/docs/rules/indent) rule in `[email protected]` makes it possible, but if you use `[email protected]` be aware that this rule has been rewritten and is more strict now, thus it doesn't allow to have increased initial indentation.
```diff
"plugins": [
"vue",
- "html"
]
```

You can however use [indent-legacy](https://eslint.org/docs/rules/indent-legacy) rule instead.
More informations [here](https://eslint.org/docs/user-guide/migrating-to-4.0.0#indent-rewrite).
2. Make sure your tool is set to lint `.vue` files.
- 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`.
- VSCode targets only JavaScript or HTML files by default. You have to add `{"autoFix": true, "language": "vue"}` into `eslint.validate` entry.

## :anchor: Semantic Versioning Policy

Expand Down