Skip to content

Commit dab8d29

Browse files
author
maran
committed
fixbug for node
1 parent 40f0129 commit dab8d29

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ If you already use other parser (e.g. `"parser": "babel-eslint"`), please move i
115115

116116
### eslint-disable functionality in `<template>` ?
117117

118-
1. Make sure you have used [eslint-plugin-vue](https://github.com/vuejs/eslint-plugin-vue) and you can use <!-- eslint-disable-line -->-like HTML comments in <template> of .vue files. For example:
118+
1. Make sure you have used [eslint-plugin-vue](https://github.com/vuejs/eslint-plugin-vue) and you can use <!-- eslint-disable-line --> like HTML comments in <template> of .vue files. For example:
119119

120120
```html
121121
<template>

lib/rules/anchor-has-content.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,15 @@ module.exports = {
1818
},
1919
create (context) {
2020
return VueUtils.defineTemplateBodyVisitor(context, {
21-
"VElement" (node) {
21+
"VStartTag" (node) {
2222
const options = context.options[0] || {};
2323
const componentOptions = options.components || [];
2424
const typeCheck = ['a'].concat(componentOptions);
25-
const nodeType = utils.getElementType(node);
25+
const parent = node.parent;
26+
const nodeType = utils.getElementType(parent);
2627
if (typeCheck.indexOf(nodeType) === -1) {
2728
return;
28-
} else if (utils.hasAccessibleChild(node)) {
29+
} else if (utils.hasAccessibleChild(parent)) {
2930
return;
3031
}
3132

0 commit comments

Comments
 (0)