Skip to content

Commit 560c0fd

Browse files
committed
eslint-config-vue检查.vue中的template模板
1 parent e795975 commit 560c0fd

File tree

3 files changed

+20
-18
lines changed

3 files changed

+20
-18
lines changed

.eslintrc.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
module.exports = {
2-
parser: 'babel-eslint',
2+
// parser: 'babel-eslint',
33
env: {
44
browser: true,
55
commonjs: true,
66
es6: true
77
},
8-
extends: 'airbnb-base',
9-
plugins: [
10-
'html'
11-
],
8+
// extends: ['airbnb-base'],
9+
extends: ['plugin:vue/recommended', 'airbnb-base'],
10+
// plugins: [
11+
// 'vue'
12+
// ],
1213
rules: {
1314
quotes: [2, 'single'],
1415
semi: 2,

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,11 @@
2727
"clean-webpack-plugin": "^0.1.16",
2828
"css-loader": "^0.28.5",
2929
"element-ui": "^1.4.3",
30-
"eslint": "^4.5.0",
30+
"eslint": "^3.19.0",
3131
"eslint-config-airbnb-base": "^11.3.2",
3232
"eslint-plugin-html": "^3.2.0",
3333
"eslint-plugin-import": "^2.7.0",
34+
"eslint-plugin-vue": "^3.12.0",
3435
"extract-text-webpack-plugin": "^3.0.0",
3536
"file-loader": "^0.11.2",
3637
"html-webpack-plugin": "^2.30.1",

src/components/layout.vue

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,18 @@
1414
</template>
1515

1616
<script>
17-
export default {
18-
name: 'layout',
19-
data() {
20-
return {
21-
activeIndex: '1',
22-
activeIndex2: '1'
23-
};
24-
},
25-
methods: {
26-
handleSelect(key, keyPath) {
27-
console.log(key, keyPath);
28-
}
17+
export default {
18+
name: 'layout',
19+
data() {
20+
return {
21+
activeIndex: '1',
22+
activeIndex2: '1'
23+
};
24+
},
25+
methods: {
26+
handleSelect(key, keyPath) {
27+
console.log(key, keyPath);
2928
}
3029
}
30+
};
3131
</script>

0 commit comments

Comments
 (0)