Skip to content

Commit

Permalink
[Tests] button-has-type: ensure no mistakenly allowed identifiers n…
Browse files Browse the repository at this point in the history
…amed `button`/`submit`/`reset`

See #1846 (comment)
  • Loading branch information
ljharb committed Apr 16, 2020
1 parent aecff62 commit 3385caa
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tests/lib/rules/button-has-type.js
Expand Up @@ -118,6 +118,12 @@ ruleTester.run('button-has-type', rule, {
pragma: 'Foo'
}
}
},
{
code: 'function Button({ type, ...extraProps }) { const button = type; return <button type={button} {...extraProps} />; }',
errors: [{
message: 'The button type attribute must be specified by a static string'
}]
}
]
});

0 comments on commit 3385caa

Please sign in to comment.