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

feat(lint/useExhaustiveDependencies): support Preact #2105

Merged
merged 4 commits into from
Apr 5, 2024

Conversation

arendjr
Copy link
Contributor

@arendjr arendjr commented Mar 15, 2024

Summary

This implements support for hooks imported from Preact instead of only React.

I have also checked two other rules:

  • useHookAtTopLevel uses the naming convention to determine what is a hook, so it should already have been compatible with Preact.
  • noRenderReturnValue checks that the return value of ReactDOM's render() function isn't being used. According to Preact's documentation, their render() function already doesn't return anything, so I think that hook doesn't apply to Preact.

I hope this covers all places where React/Preact compatibility might be relevant for us.

Fixes #2043.

Test Plan

Test case added.

@github-actions github-actions bot added A-Linter Area: linter A-Website Area: website L-JavaScript Language: JavaScript and super languages A-Changelog Area: changelog labels Mar 15, 2024
Copy link

netlify bot commented Mar 15, 2024

Deploy Preview for biomejs ready!

Name Link
🔨 Latest commit 4342a46
🔍 Latest deploy log https://app.netlify.com/sites/biomejs/deploys/660fe109533e970008905ca0
😎 Deploy Preview https://deploy-preview-2105--biomejs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 99 (🔴 down 1 from production)
Accessibility: 97 (no change from production)
Best Practices: 100 (no change from production)
SEO: 93 (no change from production)
PWA: -
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

codspeed-hq bot commented Mar 15, 2024

CodSpeed Performance Report

Merging #2105 will not alter performance

Comparing arendjr:preact-support (4342a46) with main (3adb1d9)

Summary

✅ 93 untouched benchmarks

@github-actions github-actions bot added the A-Parser Area: parser label Mar 15, 2024
@ematipico
Copy link
Member

Let's hold off the merge of this PR. Let's fix more bugs, ship some more patches, and then merge it :)

@arendjr
Copy link
Contributor Author

arendjr commented Mar 16, 2024

You mean you want to do more 1.6.x releases before merging it, right? I’m having trouble saying if it’s tongue-in-cheek 😅

@ematipico
Copy link
Member

Yes. If we merge a minor (because it is), we're forced to ship a 1.7.0

@github-actions github-actions bot removed the A-Parser Area: parser label Apr 5, 2024
@arendjr arendjr merged commit 7b6439b into biomejs:main Apr 5, 2024
15 of 16 checks passed
Comment on lines -271 to +273
### Linter
### Parser
Copy link
Sponsor Contributor

Choose a reason for hiding this comment

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

Why did this change?

@@ -359,10 +361,6 @@ our [guidelines for writing a good changelog entry](https://github.com/biomejs/b

#### Bug fixes

- JavaScript lexer is now able to lex regular expression literals with escaped non-ascii chars ([#1941](https://github.com/biomejs/biome/issues/1941)).

Contributed by @Sec-ant
Copy link
Sponsor Contributor

Choose a reason for hiding this comment

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

Why was this removed?
Bad merge conflict resolution?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah yes, that was indeed a wrongly merged conflict. I'll fix right away, thanks!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Changelog Area: changelog A-Linter Area: linter A-Website Area: website L-JavaScript Language: JavaScript and super languages
Projects
None yet
Development

Successfully merging this pull request may close these issues.

🐛 useExhaustiveDependencies rule should handle preact
3 participants