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

Docs: update README.md #393

merged 2 commits into from
Feb 24, 2018

Conversation

mysticatea
Copy link
Member

This adds two things and removes one thing:

  1. Clarifies the requirements for eslint --fix and babel-eslint.
  2. Adds an FAQ entry for eslint-plugin-html.
  3. Removes an FAQ entry for indentation since we have vue/script-indent.

README.md Outdated
@@ -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 don't work on `.vue` file?
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps this sounds a bit more natural:
Why doesn't it work on .vue file?

README.md Outdated

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` extract the inside of `<script>` tags from the source code, but `eslint-vue-plugin` requires `<script>` tags and `<template>` tags in order to find script and template.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. extracts the content from <script> tags, but ...
  2. in order to distinguish template and script in single file components

README.md Outdated

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 does linting for `.vue` files.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps: Make sure your tool is set to lint .vue files.

README.md Outdated
More informations [here](https://eslint.org/docs/user-guide/migrating-to-4.0.0#indent-rewrite).
2. Make sure your tool does linting for `.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.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

autoFix is not necessary I guess :)
It's enought to just add another language to array, like so:

"eslint.validate": [
        "javascript",
        "javascriptreact",
        "vue",
        "vue-html"
    ],

Copy link
Member Author

@mysticatea mysticatea Feb 23, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's necessary because vscode-eslint does not fix code on additional file types by default. (microsoft/vscode-eslint#185)

@mysticatea
Copy link
Member Author

Thank you for the correction! I updated this PR.

@michalsnik michalsnik merged commit 0db4f93 into master Feb 24, 2018
@michalsnik michalsnik deleted the update-readme branch February 24, 2018 04:33
michalsnik pushed a commit that referenced this pull request Feb 24, 2018
* Docs: update README.md

* fix grammer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants