Skip to content

Commit

Permalink
templates
Browse files Browse the repository at this point in the history
  • Loading branch information
yeonjuan committed Nov 30, 2024
1 parent ebf5549 commit db4d1dd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/eslint-plugin/lib/rules/require-button-type.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,10 @@ module.exports = {
node: node.openStart,
messageId: MESSAGE_IDS.MISSING,
});
} else if (!VALID_BUTTON_TYPES_SET.has(typeAttr.value.value)) {
} else if (
!VALID_BUTTON_TYPES_SET.has(typeAttr.value.value) &&
!typeAttr.value.templates.length
) {
context.report({
node: typeAttr,
messageId: MESSAGE_IDS.INVALID,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ templateRuleTester.run("[template] require-button-type", rule, {
{
code: 'html`<button type="submit">Submit Button</button>`',
},
{
code: 'html`<button type="${type}">Submit Button</button>`',
},
],
invalid: [
{
Expand Down

0 comments on commit db4d1dd

Please sign in to comment.