build: use biome as formatter
Since ESLint is deprecating formatter rules, I propose using Biome as the formatter.
This is pretty much in progress. I'm not sure if Biome supports all existing rules.
Fixes https://github.com/nodejs/node/issues/50449
Todos
-
Add Biome to Github workflow -
Update Makefile -
Add Biome as a dependency
Feature parity
linebreak-style
no-extra-parens ✅
biome acts like the all
eslint option, node currently uses the functions
one which is a subset of all
object-curly-newline ⚠ (click to see explanation)
biome will keep the braces in the same line if the object is empty
if you are destructuring, it will try to keep it in the same line unless that would exceed the defined lineWidth
if the object is not empty, it will keep the linebreak (or lack of linebreak) the user provided in most cases
operator-linebreak ✅ (tries to keep on the same line unless it exceeds lineWidth, if not it matches the "after" option which node uses)
padding-line-between-statements ❌ (click to see explanation)
node uses the { blankLine: 'always', prev: 'function', next: 'function' }
config for the option, which (i guess) makes eslint always add a blank newline if two functions are declarated in a row. biome doesn't add a blank newline unless you already had added one