Skip to content

Commit

Permalink
#290 ESLint: Fix react/button-has-type error
Browse files Browse the repository at this point in the history
  • Loading branch information
zaki-yama committed Mar 20, 2019
1 parent 643ea60 commit d9e0fbf
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ module.exports = {
'react/destructuring-assignment': 0,
'react/no-find-dom-node': 1,
'react/no-array-index-key': 2,
'react/button-has-type': 1,
'react/button-has-type': 2,
'jsx-a11y/click-events-have-key-events': 1,
'jsx-a11y/no-noninteractive-tabindex': 1,
'jsx-a11y/role-has-required-aria-props': 1,
Expand Down
1 change: 1 addition & 0 deletions src/scripts/Button.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ export default class Button extends Component {
delete props.items;

return (
// eslint-disable-next-line react/button-has-type
<button
ref={(node) => {
this.node = node;
Expand Down
4 changes: 2 additions & 2 deletions src/scripts/DropdownButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,11 +142,11 @@ export default class DropdownButton extends Component {
return (
<div className='slds-button-group'>
{isFirstInGroup ? null : (
<button className='slds-button' style={noneStyle} />
<button type='button' className='slds-button' style={noneStyle} />
)}
{button}
{isLastInGroup ? null : (
<button className='slds-button' style={noneStyle} />
<button type='button' className='slds-button' style={noneStyle} />
)}
</div>
);
Expand Down
7 changes: 7 additions & 0 deletions test/storyshots/__snapshots__/storyshots.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -1667,6 +1667,7 @@ exports[`Storyshots ButtonGroup Inverse 1`] = `
"display": "none",
}
}
type="button"
/>
<button
aria-haspopup={true}
Expand Down Expand Up @@ -1800,6 +1801,7 @@ exports[`Storyshots ButtonGroup More 1`] = `
"display": "none",
}
}
type="button"
/>
<button
aria-haspopup={true}
Expand Down Expand Up @@ -36646,6 +36648,7 @@ exports[`Storyshots PageHeader Object Home 1`] = `
"display": "none",
}
}
type="button"
/>
<button
aria-haspopup={true}
Expand Down Expand Up @@ -36713,6 +36716,7 @@ exports[`Storyshots PageHeader Object Home 1`] = `
"display": "none",
}
}
type="button"
/>
<button
aria-haspopup={true}
Expand Down Expand Up @@ -36928,6 +36932,7 @@ exports[`Storyshots PageHeader Record Home 1`] = `
"display": "none",
}
}
type="button"
/>
<button
aria-haspopup={true}
Expand Down Expand Up @@ -37256,6 +37261,7 @@ exports[`Storyshots PageHeader Related List 1`] = `
"display": "none",
}
}
type="button"
/>
<button
aria-haspopup={true}
Expand Down Expand Up @@ -37323,6 +37329,7 @@ exports[`Storyshots PageHeader Related List 1`] = `
"display": "none",
}
}
type="button"
/>
<button
aria-haspopup={true}
Expand Down

0 comments on commit d9e0fbf

Please sign in to comment.