r/typescript • • Aug 20 '26

Best TypeScript linter?

I'm dabbling with TypeScript again after some time away. What is the best way to lint .ts files these days? Is ESLint still the go-to, or is there a better method?

57 Upvotes

47 comments sorted by

71

u/rosebeuud Aug 20 '26

oxlint seems to be on the rise, thanks to it being part of the Vite ecosystem

1

u/_Pho_ Aug 25 '26

oxlint is genuinely 50x+ faster than eslint, highly recommend

29

u/gorilla-moe Aug 20 '26

Pick your poison:

  • eslint with unicorn is still the 300 pound Gorilla in the room (IMHO)
  • biome a good contender
  • oxfmt and oxlint both trusted and the defaults for vite-plus

13

u/KnifeFed Aug 20 '26

FYI, Unicorn is built into Oxlint, so no need to use ESLint just for that. It also supports ESLint plugins, so, yeah, no need to use ESLint at all. This, and the fact that it's faster than Biome, makes it the clear winner, IMO.

2

u/silv3rwind Aug 20 '26 edited Aug 21 '26

Oxlint barely covers half of the unicorn rules, see https://github.com/oxc-project/oxc/issues/684.

9

u/Bicykwow Aug 20 '26

We do not accept pull requests because of too much AI slop.

Haha, love this. 

19

u/ehs5 Aug 20 '26

Oxlint by far. Wouldn’t start a project without that and oxfmt today.

1

u/pjstanfield Aug 21 '26

I use biome now in most projects but if I was starting over I’d use oxlint

18

u/jarzebowsky Aug 20 '26

Went biome and migrated to oxlint. It’s faster and you can use eslint rules which biome can’t.

1

u/pjstanfield Aug 21 '26

How was the migration? I wanted to migrate from biome but haven’t done a deep look yet

1

u/jarzebowsky Aug 22 '26

It was way faster than going from eslint to biome

12

u/Chef_G0ldblum Aug 20 '26

I'm still on eslint 🤷‍♂️

17

u/JATR1X Aug 20 '26

biomejs, my personal favourite

8

u/anaveragedave Aug 20 '26

I'm getting lazy in my old age. We are still on default eslint. I haven't even heard of oxlint or biome before seeing this post. Shame on me

3

u/prophase25 Aug 21 '26

Oxlint and Oxfmt are way, way better than I thought possible. I will never use ESLint again for a new project.

4

u/glandix Aug 20 '26

I recently switched from eslint to oxlint and love it

2

u/root_om Aug 21 '26

Oxlint and biome is pretty cool

2

u/imjuni Aug 21 '26

I choose oxlint & oxfmt. They are nice coupled vscode

4

u/ongamenight Aug 20 '26

I'm using Biome.

3

u/YeisonKirax Aug 20 '26

Biome has linter and formatter. Oxlint and oxfmt will have a great future but for now is too buggy

3

u/dupontcyborg Aug 20 '26

biome, by far. it's written in rust and between 10-100x faster than eslint on my projects. it's both a linter and formatter, so it replaces eslint and prettier, and is much faster than both.

1

u/realmauer01 Aug 20 '26

Depends if you use node, deno has its own linter that can be used.

1

u/keldamdigital Aug 21 '26

if you haven't yet, you should be moving away from eslint and moving to oxlint with type aware.

1

u/TheMindLabor Aug 21 '26

I use both oxlint and eslint, still significantly faster than just eslint (I use vue and oxlint/fmt doesnt have template support yet). Dropped from 30s linting with eslint only, to 8s linting with both (200ms for oxlint only which checks 80% of the rules)

1

u/GameRoMan Aug 22 '26

oxlint

1

u/GameRoMan Aug 22 '26

In some projects I use oxlint and in some Biome

1

u/OrigStuffOfInterest Aug 22 '26

If speed is not a concern, which linting tool provides the best accuracy? I'm using eslint now, and the speed of it has not been an issue for me. Also, this is a React project, and I'm using the React plugins for eslint.

1

u/LoadingALIAS Aug 20 '26

It’s Oxlint. Let me save you the time.

1

u/green_03 Aug 20 '26

I am using a mix of biome with oxlint+oxlint-tsgolint to replace typescript-eslint. Though I might drop. Biome soon

