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

Enforce code formatting #2191

Closed
1 task done
minht11 opened this issue Aug 4, 2024 · 4 comments · Fixed by #2204
Closed
1 task done

Enforce code formatting #2191

minht11 opened this issue Aug 4, 2024 · 4 comments · Fixed by #2204

Comments

@minht11
Copy link

minht11 commented Aug 4, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Feature description

My proposal would be:

  1. Enforce code style in CI. Add script command to format files.
  2. Switch to Biome for formatting only. It is way faster and has identical or better formatting to prettier.
  3. Make tabs default instead of spaces. TLDR. Tabs are more accessable and configurable by the user. More reasoning can be found here.

The first point is the main part, others are in decreasing importance. Would be willing to provide PR to 1 or all points.


Prettier is in project dependencies but does not seem to be used.
In vscode formatting does not even work even if forced, because prettier path does not exist:

"prettier.prettierPath": ".yarn/sdks/prettier/index.cjs",

on my machine changing It to makes it work:

  "prettier.prettierPath": "node_modules/prettier/index.cjs",
@Borewit
Copy link
Owner

Borewit commented Aug 4, 2024

I am interested, the eslint with all it's sub dependencies is very distracting, way to complex to configure to my liking.

Can we postpone the space to tabs, to avoid each and every line will changed with this PR?

Like the test runner changes, are you willing to do the change for the dependencies (those I own) as well? Preferably starting with the dependencies, and then the dependent packages. Maybe good to start with peek-readable as well

@minht11
Copy link
Author

minht11 commented Aug 4, 2024

Yeah, spaces/tabs can wait.
Just to be clear, you would want to migrate from eslint completely? Biome has most of eslint/unicorn rules, but it is missing some of typescript-eslint rules which involve typechecking. Will PR open peek-reedable to start.

@Borewit
Copy link
Owner

Borewit commented Aug 4, 2024

I am open to better alternatives.
I do believe proper code formatting is important, but I dislike the current complexity to set it up and to maintain it.
Also the source mapping drives me nuts, for some reason I get totally different lines when debugging unit tests.

These are all things which had working perfectly at certain point, but then due to required updates / dependency deprecation, things just became in opinion just to complex and distracting.

@Borewit
Copy link
Owner

Borewit commented Aug 12, 2024

Resolved by #2204

@Borewit Borewit closed this as completed Aug 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants