Skip to content

Replace eslint with biome#439

Open
jankapunkt wants to merge 5 commits into
masterfrom
feature/replace-eslint-with-biome
Open

Replace eslint with biome#439
jankapunkt wants to merge 5 commits into
masterfrom
feature/replace-eslint-with-biome

Conversation

@jankapunkt

@jankapunkt jankapunkt commented Jun 15, 2026

Copy link
Copy Markdown
Member

Summary

Replaces eslint with biome with remains compatible with commonjs and is also able to handle (future) esm (see #279)

Please do not get scared of the change files. While the linter only produced warnings, the formatter produced lots of errors, which were automatically fixable (similar to how prettier works)

Linked issue(s)

#403 #279

Involved parts of the project

  • all JavaScript code
  • CI

Added tests?

  • none

OAuth2 standard

  • none

Reproduction

clone and run one of the following:

npm run lint
npm run lint:fix
npm run format
npm run format:fix

@jankapunkt jankapunkt requested a review from Copilot June 15, 2026 08:40

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot wasn't able to review this pull request because it exceeds the maximum number of lines (20,000). Try reducing the number of changed lines and requesting a review from Copilot again.

@jankapunkt jankapunkt self-assigned this Jun 15, 2026
@jankapunkt jankapunkt added the code quality 🧽 Relating to code quality label Jun 15, 2026

@dhensby dhensby left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't feel too strongly one way or the other for biome vs eslint; I'd slightly lean towards eslint due to familiarity, native JS and maturity, but it's not a show stopper.

Feedback:

  1. I ran biome locally and got some changes, which I'm not sure if we want or not given that it means if some other contributor runs biome lint --write then they will get quite a big diff which isn't committed and could cause noise in other PRs.
  2. You've moved from spaces -> tabs, and single to double quotes. Both changes create significant diff noise, personally I'd keep the current formatting conventions where possible to reduce this noise - but not a deal breaker; we could also add a .git-blame-ignore-revs file that can hide these reformat changes from blames to keep disruption down due to formatting changes.
  3. I'd reword some of the commits (a bit pedantic, sorry):
    a) feature(dev): replace eslint with biome toolchain: chore(deps-dev): ... is typical for this kind of change
    b) fix(core): biome format fix: stype: ... "fix" commits tend to be for fixing bugs, this is just internal code reorganisation so not worthy of fix commit IMO
    c) fix: run biome formatter is docs: add biome badge
    d) fix run biome formatter fix: style: again, I'd probably fixup into the previous refactor commit
    e) fix(tests): detect different line in emitted error after biome formatter fixes: test: ...

@dhensby dhensby left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Should we split out the other dep bumps (type-is, mocha, sinon, vitepress) to their own commits or PR?
  • Runnint npm run lint:fix creates a lot of changes (when I ran it locally anyway), which I don't think it should otherwise (as I said previously) other contributors will find themselves with a lot of noise when running this command.

Comment thread biome.json
Comment on lines +8 to +11
"files": {
"ignoreUnknown": true,
"includes": ["lib/**/*.js", "test/**/*.js"]
},

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This excludes index.js

Comment thread biome.json
Comment on lines +18 to +20
"rules": {
"preset": "recommended"
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"rules": {
"preset": "recommended"
}
"rules": {
"preset": "recommended",
"suspicious": {
"noRedundantUseStrict": "off"
}
}

This will stop npm run lint:fix from stripping "use strict" (which I assume we want to keep)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

code quality 🧽 Relating to code quality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants