space-meridian / roadmap

High-level roadmap for Filecoin Station
https://starmap.site/roadmap/github.com/space-meridian/roadmap/issues/1
0 stars 0 forks source link

Migrate from standard to neostandard + Prettier/dprint #166

Open bajtos opened 2 months ago

bajtos commented 2 months ago

I used to be a long-time Eslint+Prettier user. I was honestly trying to learn to like Standard that we are using in our repos, but I am frustrated about many papercuts:

I propose we make the following changes:

juliangruber commented 2 months ago

It's easy to discuss these matters for hours, so I'm keeping my answer short:

I used to be a long-time Eslint+Prettier user. I was honestly trying to learn to like Standard that we are using in our repos, but I am frustrated about many papercuts:

When it comes to form, I dislike them. When it comes to function, they are keeping git diffs clean, so I'm in favor.

  • Standard allows multiple ways how to format the same code snippet. I cannot rely on "format-on-save", often I have to clean up the formatting manually.

I see no problems with multiple ways of formatting something as long as all are acceptable. I'm not opposed to switching to a tool that allows only one way, if it always works well.

This is possibly the most important point, as JS / TS is still developing frequently.

  • Standard does not support linting .d.ts files

+1

I propose we make the following changes:

Neostandard and its differences from standard lgtm!

Regarding the formatters, do you see fundamental differences, or shall we create one PR each, to compare the output? We could even base these PRs on top of each other, to see the exact difference between the tools.

voxpelli commented 2 months ago

This sparked an inspiration for me: https://github.com/neostandard/neostandard/issues/170 Would that be of interest to you?

bajtos commented 2 months ago

This sparked an inspiration for me: neostandard/neostandard#170 Would that be of interest to you?

Yes! Let's continue the discussion in that other issue.

@voxpelli I appreciate that you took the time to post comments in our repo. I know from my own experience how demanding it is to maintain a popular open-source project. Thank you! 🙏🏻

bajtos commented 2 months ago

GitHub Actions for running Prettier and dprint:

bajtos commented 1 month ago

Related:

https://github.com/filecoin-station/spark-api/pull/385#discussion_r1760996948

I think we had a convention that style changes need to be enforced by a linter, so they don't need to get discussed.

(...) Empty lines used as visual delimiters help me navigate the code faster, so they are important to me. (...) My takeaway is that I should investigate how to incorporate a variant of this eslint rule to our linter checks.

juliangruber commented 1 month ago

I personally dislike empty lines more often than not, especially if they're happening after 2 or 3 lines. It's like putting every sentence of a paragraph in its own paragraph. Let's find rules that make sense and can be applied consistently.