Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

button-has-type: support trivial ternary expressions #2748

Merged
merged 1 commit into from Aug 13, 2020

Conversation

@Hypnosphi
Copy link
Contributor

@Hypnosphi Hypnosphi commented Aug 8, 2020

This adds support for trivial ternary expressions to button-has-type rule:

<button type={condition ? 'button' : 'submit'} />

See #1555 (comment)

Copy link
Collaborator

@ljharb ljharb left a comment

Thanks, this is great - let's make sure that static strings work when double, single, or backtick-quoted.

tests/lib/rules/button-has-type.js Show resolved Hide resolved
@ljharb ljharb force-pushed the Hypnosphi:button-has-type-ternary branch from 6836793 to 877ae08 Aug 9, 2020
@ljharb
ljharb approved these changes Aug 9, 2020
Copy link
Collaborator

@ljharb ljharb left a comment

Thanks! I'm going to pull in a few more bugfixes and cut a patch release before landing this.

@ljharb ljharb force-pushed the Hypnosphi:button-has-type-ternary branch from 877ae08 to d8741de Aug 13, 2020
@ljharb ljharb added the enhancement label Aug 13, 2020
@ljharb ljharb merged commit d8741de into yannickcr:master Aug 13, 2020
2 checks passed
2 checks passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
coverage/coveralls Coverage increased (+0.006%) to 97.473%
Details
@Hypnosphi Hypnosphi deleted the Hypnosphi:button-has-type-ternary branch Aug 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.