Skip to content

Commit

Permalink
add vue
Browse files Browse the repository at this point in the history
  • Loading branch information
yourtion committed Dec 10, 2016
1 parent e752e2e commit 3f1efec
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 2 deletions.
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,28 @@ module.exports = {
};
```

### Vue

需要先安装 `eslint-plugin-html` 插件

```bash
$ npm install eslint-plugin-html --save-dev
```

然后在项目根目录下新建文件`.eslintrc.js`

```javascript
module.exports = {
extends: 'guo/vue',
};
```

使用 `--ext .vue` 添加对 vue 文件的检查:

```bash
$ eslint --ext .js,.vue src
```

### React

需要先安装 `eslint-plugin-react` 插件
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "eslint-config-guo",
"version": "0.1.0",
"description": "my own eslint config with ES6 ES7 Promise Mocha React React-Native",
"version": "0.2.0",
"description": "my own eslint config with ES6 ES7 Promise Mocha Vue React React-Native",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
Expand Down
29 changes: 29 additions & 0 deletions vue.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
const path = require('path');
module.exports = {
extends: path.resolve(__dirname, './index.js'),
parser: 'babel-eslint',
parserOptions: {
ecmaFeatures: {
experimentalObjectRestSpread: true,
jsx: true,
},
sourceType: 'module',
},
env: {
es6: true,
},
globals: {
document: false,
navigator: false,
window: false,
},
plugins: [
'html',
],
rules: {
// allow paren-less arrow functions
'arrow-parens': 0,
// allow async-await
'generator-star-spacing': 0,
},
};

0 comments on commit 3f1efec

Please sign in to comment.