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

[Fix] no-unknown-property support new precedence prop #3829

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

acusti
Copy link

@acusti acusti commented Sep 19, 2024

Fixes #3827

Copy link
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.

This looks great, except that we should only be supporting this property when the react version is 19+.

@ljharb ljharb marked this pull request as draft September 23, 2024 19:31
@acusti
Copy link
Author

acusti commented Oct 19, 2024

@ljharb is there a way to accommodate that in the plugin, or does that just mean not adding it until there is a version of the plugin released only for react v19+?

@ljharb
Copy link
Member

ljharb commented Oct 20, 2024

@acusti there is! see the testReactVersion function

@acusti acusti force-pushed the no-unknown-property-precedence branch from f57bd9f to 500112b Compare October 22, 2024 04:57
@@ -89,6 +89,7 @@ ruleTester.run('no-unknown-property', rule, {
{ code: '<div onPointerDown={this.onDown} onPointerUp={this.onUp} />' },
{ code: '<input type="checkbox" defaultChecked={this.state.checkbox} />' },
{ code: '<div onTouchStart={this.startAnimation} onTouchEnd={this.stopAnimation} onTouchCancel={this.cancel} onTouchMove={this.move} onMouseMoveCapture={this.capture} onTouchCancelCapture={this.log} />' },
{ code: '<link precedence="medium" href="https://foo.bar" rel="canonical" />' },
Copy link
Member

Choose a reason for hiding this comment

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

shouldn't this test case only pass when the react version is set to 19+?

Copy link
Author

Choose a reason for hiding this comment

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

definitely. i used react: { version: '19.0.0-rc.0' }, but if it makes more sense to do 19.0.0 even though that doesn’t match any released versions, happy to do that.

@acusti acusti force-pushed the no-unknown-property-precedence branch 2 times, most recently from c249d03 to df4f665 Compare October 22, 2024 05:11
@acusti acusti force-pushed the no-unknown-property-precedence branch from df4f665 to ac007b6 Compare October 22, 2024 06:08
@acusti acusti marked this pull request as ready for review October 22, 2024 06:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Unknown property 'precedence' found (react/no-unknown-property)
2 participants