Drop ESLint and Prettier for Biome
| Q | A |
|---|---|
| Bug fix? | no |
| New feature? | no |
| Issues | Fix #... |
| License | MIT |
Hi everyone,
Biome is a new modern tool for code linting and formatting. It supports TypeScript out-of-the-box, lint and format does not conflict each-other (like ESLint and Prettier can do), and it's super fast! With Biome, we can easily replace:
- ESLint
- ESLint's TypeScript plugin
- Prettier
- ESLint's Prettier plugin
There is a lot of modifications, but 99% of them are:
- use
import type .../import { type ... }when necessary - removing
'use strict', since we havetype: 'module'inpackage.jsonfiles, but I'm not 100% confidente here and I may add them back - using template string interpolation instead of
+operator
I've disabled the following linting rules in order to reduce the number of modifications, but later we can start to enable them:
complexity/noStaticOnlyClasscomplexity/noForEachstyle/noParameterAssignperformance/noDelete
The yarn scripts lint, format, check-lint and check-format have been modified in consequences.
For performance comparisons, you can check those two CI jobs:
- https://github.com/symfony/ux/actions/runs/9063481176/job/24899508211, ESLint took ~19s and Prettier took ~2s
- https://github.com/symfony/ux/actions/runs/9091422430/job/24985996787, Biome took ~5s for linting and ~0s for formatting
For the number of commits, I wanted to ease the review by doing many atomic commits, but feel free to squash if necessary.
WDYT?
Failures are unrelated
I cannot resist to answer with: https://dayssincelastjavascriptframework.com/
(and now more seriously i'll look at your post 😅 )
(first read: you know how to speak to me :) )
Yeah I know about the 0 day since the last JS framework/tools meme... and trust me it's not for nothing my TN is "JS hate account" :trollface:
Biome is a community-fork from Rome (started 3 years ago), it's a tool I was really looking forward to because of the over-fragmentation of JavaScript tools and the unnecessarily complex configurations to make them work together. I love having a tool that does a lot, but mostly well. ... <troll>Next PR, Bun to replace Yarn/Vitest/Rollup? :eyes: </troll>)
I consider Biome enough "production-ready", to nicely and quickly lint and format our JS(X)/TS(X) files.
What about editor integration? Did you tried the PHPstorm extension? Do you think it's mature enough?
I didn't know an extension existed, and so I didn't try it. But I'm not a big fan of ESLint/Prettier integration in IDEs, I prefer relying on CLI / CI / pre-commit hook :D
I'll try it next week (late in the week) !
This looks like a nice addition. Do you think this is ready for merge or would you like to wait for more feedback and/or changes? Thanks!
Hey, I think this PR would need a last rebase on main before merging.
I will do it this afternoon
The PR has been rebased and CI checks are passing, feel free to merge it if you like it :eyes:
Let's merge this now so we can fully test it for real in the project and see how it goes.
Thanks Hugo!