Skip to content

Commit

Permalink
Use raw values instead & fix rule
Browse files Browse the repository at this point in the history
  • Loading branch information
armano2 committed Aug 2, 2017
1 parent f19dd91 commit 790099f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion lib/rules/attribute-hyphenation.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ function create (context) {
VAttribute (node) {
if (!utils.isCustomComponent(node.parent.parent)) return

const name = !node.directive ? node.key.name : node.key.name === 'bind' ? node.key.argument : false
const name = !node.directive ? node.key.rawName : node.key.name === 'bind' ? node.key.raw.argument : false
if (!name || isIgnoredAttribute(name)) return

reportIssue(node, name)
Expand Down
8 changes: 4 additions & 4 deletions tests/lib/rules/attribute-hyphenation.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ ruleTester.run('attribute-hyphenation', rule, {
invalid: [
{
filename: 'test.vue',
code: '<template><div><custom my-prop="prop"></custom></div></template>',
output: '<template><div><custom myProp="prop"></custom></div></template>',
code: '<template><div><custom my-prop="foo"></custom></div></template>',
output: '<template><div><custom myProp="foo"></custom></div></template>',
options: ['never'],
errors: [{
message: "Attribute 'my-prop' cann't be hyphenated.",
Expand All @@ -59,8 +59,8 @@ ruleTester.run('attribute-hyphenation', rule, {
},
{
filename: 'test.vue',
code: '<template><div><custom MyProp="prop"></custom></div></template>',
output: '<template><div><custom my-prop="prop"></custom></div></template>',
code: '<template><div><custom MyProp="Bar"></custom></div></template>',
output: '<template><div><custom my-prop="Bar"></custom></div></template>',
options: ['always'],
errors: [{
message: "Attribute 'MyProp' must be hyphenated.",
Expand Down

0 comments on commit 790099f

Please sign in to comment.