|
1 | 1 | # vue-eslint-parser
|
2 |
| -An experiment for the ESLint custom parser of `.vue` file. |
| 2 | + |
| 3 | +[](https://www.npmjs.com/package/vue-eslint-parser) |
| 4 | +[](http://www.npmtrends.com/vue-eslint-parser) |
| 5 | +[](https://travis-ci.org/mysticatea/vue-eslint-parser) |
| 6 | +[](https://codecov.io/gh/mysticatea/vue-eslint-parser) |
| 7 | +[](https://david-dm.org/mysticatea/vue-eslint-parser) |
| 8 | + |
| 9 | +The ESLint custom parser of `.vue` file. |
| 10 | + |
| 11 | +ESLint supports autofix on custom parsers but does not support autofix on plugins which have processors ([eslint/eslint#7510](https://github.com/eslint/eslint/issues/7510)). The motivation of this custom parser is that it supports autofix on `.vue` files. |
| 12 | + |
| 13 | +## :cd: Installation |
| 14 | + |
| 15 | +```bash |
| 16 | +$ npm install --save-dev eslint vue-eslint-parser |
| 17 | +``` |
| 18 | + |
| 19 | +- `vue-eslint-parser` requires ESLint 3.5.0 or later. |
| 20 | + |
| 21 | +## :book: Usage |
| 22 | + |
| 23 | +1. Write `parser` option in your `.eslintrc.*` file. |
| 24 | +2. Use glob patterns or `--ext .vue` CLI option. |
| 25 | + |
| 26 | +```json |
| 27 | +{ |
| 28 | + "extends": "eslint:recommended", |
| 29 | + "parser": "vue-eslint-parser" |
| 30 | +} |
| 31 | +``` |
| 32 | + |
| 33 | +```bash |
| 34 | +$ eslint "src/**.{js,vue}" |
| 35 | +# or |
| 36 | +$ eslint src --ext .vue |
| 37 | +``` |
| 38 | + |
| 39 | +## :newspaper: Changelog |
| 40 | + |
| 41 | +- [GitHub Releases](https://github.com/mysticatea/vue-eslint-parser/releases) |
| 42 | + |
| 43 | +## :muscle: Contributing |
| 44 | + |
| 45 | +Welcome contributing! |
| 46 | + |
| 47 | +Please use GitHub's Issues/PRs. |
| 48 | + |
| 49 | +### Development Tools |
| 50 | + |
| 51 | +- `npm test` runs tests and measures coverage. |
| 52 | +- `npm run coverage` shows the coverage result of `npm test` command with the default browser. |
| 53 | +- `npm run clean` removes the coverage result of `npm test` command. |
| 54 | +- `npm run lint` runs ESLint. |
| 55 | +- `npm run watch` runs tests with `--watch` option. |
0 commit comments