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

chore: replace eslint with biome for formatting and linting #58

Merged
merged 3 commits into from
Dec 3, 2024

Conversation

zimeg
Copy link
Member

@zimeg zimeg commented Dec 2, 2024

Summary

This PR replaces eslint with biome for wicked fast linting and formating and fixes #49. The changes are mechanical for the most part, but I'll note important updates in comment!

Requirements

@zimeg zimeg added the dependencies Pull requests that update a dependency file label Dec 2, 2024
@zimeg zimeg self-assigned this Dec 2, 2024
Copy link

codecov bot commented Dec 2, 2024

Codecov Report

Attention: Patch coverage is 91.13924% with 7 lines in your changes missing coverage. Please review.

Project coverage is 94.57%. Comparing base (b8d5739) to head (ead05e0).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
src/score_components/find-problematic-comments.js 88.57% 4 Missing ⚠️
src/get-sha.js 50.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #58      +/-   ##
==========================================
- Coverage   95.48%   94.57%   -0.91%     
==========================================
  Files           6        6              
  Lines         332      369      +37     
==========================================
+ Hits          317      349      +32     
- Misses         15       20       +5     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member Author

@zimeg zimeg left a comment

Choose a reason for hiding this comment

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

🗒️ Leaving a few notes for the wonderful reviewer!

{
"$schema": "./node_modules/@biomejs/biome/configuration_schema.json",
"files": {
"ignore": [".api", "*.json"],
Copy link
Member Author

Choose a reason for hiding this comment

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

.api here ignores the vendored codecov packaging which seems to use a compiled module?

The fixes required for the linter were not immediate or obvious, but I don't expect changes to happen to these files often so I think we're safe to ignore it here!

Copy link
Member

Choose a reason for hiding this comment

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

I think so too! By the way, where can the file be placed? If it's under a codecov-specific directory, we may want to skip the whole directory to avoid being bothered by similar files in the future. If it can be placed everywhere, this config should be good to go

Copy link
Member Author

Choose a reason for hiding this comment

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

It seems like .api stores generated files in ce66298 from codecov OpenAPI responses 📚

AFAIK this .api directory could be called something else, but we would just have to update the package path:

"@api/codecov": "file:.api/apis/codecov"

I'll keep this in mind with future updates, but think this'll be ok to merge as is!

Copy link
Member

Choose a reason for hiding this comment

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

oops, it's not "*.api"... I was assuming that it's file extension 🤦 Thanks for sharing the details!

Comment on lines +11 to +12
"test": "npm run lint && c8 npm run test:mocha",
"test:mocha": "mocha --config .mocharc.json test/*-test.js test/**/*-test.js"
Copy link
Member Author

Choose a reason for hiding this comment

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

Ordered alphabetically! And added the lint:fix above. But otherwise these tasks should run as expected 🚀

Comment on lines -43 to -47
"eslint": "^8.57.1",
"eslint-config-airbnb-base": "^15.0.0",
"eslint-plugin-import": "^2.31.0",
"eslint-plugin-jsdoc": "^50.4.3",
"eslint-plugin-node": "^11.1.0",
Copy link
Member Author

Choose a reason for hiding this comment

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

🫡

Copy link
Member

Choose a reason for hiding this comment

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

Happy to see this

Copy link
Member Author

Choose a reason for hiding this comment

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

Same! Even if I disagree with a few of the biome defaults, I cannot disagree that it's fewer dependencies 🤓

if (include && include.length) {
include.forEach((i) => {
if (include?.length) {
for (const i of include) {
Copy link
Member Author

Choose a reason for hiding this comment

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

Unlooping the .forEach is the only manual change required throughout all of this!

Copy link
Member

@seratch seratch 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 working on this! Left a few minor comments but looks good to me

Comment on lines -43 to -47
"eslint": "^8.57.1",
"eslint-config-airbnb-base": "^15.0.0",
"eslint-plugin-import": "^2.31.0",
"eslint-plugin-jsdoc": "^50.4.3",
"eslint-plugin-node": "^11.1.0",
Copy link
Member

Choose a reason for hiding this comment

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

Happy to see this

@zimeg
Copy link
Member Author

zimeg commented Dec 3, 2024

@seratch Thank you for the thorough review 🙏 I'm hopeful that this'll help us maintain formatting with ease here! 🚀

@zimeg zimeg merged commit 912cf64 into main Dec 3, 2024
6 checks passed
@zimeg zimeg deleted the zimeg-build-biome-replacement branch December 3, 2024 01:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove eslint and move to biome
2 participants