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(rule/solidjs): add no-react-specific-props #2427

Merged
merged 24 commits into from
Apr 18, 2024

Conversation

marvin-j97
Copy link
Contributor

@marvin-j97 marvin-j97 commented Apr 12, 2024

Summary

SolidJS has a couple of rules that may be useful, especially when transitioning from React, see #3 (comment).

(in SolidJS Discord)

... — 12.02.2024 10:49
Hi, I'm one of the core contributors of Biome.

We're interested in implementing solid linting rules, unfortunately we lack the knowledge and some rules aren't well documented. Is there interest in helping us?

---

Me — 12.02.2024 18:25
- solid/no-destructure
- solid/prefer-show
- solid/prefer-for
- solid/no-react-deps
- solid/no-react-specific-props
- solid/components-return-once

those should be the most useful rules, especially for React users, i think

Test Plan

invalid.jsx only works for 2 out of 3 test cases right now. I'm essentially using the same implementation as no-duplicate-jsx-props, but I don't know why className with a brace expression is not getting picked up yet... I'm not really familiar with Biome's codebase yet, so this PR is an attempt to get into it, this is probably an easy fix. Also I'm not sure if the rule should be part of nursery or if SolidJS rules may need a new group altogether...

  • Check for className
  • Check for htmlFor
  • Auto-fix action

@github-actions github-actions bot added A-Project Area: project A-Linter Area: linter L-JavaScript Language: JavaScript and super languages A-Diagnostic Area: diagnostocis labels Apr 12, 2024
Copy link

netlify bot commented Apr 12, 2024

Deploy Preview for biomejs ready!

Name Link
🔨 Latest commit 99247a2
🔍 Latest deploy log https://app.netlify.com/sites/biomejs/deploys/661e74ca23bc590008cbeab6
😎 Deploy Preview https://deploy-preview-2427--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: 95 (🔴 down 5 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.

@github-actions github-actions bot added the A-Website Area: website label Apr 12, 2024
@ematipico
Copy link
Member

Thank you @marvin-j97 for taking some initiative!

I will take a look at the rules in the coming days.

As for now, all rules must pass an incubation phase, hence the nursery group. During this incubation phase, we can implement the rule however we want.

Then, we will decide the final group :)

Copy link

codspeed-hq bot commented Apr 13, 2024

CodSpeed Performance Report

Merging #2427 will improve performances by 6.06%

Comparing marvin-j97:rules/solidjs/noReactSpecificProps (fb0a974) with main (4164331)

Summary

⚡ 1 improvements
✅ 92 untouched benchmarks

Benchmarks breakdown

Benchmark main marvin-j97:rules/solidjs/noReactSpecificProps Change
eucjp.json[cached] 4.3 ms 4.1 ms +6.06%

@marvin-j97
Copy link
Contributor Author

@ematipico Snapshot tests are working now, the JSX fixtures were not delimited by semicolon...

@marvin-j97 marvin-j97 marked this pull request as ready for review April 13, 2024 15:43
@marvin-j97 marvin-j97 changed the title (WIP) Add SolidJS eslint rule no-react-specific-props (rule/solidjs) Add no-react-specific-props Apr 13, 2024
@ematipico
Copy link
Member

Awesome @marvin-j97! Could you open an umbrella issue to track all the rules we need to implement, with relative documentation, please?

That would help to have a central place where we can coordinate the work and maybe seek more volunteers.

@ematipico ematipico force-pushed the rules/solidjs/noReactSpecificProps branch from d09ed29 to 58d98c8 Compare April 16, 2024 07:51
@github-actions github-actions bot added the A-CLI Area: CLI label Apr 16, 2024
Copy link
Member

@ematipico ematipico left a comment

Choose a reason for hiding this comment

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

The rule now is easier to understand and to handle. I left few suggestions around coding and docs. We can merge the PR after we addressed them

Copy link
Member

@ematipico ematipico left a comment

Choose a reason for hiding this comment

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

Still a couple of changes, and we're good to go

@marvin-j97 marvin-j97 changed the title (rule/solidjs) Add no-react-specific-props feat(rule/solidjs): Add no-react-specific-props Apr 18, 2024
@marvin-j97 marvin-j97 changed the title feat(rule/solidjs): Add no-react-specific-props feat(rule/solidjs): add no-react-specific-props Apr 18, 2024
@ematipico ematipico merged commit fd7ba41 into biomejs:main Apr 18, 2024
11 checks passed
@marvin-j97 marvin-j97 deleted the rules/solidjs/noReactSpecificProps branch April 18, 2024 16:22
@eMerzh
Copy link
Contributor

eMerzh commented Apr 22, 2024

I think the website was moved away before the PR was merged or smth .. leading to a single file empty website folder 🤔

@ematipico
Copy link
Member

You're an eagle!! Good eye

@Conaclos Conaclos added the A-Changelog Area: changelog label Apr 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Changelog Area: changelog A-CLI Area: CLI A-Diagnostic Area: diagnostocis A-Linter Area: linter A-Project Area: project A-Website Area: website L-JavaScript Language: JavaScript and super languages
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants