expressjs.com icon indicating copy to clipboard operation
expressjs.com copied to clipboard

Use a code formatter

Open bjohansebas opened this issue 1 year ago • 5 comments

Implementing a formatter like Prettier or Biome would help maintain better consistency in code style. Although standard.js already handles the style, it's only for JavaScript. It would be better to have a tool capable of maintaining consistency in HTML, CSS, or any other language in the repository as well.

cc: @crandmck

bjohansebas avatar Sep 05 '24 13:09 bjohansebas

I'd be open to this since we are the only main contributors working right now, and it'd make for a better developer experience. But its a non trivial amount of work to maintain formatting across a team of many people.

It would either help us get rid of prettifying junk in our PRs, or it could make it worse.

Not a bad suggestion though!

chrisdel101 avatar Sep 08 '24 18:09 chrisdel101

This is reasonable, but I'm not sure it's worth the effort. I have some other suggestions that might have more value--will try to find time to put them in an issue.

crandmck avatar Sep 08 '24 19:09 crandmck

btw, we’re not actually using a linter or a formatter for the .js files. ESLint is only being used for the code blocks inside markdown files. Additionally, in tests, it didn’t work well to use Prettier for general use because we’re using Liquid, which makes Prettier act a bit erratically. Hopefully, we can solve this issue in the future.

bjohansebas avatar Dec 11 '24 22:12 bjohansebas

@expressjs/docs-wg what do you think about using Prettier to initially format the CSS?

bjohansebas avatar Feb 09 '25 01:02 bjohansebas

I like the idea of using a formatter, and for main contributors it should be pretty straightforward since we're using this code frequently, and can debug it. But it can be annoying when someone clones the repo and the formatter doesn't work and needs a bunch of debugging. Happens to me sometimes.

How much effort would it take to maintain it being in the workflow? I'm pro-formatter overall though.

chrisdel101 avatar Feb 10 '25 07:02 chrisdel101