#20279·cockpit

Consider oxlint/biome as replacement of eslint

Author: jellyCreated Apr 9, 2024Updated Sep 23, 2026
Labelsenhancement

oxlint is an oxidized eslint written in Rust. It is vastly faster then eslint ~ 72 ms versus 17 seconds but as of now supports less rules.

So for us to switch we need to make sure all our plugins and rules are supported, this issue should track that. Our used plugins:

  • eslint-plugin-import
    • import/export
    • import/first
    • import/no-absolute-path
    • import/no-named-default
    • import/no-webpack-loader-syntax
  • eslint-plugin-jsx-a11y
  • eslint-plugin-n
  • eslint-plugin-promise
    • no-nesting
  • eslint-plugin-react
    • jsx-boolean-value
    • jsx-closing-bracket-location
    • jsx-closing-tag-location
    • jsx-curly-brace-presence
    • jsx-curly-newline
    • jsx-curly-spacing
    • jsx-equals-spacing
    • jsx-first-prop-new-line
    • jsx-fragments
    • jsx-handler-names
    • jsx-indent
    • jsx-indent-props
    • jsx-no-bind
    • jsx-pascal-case
    • jsx-props-no-multi-spaces
    • jsx-tag-spacing
    • jsx-uses-react
    • jsx-uses-vars
    • jsx-wrap-multilines
    • no-danger-with-children
    • no-did-update-set-state
    • no-unused-prop-types
    • prop-types
    • self-closing-comp
  • eslint-plugin-react-hooks (only react-hooks/exhaustive-deps missing)
  • eslint-plugin-core
  • eslint-typescript

Apart from speed, oxlint found issues which eslint did not catch:

Another benefit is that oxlint provides a native language-server while for eslint you need an alternative extension. While for oxlint you can use the native Rust binary for example in neovim.

Listing the rules we have enabled:

bash
npm run eslint --print-config .eslintrc.json > eslint-custom-conifg.json
# number of rules enabled
cat eslint-custom-conifg.json | jq -r '.rules | length'
# rule names
cat eslint-custom-conifg.json | jq -r '.rules | keys | join("\n")'

React to-do generated with:

bash
npx eslint --print-config .eslintrc.json | jq -r '.rules | keys | join("\n")'  | grep --color=never react | sed 's/react\///' | sed 's/-/_/g' > rules.txt

In oxlint git

for x in $(cat ~/projects/starter-kit/rules.txt); do git grep -q $x || echo "  - [ ] $x" | sed 's/_/-/g'; done