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

Migrate from ESLint #2743

Open
cpoftea opened this issue Jan 21, 2025 · 4 comments
Open

Migrate from ESLint #2743

cpoftea opened this issue Jan 21, 2025 · 4 comments
Labels
Tech debt Internal tech debt

Comments

@cpoftea
Copy link
Contributor

cpoftea commented Jan 21, 2025

Foreword

eslint made all "stylistic" rules as frozen.

...says comment at eslintrc.base.js

Details

It was breaking news reported from ESLint team at 2020. At 2023 ESLint Stylistic plugin was created.

Here's a info from "Getting started":

ESLint Stylistic is a collection of stylistic rules for ESLint, migrated from eslint core and @typescript-eslint repo to shift the maintenance effort to the community. Learn more about why we need this project.

From "Why?":

This project was initiated as ESLint and typescript-eslint teams decided to deprecate formatting/stylistic-related rules from their core due to the maintenance cost. This project ports those rules and distributes them as separate packages. We will keep them maintained as the community.

As for the Jan 2025, last release was week ago. So, it is well maintained I could say.

It also has a migration guide which provides a few migration strategies.

p.s. Onboarding already migrated to Stylistic last year

@AlekseyManetov
Copy link
Collaborator

AlekseyManetov commented Jan 22, 2025

I believe, we also should consider other options for migration, e.g. prettier. Let's do some research about which tools we have on the marker before the start.

@AlekseyManetov AlekseyManetov changed the title Migration to ESLint Stylistic Migrate from ESLint Jan 22, 2025
@AlekseyManetov AlekseyManetov added the Tech debt Internal tech debt label Jan 22, 2025
@cpoftea
Copy link
Contributor Author

cpoftea commented Jan 22, 2025

A few Rust-based I heard about, but never tried

Biome

One toolchain for your web project
Format, lint, and more in a fraction of a second.
...
Biome is a fast formatter for JavaScript, TypeScript, JSX, TSX, JSON, CSS and GraphQL that scores 97% compatibility with Prettier, saving CI and developer time.
...
Biome is a performant linter for JavaScript, TypeScript, JSX, CSS and GraphQL that features 303 rules from ESLint, TypeScript ESLint, and other sources.

Oxc

A collection of JavaScript tools written in Rust
...
Parser ✅
3x faster than swc
All Test262 stage4 tests passed
...
Linter ✅
50~100x faster than ESLint
460+ rules and growing
...
Resolver, Minifier, Formatter

@vasilii-kovalev
Copy link
Collaborator

vasilii-kovalev commented Jan 23, 2025

I was thinking about this topic a while ago, a came to a conclusion to stay with ESLint. I'd like to share my thoughts in hope that it will help you in some way with this task.

For me, CLI/browser extension live server speed is not a blocker. The live server is fast enough (unless you work in a file with thousands of lines of code and have hundreds of rules), and CLI can be speed up with Bun, if necessary. Also, ESLint can become faster in the future. But a small list of supported technologies and poor configuration is a blocker.

I don't use Prettier because of the latter, and that from all the possible ways it could've formatted the code, it does it in the most inconsistent and unreadable way possible.
I've tried Biome a year ago, and it just didn't format things correctly on save, breaking the code. Maybe it is already fixed, but the feeling was it was still WIP.
Oxc looks like a faster ESLint with fewer plugins.

Right now, I use ESLint for both formatting and linting, because it doesn't have the blockers I mentioned above.
Here's my configuration file, if you're interested: ESLint configuration file for React + TypeScript project.
It is huge, because I declare every not-deprecated rule there to add some comments, change severity and make some customizations.
It is necessary to do it once, and then one have to only check changelogs in the plugins after updating them, and add/remove/update the rules accordingly.
Also, ESLint started to work on CSS linting. Perhaps in the future it will even replace Stylelint and become an all-in-one linting/formatting tool the Rome/Biome strives to be.

Also, check the article Why another JavaScript linter?. There, a creator of quick-lint-js discusses pros and cons of the mentioned linters.

@vasilii-kovalev
Copy link
Collaborator

vasilii-kovalev commented Jan 23, 2025

Also, it would be great if you could leave a comment about your experience, requirements to the tools and reasons behind the final decision after the decision is made (here or in the pull request), so that people can learn from it and for the reference if you'll decide to do it again in the future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Tech debt Internal tech debt
Projects
Status: Backlog
Development

No branches or pull requests

3 participants