The official [eslint-plugin-vue](https://github.com/vuejs/eslint-plugin-vue) supports linting both the template and script parts of Vue single file components.
Make sure to use the plugin's included config in your ESLint config:
请确认在你的 ESLint 配置文件中使用该插件要导入的配置:
``` js
// .eslintrc.js
...
...
@@ -13,24 +13,24 @@ module.exports = {
}
```
Then from the command line:
接下来从命令行运行:
``` bash
eslint --ext js,vue MyComponent.vue
```
Another option is using [eslint-loader](https://github.com/MoOx/eslint-loader) so that your `*.vue` files are automatically linted on save during development: