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(biome_js_analyze): noFlatMapIdentity #2324

Merged
merged 18 commits into from
Apr 14, 2024
Merged

Conversation

isnakode
Copy link
Contributor

@isnakode isnakode commented Apr 6, 2024

Summary

Close #2303.

this PR adds lint support to replace unnecessary flatMap call with flat instead, maybe need some help to refine the diagnostic message (my english is so bad)

Test Plan

manually tested

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

netlify bot commented Apr 6, 2024

Deploy Preview for biomejs ready!

Name Link
🔨 Latest commit 9659d9f
🔍 Latest deploy log https://app.netlify.com/sites/biomejs/deploys/661be235d8bc020008b6c5a1
😎 Deploy Preview https://deploy-preview-2324--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: 96 (🔴 down 3 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.

@isnakode isnakode changed the title feat(biome_js_analyze): myRuleName feat(biome_js_analyze): noFlatMapIdentity Apr 6, 2024
Copy link

codspeed-hq bot commented Apr 6, 2024

CodSpeed Performance Report

Merging #2324 will improve performances by 13.33%

Comparing isnakode:main (9659d9f) with main (75af801)

Summary

⚡ 1 improvements
✅ 92 untouched benchmarks

Benchmarks breakdown

Benchmark main isnakode:main Change
eucjp.json[uncached] 5.6 ms 4.9 ms +13.33%

@isnakode
Copy link
Contributor Author

isnakode commented Apr 6, 2024

i've update the PR

Copy link
Member

@unvalley unvalley left a comment

Choose a reason for hiding this comment

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

I think we can merge this after fixing the consistency of the wording regarding periods. Thank you for contribution!

@unvalley
Copy link
Member

unvalley commented Apr 7, 2024

@isnakode looks good to me, could you execute just gen-all?

EDIT: and please write changelog.

@unvalley unvalley added the A-Changelog Area: changelog label Apr 7, 2024
@github-actions github-actions bot removed the A-Changelog Area: changelog label Apr 7, 2024
@isnakode
Copy link
Contributor Author

isnakode commented Apr 7, 2024

nah, how to write changelog?, any link?

@unvalley
Copy link
Member

unvalley commented Apr 7, 2024

@isnakode We have the CHANGELOG.md at root. You can add the Unreleased/Linter/New features section, please refer to other lint rules addition.

@github-actions github-actions bot added the A-Changelog Area: changelog label Apr 7, 2024
@ematipico
Copy link
Member

nah, how to write changelog?, any link?

https://github.com/biomejs/biome/blob/main/CONTRIBUTING.md

There's a whole section about the changelog

@isnakode
Copy link
Contributor Author

isnakode commented Apr 8, 2024

done

Copy link
Member

@Sec-ant Sec-ant left a comment

Choose a reason for hiding this comment

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

LGTM, but we should add more test cases.

markup! {
"flat method can be used to simplify"
},
))
Copy link
Member

Choose a reason for hiding this comment

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

Let's follow the rule pillars:

  • show the error
  • explain why it could be an error
  • suggest a solution (Code action)

@Sec-ant
Copy link
Member

Sec-ant commented Apr 9, 2024

@isnakode I did some tweak on your branch for it to pass the CI:

  1. Rule sources 43eeeba, address feat(biome_js_analyze): noFlatMapIdentity #2324 (comment)
  2. Run just gen-lint to update the rule doc and schemas 710f628
  3. Update the snapshots. I think you're on a windows machine so the snapshots contain carriage returns that will fail the CI check. I removed them. 584d5bf

Run git pull to update your local branch.

@Sec-ant
Copy link
Member

Sec-ant commented Apr 9, 2024

git pull maybe the wrong suggestion because that introduces some conflicts again. 😅 So I update them again. If you want to sync your local repo with the remote one, in your local repo main branch:

git fetch origin
git reset --hard origin/main

@isnakode
Copy link
Contributor Author

isnakode commented Apr 9, 2024

okay, should i push directly after it, or what?

@Sec-ant
Copy link
Member

Sec-ant commented Apr 9, 2024

okay, should i push directly after it, or what?

Yep, you can push more commits from now on. But the carriage returns may be added back if you run the tests and update the snapshots again. That may need some settings or manual removal. 🤔

Copy link
Member

@Conaclos Conaclos left a comment

Choose a reason for hiding this comment

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

Thanks for your contribution! You made it!
This will part of the tomorrow's release :)

@Conaclos Conaclos merged commit 6ec264c into biomejs:main Apr 14, 2024
15 of 16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Changelog Area: changelog 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.

📎 Implement lint/noFlatMapIdentity - clippy/flat_map_identity
5 participants