Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

eslint with version 9.15+ will require changes in multiple files #91

Open
6 tasks done
aheissenberger opened this issue Dec 7, 2024 · 5 comments
Open
6 tasks done

Comments

@aheissenberger
Copy link
Contributor

Describe the bug

I accidentally upgraded eslint to 9.16.0 and got this:

pnpm lint --version

> @ lint /Users/ah/SVN-Checkouts/TST/react-server
> eslint "--version"

v9.16.0
ah@voyage react-server % pnpm lint          

> @ lint /Users/ah/SVN-Checkouts/TST/react-server
> eslint


/Users/ah/SVN-Checkouts/TST/react-server/packages/react-server/config/index.mjs
  102:7   error  Insert `(`  prettier/prettier
  103:10  error  Insert `)`  prettier/prettier

/Users/ah/SVN-Checkouts/TST/react-server/packages/react-server/config/prebuilt.mjs
  19:7   error  Insert `(`  prettier/prettier
  20:10  error  Insert `)`  prettier/prettier

/Users/ah/SVN-Checkouts/TST/react-server/packages/react-server/lib/dev/action.mjs
   57:13  error  Replace `options.watch·??·true` with `(options.watch·??·true)`                                          prettier/prettier
  110:30  error  Replace `options.https·??·configRoot.server?.https` with `(options.https·??·configRoot.server?.https)`  prettier/prettier
  123:32  error  Replace `options.https·??·configRoot.server?.https` with `(options.https·??·configRoot.server?.https)`  prettier/prettier

/Users/ah/SVN-Checkouts/TST/react-server/packages/react-server/lib/dev/create-server.mjs
  292:9   error  Replace `config.vite(devServerConfig)·??·devServerConfig` with `(config.vite(devServerConfig)·??·devServerConfig)`          prettier/prettier
  449:9   error  Replace `config.runtime(initialRuntime)·??·initialRuntime` with `(config.runtime(initialRuntime)·??·initialRuntime)`        prettier/prettier
  472:13  error  Replace `config.handlers(initialHandlers)·??·initialHandlers` with `(config.handlers(initialHandlers)·??·initialHandlers)`  prettier/prettier

/Users/ah/SVN-Checkouts/TST/react-server/packages/react-server/lib/start/create-server.mjs
  47:9   error  Replace `config.runtime(initialRuntime)·??·initialRuntime` with `(config.runtime(initialRuntime)·??·initialRuntime)`        prettier/prettier
  87:11  error  Replace `config.handlers(initialHandlers)·??·initialHandlers` with `(config.handlers(initialHandlers)·??·initialHandlers)`  prettier/prettier

/Users/ah/SVN-Checkouts/TST/react-server/packages/react-server/server/route-match.mjs
  234:15  error  Replace `pathSegment?.indexOf(nextPart.value,·currentPathIndex)·??·0` with `(pathSegment?.indexOf(nextPart.value,·currentPathIndex)·??·0)`  prettier/prettier

✖ 13 problems (13 errors, 0 warnings)
  13 errors and 0 warnings potentially fixable with the `--fix` option.

 ELIFECYCLE  Command failed with exit code 1.

Reproduction

No response

Steps to reproduce

No response

System Info

System:
    OS: macOS 15.1.1
    CPU: (12) arm64 Apple M4 Pro
    Memory: 17.76 GB / 48.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 23.3.0 - /opt/homebrew/bin/node
    Yarn: 1.22.22 - /opt/homebrew/bin/yarn
    npm: 10.9.0 - /opt/homebrew/bin/npm
    pnpm: 9.15.0 - /opt/homebrew/bin/pnpm
    bun: 1.1.38 - /opt/homebrew/bin/bun
  Browsers:
    Chrome: 131.0.6778.109
    Safari: 18.1.1
    Safari Technology Preview: 18.2
  npmPackages:
    @lazarv/react-server: link:packages/react-server => 0.0.0

Used Package Manager

pnpm

Logs

No response

Validations

@aheissenberger aheissenberger added the pending triage Pending triage label Dec 7, 2024
@lazarv
Copy link
Owner

lazarv commented Dec 8, 2024

I would lean towards changing ESLint and Prettier to Biome. But if you're up to putting the changes from above in a PR, it's ok for me to have it merged in for now and take care of the Biome migration in a future PR later (it's low-priority anyway).

@aheissenberger
Copy link
Contributor Author

aheissenberger commented Dec 8, 2024

Have look at https://oxc.rs linter - this linter was built for WeChat and is the base for the new rust base vite bundler (https://voidzero.dev). I am sure linting will become an integrated part of vite.

@lazarv
Copy link
Owner

lazarv commented Dec 8, 2024

At the current stage, oxlint is not intended to fully replace ESLint; it serves as an enhancement when ESLint's slowness becomes a bottleneck in your workflow.
We recommend running oxlint before ESLint in your lint-staged or CI setup for a quicker feedback loop, considering it only takes a few seconds to run on large codebases.

Yes, I'm very excited about Oxc based tooling, especially Rolldown and future usage in Vite. But right now, it's more like SWC, to speed up the current processes. Which is not an issue with react-server.

I'm using Biome in other projects, and for now, I would prefer it. But when Oxc will be mature enough to work as a standalone linter and formatter I'm up to switch to use it. I would also consider it as an Acorn replacement for Vite plugins using transforms, where it's needed to parse JavaScript.

@aheissenberger
Copy link
Contributor Author

Im am not talking about rolldown - oxlint, the linter exists long before vite started with rolldown and is used in production by e.g. Shopify https://oxc.rs/docs/guide/projects.html#oxlint

I do understand that you prefer the same tooling in all of your project but I bet that oxlint will catchup with Biome in 2027 :-)
https://npm-compare.com/@biomejs/biome,oxlint

For now based on downloads Biome is definitely the one with the higher downloads as long as you do not look at eslint
https://npm-compare.com/@biomejs/biome,eslint,oxlint

@lazarv
Copy link
Owner

lazarv commented Dec 8, 2024

All of the Oxc projects are exciting; I just mentioned Rolldown as the one I'm most interested in. But even when Vite with Rolldown is successful doesn't mean that Oxlint will be successful too. Biome could be the "winner" on the long run too.

I don't plan to change the linter and formatter in this project very soon, as this is not a huge codebase to lint or format, so I'm not really worried about the performance of tooling around it.

So ESLint and Prettier are absolutely fine for now here, and Biome or Oxlint could be candidates to change to when it is necessary.

@lazarv lazarv removed the pending triage Pending triage label Dec 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants