Skip to content

Commit f435df9

Browse files
y-hsgwljharb
authored andcommitted
[Tests] button-has-type: add test case with spread
1 parent 0a8092f commit f435df9

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ This change log adheres to standards from [Keep a CHANGELOG](https://keepachange
1919
* [Tests] add @typescript-eslint/parser v7 and v8 ([#3629][] @hampustagerud)
2020
* [Docs] [`no-danger`]: update broken link ([#3817][] @lucasrmendonca)
2121
* [types] add jsdoc type annotations ([#3731][] @y-hsgw)
22+
* [Tests] `button-has-type`: add test case with spread ([#3731][] @y-hsgw)
2223

2324
[#3632]: https://github.com/jsx-eslint/eslint-plugin-react/issues/3632
2425

tests/lib/rules/button-has-type.js

+6
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,12 @@ ruleTester.run('button-has-type', rule, {
304304
},
305305
],
306306
},
307+
{
308+
code: 'React.createElement("button", {...extraProps})',
309+
errors: [
310+
{ messageId: 'missingType' },
311+
],
312+
},
307313
{
308314
code: 'Foo.createElement("button")',
309315
errors: [

0 commit comments

Comments
 (0)