Closed Bug 1513601 Opened 6 years ago Closed 6 years ago

Fix/enable ESLint 'react/button-has-type'

Categories

(Tree Management :: Treeherder: Frontend, defect, P2)

defect

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: emorley, Assigned: camd)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

"The default value of type attribute for button HTML element is "submit" which is often not the desired behavior and may lead to unexpected page reloads. This rules enforces an explicit type attribute for all the button elements and checks that its value is valid per spec (i.e., is one of "button", "submit", and "reset")." https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/button-has-type.md Example failure shown by `yarn lint` after removing the rule-disabling from .eslintrc.js: error: Missing an explicit type attribute for button (react/button-has-type) at ui\job-view\details\PinBoard.jsx:562:15: 560 | > 561 | <div className="btn-group save-btn-group dropdown"> > 562 | <button | ^
Commit pushed to master at https://github.com/mozilla/treeherder https://github.com/mozilla/treeherder/commit/6eeff4bafe3f87829304d36926ff4ddfd943235c Bug 1513601 - Fix/enable ESLint 'react/button-has-type' (#4377) Also make tests less brittle
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Assignee: nobody → cdawson
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: