Skip to content

Commit 0c2b077

Browse files
committed
attribute-hyphenation: Fix spelling mistakes
- hypen -> hyphen - cann't -> can't
1 parent 66f64c9 commit 0c2b077

File tree

2 files changed

+14
-14
lines changed

2 files changed

+14
-14
lines changed

lib/rules/attribute-hyphenation.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ module.exports = {
6363
context.report({
6464
node: node.key,
6565
loc: node.loc,
66-
message: useHyphenated ? "Attribute '{{text}}' must be hyphenated." : "Attribute '{{text}}' cann't be hyphenated.",
66+
message: useHyphenated ? "Attribute '{{text}}' must be hyphenated." : "Attribute '{{text}}' can't be hyphenated.",
6767
data: {
6868
text
6969
},

tests/lib/rules/attribute-hyphenation.js

+13-13
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ ruleTester.run('attribute-hyphenation', rule, {
4545
},
4646
{
4747
filename: 'test.vue',
48-
code: '<template><custom data-id="foo" aria-test="bar" slot-scope="{ data }" custom-hypen="foo" second-custom="bar"><a onClick="" my-prop="prop"></a></custom></template>',
49-
options: ['never', { 'ignore': ['custom-hypen', 'second-custom'] }]
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'] }]
5050
}
5151
],
5252

@@ -57,7 +57,7 @@ ruleTester.run('attribute-hyphenation', rule, {
5757
output: '<template><div><custom myProp="foo"></custom></div></template>',
5858
options: ['never'],
5959
errors: [{
60-
message: "Attribute 'my-prop' cann't be hyphenated.",
60+
message: "Attribute 'my-prop' can't be hyphenated.",
6161
type: 'VIdentifier',
6262
line: 1
6363
}]
@@ -79,7 +79,7 @@ ruleTester.run('attribute-hyphenation', rule, {
7979
output: '<template><div><custom :myProp="prop"></custom></div></template>',
8080
options: ['never'],
8181
errors: [{
82-
message: "Attribute ':my-prop' cann't be hyphenated.",
82+
message: "Attribute ':my-prop' can't be hyphenated.",
8383
type: 'VDirectiveKey',
8484
line: 1
8585
}]
@@ -101,7 +101,7 @@ ruleTester.run('attribute-hyphenation', rule, {
101101
output: '<template><div><custom v-bind:myProp="prop"></custom></div></template>',
102102
options: ['never'],
103103
errors: [{
104-
message: "Attribute 'v-bind:my-prop' cann't be hyphenated.",
104+
message: "Attribute 'v-bind:my-prop' can't be hyphenated.",
105105
type: 'VDirectiveKey',
106106
line: 1
107107
}]
@@ -130,25 +130,25 @@ ruleTester.run('attribute-hyphenation', rule, {
130130
},
131131
{
132132
filename: 'test.vue',
133-
code: '<template><custom data-id="foo" aria-test="bar" slot-scope="{ data }" custom-hypen="foo" third-custom="bar"><a onClick="" my-prop="prop"></a></custom></template>',
134-
output: '<template><custom data-id="foo" aria-test="bar" slot-scope="{ data }" custom-hypen="foo" thirdCustom="bar"><a onClick="" my-prop="prop"></a></custom></template>',
135-
options: ['never', { 'ignore': ['custom-hypen', 'second-custom'] }],
133+
code: '<template><custom data-id="foo" aria-test="bar" slot-scope="{ data }" custom-hyphen="foo" third-custom="bar"><a onClick="" my-prop="prop"></a></custom></template>',
134+
output: '<template><custom data-id="foo" aria-test="bar" slot-scope="{ data }" custom-hyphen="foo" thirdCustom="bar"><a onClick="" my-prop="prop"></a></custom></template>',
135+
options: ['never', { 'ignore': ['custom-hyphen', 'second-custom'] }],
136136
errors: [{
137-
message: "Attribute 'third-custom' cann't be hyphenated.",
137+
message: "Attribute 'third-custom' can't be hyphenated.",
138138
type: 'VDirectiveKey',
139139
line: 1
140140
}]
141141
},
142142
{
143-
// This is the same code as the `'ignore': ['custom-hypen']`
143+
// This is the same code as the `'ignore': ['custom-hyphen']`
144144
// valid test; to verify that setting ignore actually makes the
145145
// difference.
146146
filename: 'test.vue',
147-
code: '<template><custom data-id="foo" aria-test="bar" slot-scope="{ data }" custom-hypen="foo"><a onClick="" my-prop="prop"></a></custom></template>',
148-
output: '<template><custom data-id="foo" aria-test="bar" slot-scope="{ data }" customHypen="foo"><a onClick="" my-prop="prop"></a></custom></template>',
147+
code: '<template><custom data-id="foo" aria-test="bar" slot-scope="{ data }" custom-hyphen="foo"><a onClick="" my-prop="prop"></a></custom></template>',
148+
output: '<template><custom data-id="foo" aria-test="bar" slot-scope="{ data }" customHyphen="foo"><a onClick="" my-prop="prop"></a></custom></template>',
149149
options: ['never'],
150150
errors: [{
151-
message: "Attribute 'custom-hypen' cann't be hyphenated.",
151+
message: "Attribute 'custom-hyphen' can't be hyphenated.",
152152
type: 'VIdentifier',
153153
line: 1
154154
}]

0 commit comments

Comments
 (0)