Skip to content

Commit 8ecc53f

Browse files
committed
button-has-type: fix for node 4
1 parent 4f2ef17 commit 8ecc53f

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

lib/rules/button-has-type.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,16 +71,17 @@ module.exports = {
7171
});
7272
}
7373

74-
function checkValue(node, value, quote = x => `"${x}"`) {
74+
function checkValue(node, value, quoteFn) {
75+
const q = quoteFn || (x => `"${x}"`);
7576
if (!(value in configuration)) {
7677
context.report({
7778
node: node,
78-
message: `${quote(value)} is an invalid value for button type attribute`
79+
message: `${q(value)} is an invalid value for button type attribute`
7980
});
8081
} else if (!configuration[value]) {
8182
context.report({
8283
node: node,
83-
message: `${quote(value)} is a forbidden value for button type attribute`
84+
message: `${q(value)} is a forbidden value for button type attribute`
8485
});
8586
}
8687
}

0 commit comments

Comments
 (0)