Skip to content

Commit

Permalink
button-has-type: fix for node 4
Browse files Browse the repository at this point in the history
  • Loading branch information
ljharb committed Jul 3, 2018
1 parent 4f2ef17 commit 8ecc53f
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lib/rules/button-has-type.js
Expand Up @@ -71,16 +71,17 @@ module.exports = {
});
}

function checkValue(node, value, quote = x => `"${x}"`) {
function checkValue(node, value, quoteFn) {
const q = quoteFn || (x => `"${x}"`);
if (!(value in configuration)) {
context.report({
node: node,
message: `${quote(value)} is an invalid value for button type attribute`
message: `${q(value)} is an invalid value for button type attribute`
});
} else if (!configuration[value]) {
context.report({
node: node,
message: `${quote(value)} is a forbidden value for button type attribute`
message: `${q(value)} is a forbidden value for button type attribute`
});
}
}
Expand Down

0 comments on commit 8ecc53f

Please sign in to comment.