@@ -14,7 +14,7 @@ const casing = require('../utils/casing')
14
14
module . exports = {
15
15
meta : {
16
16
docs : {
17
- description : 'enforce attribute naming style in template' ,
17
+ description : 'enforce attribute naming style on custom components in template' ,
18
18
category : 'strongly-recommended' ,
19
19
url : 'https://github.com/vuejs/eslint-plugin-vue/blob/v4.4.0/docs/rules/attribute-hyphenation.md'
20
20
} ,
@@ -49,12 +49,10 @@ module.exports = {
49
49
const option = context . options [ 0 ]
50
50
const optionsPayload = context . options [ 1 ]
51
51
const useHyphenated = option !== 'never'
52
- let ignoredAttributes = [ ]
52
+ const ignoredAttributes = [ 'data-' , 'aria-' , 'slot-scope' ]
53
53
54
54
if ( optionsPayload && optionsPayload . ignore ) {
55
- ignoredAttributes = optionsPayload . ignore
56
- } else {
57
- ignoredAttributes = [ 'data-' , 'aria-' , 'slot-scope' ]
55
+ ignoredAttributes . push ( optionsPayload . ignore )
58
56
}
59
57
60
58
const caseConverter = casing . getConverter ( useHyphenated ? 'kebab-case' : 'camelCase' )
@@ -74,8 +72,8 @@ module.exports = {
74
72
}
75
73
76
74
function isIgnoredAttribute ( value ) {
77
- const isIgnored = ! ignoredAttributes . every ( function ( attr ) {
78
- return value . indexOf ( attr ) = == - 1
75
+ const isIgnored = ignoredAttributes . some ( function ( attr ) {
76
+ return value . indexOf ( attr ) ! == - 1
79
77
} )
80
78
81
79
if ( isIgnored ) {
0 commit comments