2

u/DerTimonius Aug 20 '26

same thing here. contributed some rules to Biome, but I think the inertia is more on the side of oxlint at the moment due to their speed with which they deliver

1

u/green_03 Aug 20 '26

Exactly. Biome were ahead but Oxlint got more traction then, and now Cloudflare money. They are ahead and have the type-aware rules. I love Biome, the DX is better, but releases are slower, tinier, but what is worse, lately they have a lot of regressions. I still love what they are doing though!

1

u/KnifeFed Aug 20 '26

Oxlint/Oxfmt > Biome > ESLint

-1

u/ivy-apps Aug 20 '26

I'm using Biome for linting and Deslop for architecture enforcement

0

u/VoidspawnRL Aug 20 '26

Any linter that use TS to lint ts so all of them is broken with ts 7.0 and they will get a API in ts 7.1 for eslint it is still the best as there is so many plugins for it, in any case you need to install ts 6.0 for the linters and ts 7.0 for your projects for the next 3-6 months, as the linters need to rewrite they code and then all the plugins need a rewrite.

I try oxlint as a lot use it but it fail badly on a big project on work. So i stick with eslint.

2

u/rasekrodriguez Aug 20 '26

typescript-eslint 8.67.0 declares its peer range as typescript >=4.8.4 <6.1.0. npm currently has typescript at 7.0.2 on latest, with 6.0.3 as the last release of the old line. So on a project that has already moved to 7, the type-aware ESLint path does not install cleanly, and pinning the linter's TypeScript to 6.0.x is a workaround rather than a preference.

The two kinds of rule are worth separating when picking, because that decides how much of this touches you at all. Syntactic rules never load the compiler, which is why the Rust linters are unaffected by any of it. Type-aware rules need a real checker, and that is the part waiting on the native port to expose an API.

So the question splits in two. For syntactic linting it is mostly a speed comparison. For type-aware rules it is a version compatibility question right now, and that is the axis worth checking against your own tsconfig before switching anything.

1

u/KnifeFed Aug 20 '26

Oxlint works great with TS 7.

0

u/beavis07 Aug 20 '26

In a very very limited experiment recently I found that biome and oxlint are almost identically extremely fast, but oxfmt was a LOT slower than biome.

Do with that information what you will

0

u/maninas Aug 20 '26

I made a plugnplay linter + formater that covers virtually everything, so that I'll never have to deal with that madness on any new repo. Try @maninak/eslint-config

0

u/passionate_carkey Aug 21 '26

i am sorry.i am a starter to typescript.What is a linter?I have used eslint and oxlint in projects where i work.All i know them is they stop me from pushing my code to github until an unless i fix the typescript based practice or better practice like not having code complexity of more than 10 in a file,no unused variable,etc. So,are they the checker for typescript and overall code writing practices?

1

u/tbaklavas Aug 22 '26

Yes, but this is not typescript specific terminology.

A linter is a tool that allows you to define a set of syntax rules (e.g. spaces vs tabs for indent, use of semi-colons to terminate commands, same-line or new line curly braces for if/function statements etc). Many teams use a linter to enforce consistency across their codebase and setup their deployment pipelines to fail if the linter flags anything.

A formatter is a very similar tool that will read the set of rules and attempt to correct any issues it flags - eg it will convert tabs to spaces, add/remove semicolons, move curly braces to same or new line etc.

Once you get used to a well-configured linter/formatter it is very difficult to go back to manually enforcing these rules.

1

u/passionate_carkey Aug 22 '26

oh great.What is that makes oxlint better than oxlint?what are such features?

2

u/tbaklavas Aug 22 '26

I assume you mean oxlint vs eslint? In general there is no simple A is better than B when it comes to comparing linters. One has more plugins, another one is faster, another one has smaller footprint, another one has better syntax etc.

People prefer Oxlint in general because it is pretty much a drop in replacement for eslint and it’s faster than eslint.

I prefer biome because it is similarly fast and lints and formats with the same binary.

Having said that, you should be comfortable with using any of them, these are very simple tools that overall achieve the same result in the end.

-1

u/AsterYujano Aug 20 '26

Oxlint makes it fast and easy (cause eslint integration) Biome makes it fast.

Pick one of them 😅