@@ -45,8 +45,8 @@ ruleTester.run('attribute-hyphenation', rule, {
45
45
} ,
46
46
{
47
47
filename : 'test.vue' ,
48
- code : '<template><div data-id="foo" aria-test="bar" slot-scope="{ data }" custom-hypen ="foo"><a onClick="" my-prop="prop"></a></div ></template>' ,
49
- options : [ 'never' , { 'ignore' : [ 'custom-hypen ' ] } ]
48
+ code : '<template><custom data-id="foo" aria-test="bar" slot-scope="{ data }" custom-hyphen ="foo" second-custom="bar" ><a onClick="" my-prop="prop"></a></custom ></template>' ,
49
+ options : [ 'never' , { 'ignore' : [ 'custom-hyphen' , 'second-custom '] } ]
50
50
}
51
51
] ,
52
52
@@ -57,7 +57,7 @@ ruleTester.run('attribute-hyphenation', rule, {
57
57
output : '<template><div><custom myProp="foo"></custom></div></template>' ,
58
58
options : [ 'never' ] ,
59
59
errors : [ {
60
- message : "Attribute 'my-prop' cann 't be hyphenated." ,
60
+ message : "Attribute 'my-prop' can 't be hyphenated." ,
61
61
type : 'VIdentifier' ,
62
62
line : 1
63
63
} ]
@@ -79,7 +79,7 @@ ruleTester.run('attribute-hyphenation', rule, {
79
79
output : '<template><div><custom :myProp="prop"></custom></div></template>' ,
80
80
options : [ 'never' ] ,
81
81
errors : [ {
82
- message : "Attribute ':my-prop' cann 't be hyphenated." ,
82
+ message : "Attribute ':my-prop' can 't be hyphenated." ,
83
83
type : 'VDirectiveKey' ,
84
84
line : 1
85
85
} ]
@@ -101,7 +101,7 @@ ruleTester.run('attribute-hyphenation', rule, {
101
101
output : '<template><div><custom v-bind:myProp="prop"></custom></div></template>' ,
102
102
options : [ 'never' ] ,
103
103
errors : [ {
104
- message : "Attribute 'v-bind:my-prop' cann 't be hyphenated." ,
104
+ message : "Attribute 'v-bind:my-prop' can 't be hyphenated." ,
105
105
type : 'VDirectiveKey' ,
106
106
line : 1
107
107
} ]
@@ -116,6 +116,89 @@ ruleTester.run('attribute-hyphenation', rule, {
116
116
type : 'VDirectiveKey' ,
117
117
line : 1
118
118
} ]
119
+ } ,
120
+ {
121
+ filename : 'test.vue' ,
122
+ code : '<template><div><custom v-bind:MyProp="prop"></custom></div></template>' ,
123
+ output : '<template><div><custom v-bind:my-prop="prop"></custom></div></template>' ,
124
+ options : [ 'always' , { 'ignore' : [ ] } ] ,
125
+ errors : [ {
126
+ message : "Attribute 'v-bind:MyProp' must be hyphenated." ,
127
+ type : 'VDirectiveKey' ,
128
+ line : 1
129
+ } ]
130
+ } ,
131
+ {
132
+ filename : 'test.vue' ,
133
+ code : '<template><div><custom v-bind:my-prop="prop" :second-prop="test"></custom></div></template>' ,
134
+ output : '<template><div><custom v-bind:my-prop="prop" :secondProp="test"></custom></div></template>' ,
135
+ options : [ 'never' , { ignore : [ 'my-prop' ] } ] ,
136
+ errors : [ {
137
+ message : "Attribute ':second-prop' can't be hyphenated." ,
138
+ type : 'VDirectiveKey' ,
139
+ line : 1
140
+ } ]
141
+ } ,
142
+ {
143
+ filename : 'test.vue' ,
144
+ code : '<template><div><custom v-bind:myProp="prop" :secondProp="test"></custom></div></template>' ,
145
+ output : '<template><div><custom v-bind:my-prop="prop" :secondProp="test"></custom></div></template>' ,
146
+ options : [ 'always' , { ignore : [ 'secondProp' ] } ] ,
147
+ errors : [ {
148
+ message : "Attribute 'v-bind:myProp' must be hyphenated." ,
149
+ type : 'VDirectiveKey' ,
150
+ line : 1
151
+ } ]
152
+ } ,
153
+ {
154
+ filename : 'test.vue' ,
155
+ code : `
156
+ <template>
157
+ <custom data-id="foo" aria-test="bar" slot-scope="{ data }" custom-hyphen="foo" second-custom="baz" third-custom="bar">
158
+ <a onClick="" my-prop="prop"></a>
159
+ </custom>
160
+ </template>
161
+ ` ,
162
+ output : `
163
+ <template>
164
+ <custom data-id="foo" aria-test="bar" slot-scope="{ data }" custom-hyphen="foo" second-custom="baz" thirdCustom="bar">
165
+ <a onClick="" my-prop="prop"></a>
166
+ </custom>
167
+ </template>
168
+ ` ,
169
+ options : [ 'never' , { 'ignore' : [ 'custom-hyphen' , 'second-custom' ] } ] ,
170
+ errors : [ {
171
+ message : "Attribute 'third-custom' can't be hyphenated." ,
172
+ type : 'VIdentifier' ,
173
+ line : 3
174
+ } ]
175
+ } ,
176
+ {
177
+ filename : 'test.vue' ,
178
+ code : `
179
+ <template>
180
+ <custom data-id="foo" aria-test="bar" slot-scope="{ data }" custom-hyphen="foo" second-custom="baz" thirdCustom="bar">
181
+ <a onClick="" my-prop="prop"></a>
182
+ </custom>
183
+ </template>
184
+ ` ,
185
+ output : `
186
+ <template>
187
+ <custom data-id="foo" aria-test="bar" slot-scope="{ data }" customHyphen="foo" secondCustom="baz" thirdCustom="bar">
188
+ <a onClick="" my-prop="prop"></a>
189
+ </custom>
190
+ </template>
191
+ ` ,
192
+ options : [ 'never' ] ,
193
+ errors : [ {
194
+ message : "Attribute 'custom-hyphen' can't be hyphenated." ,
195
+ type : 'VIdentifier' ,
196
+ line : 3
197
+ } , {
198
+ message : "Attribute 'second-custom' can't be hyphenated." ,
199
+ type : 'VIdentifier' ,
200
+ line : 3
201
+ } ]
119
202
}
120
203
]
121
204
} )
0 commit comments