Skip to content

New rule: prefer-tag-over-role#833

Merged
jessebeach merged 1 commit intojsx-eslint:mainfrom
JoshuaKGoldberg:prefer-tag-over-role
Aug 7, 2022
Merged

New rule: prefer-tag-over-role#833
jessebeach merged 1 commit intojsx-eslint:mainfrom
JoshuaKGoldberg:prefer-tag-over-role

Conversation

@JoshuaKGoldberg
Copy link
Copy Markdown
Contributor

Fixes #101

Comment thread package.json Outdated
@codecov
Copy link
Copy Markdown

codecov Bot commented Feb 24, 2022

Codecov Report

Merging #833 (f86326f) into main (7f6463e) will increase coverage by 0.01%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main     #833      +/-   ##
==========================================
+ Coverage   99.27%   99.29%   +0.01%     
==========================================
  Files         100      101       +1     
  Lines        1520     1553      +33     
  Branches      500      510      +10     
==========================================
+ Hits         1509     1542      +33     
  Misses         11       11              
Impacted Files Coverage Δ
src/rules/prefer-tag-over-role.js 100.00% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us.

Copy link
Copy Markdown
Member

@ljharb ljharb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems pretty straightforward

Comment thread __tests__/src/rules/prefer-tag-over-role-test.js Outdated
@ljharb ljharb requested a review from jessebeach February 24, 2022 19:10
Copy link
Copy Markdown
Collaborator

@jessebeach jessebeach left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a good rule. Thank you for proposing it. I just have a few improvements that will use our utilities and provide more robustness.

Comment thread src/rules/prefer-tag-over-role.js Outdated
Comment thread src/rules/prefer-tag-over-role.js Outdated
Comment thread src/rules/prefer-tag-over-role.js Outdated
Comment thread src/rules/prefer-tag-over-role.js Outdated
Comment thread src/rules/prefer-tag-over-role.js Outdated
Copy link
Copy Markdown
Collaborator

@jessebeach jessebeach left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is really close!! Just a few polishing tweaks to get it over the line! I think we'll be able to commit it after these few changes.

Comment thread src/rules/prefer-tag-over-role.js Outdated
Comment thread src/rules/prefer-tag-over-role.js Outdated
Comment thread __tests__/src/rules/prefer-tag-over-role-test.js Outdated
Comment thread __tests__/src/rules/prefer-tag-over-role-test.js Outdated
Copy link
Copy Markdown
Collaborator

@jessebeach jessebeach left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the updates!

@ljharb looks good to ship!

@jessebeach
Copy link
Copy Markdown
Collaborator

There's still a little work to expose the rule through the plugin, but this is good enough to get the rule logic into the code.

@jessebeach jessebeach merged commit 7ad61b7 into jsx-eslint:main Aug 7, 2022
@jessebeach
Copy link
Copy Markdown
Collaborator

Thanks @JoshuaKGoldberg for proposing and writing this rule!

@JoshuaKGoldberg JoshuaKGoldberg deleted the prefer-tag-over-role branch August 7, 2022 20:58
@JoshuaKGoldberg
Copy link
Copy Markdown
Contributor Author

Thanks for the helpful+informative reviews @jessebeach!

And oops, I didn't think to add to the plugin rules & recommended sets. I can send a PR now.

@ljharb
Copy link
Copy Markdown
Member

ljharb commented Oct 27, 2022

@JoshuaKGoldberg somehow we all totally missed the docs for this rule - could you send a PR to add them?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

rules to warn on redundant roles

3 participants