Josh Goldberg joins Nick, Chris & a very nasally-sounding KBall for a fun conversation around TypeScript ESLint. They discuss why we need ESLint when we have TypeScript, some useful rules in typescript-eslint, how it works, and a few hot takes along the way!
Josh Goldberg: Itâs a great question, statement. I actually know â Iâm not clear on the origins technically of TypeScript ESLint; I think James Henry started it. There were a few different efforts to create some similar project. Now the maintainer crew is James Henry, Brad Zacher, a person whose real name I donât know and never seen a photo of, an enigma called Armano2, and myself.
TSLint - yes, it was the linter for TypeScript. It took a very different strategy from TS ESLint. Instead of working on top of ESLint, which allows it to reuse a lot of the infrastructure and rules such as the React Hooks rules that are very good and popular, it is a complete reimplementation, a separate project specifically for TypeScript. I should say âwasâ, because it was archived in 2019, or some similar year.
[28:10] I actually was a maintainer on TSLint when it was killed. I helped kill it. I wrote TSLint to ESLint config, which converts your TSLint config to ESLint⌠And actually, I felt a lot of joy in killing my old â the first major project that Iâd maintained.
Two issues with Palantir being the corporate sponsor of the project⌠Although they did a good job of not pushing any corporate interests or whatnot, the name Palantir has a lot of negative associations, especially since 2016, Trump got elected and Palantir was what many believe to be the wrong side of history. And there was a great moment where - Iâm not gonna name names, but some well-known JavaScript community member started posting âTSLint, brought to you by fascistsâ on the GitHub issues page⌠Which was weird for me, since I have never associated with Palantir. AnywayâŚ
The second issue was that Palantir is a corporate sponsor, and they are a sole sponsor, whereas ESLint is much more community-run and funded. So ESLint was getting features at a much more rapid pace.
In general, also, why would you have two linters? Thatâs a lot of maintenance burden. Every time one linter got a feature - normally ESLint - the other one would have to scramble to get it, too. If you had a React plugin, or JSX accessibility, or Angular lint rules or whatnot, youâd then have to implement it in the other.
So now TypeScript ESLint, as of - I forget if it was 2020 or 2019, or 2018, some year several years ago now, took over from ESLint and has all the features that you would expect from a modern linter, plus the ability to use TypeScript-specific type information⌠Which actually gives it a huge leg up in power over just vanilla ESLint rules.
We can locate your code, understand your types, whether itâs JS code with checkJs/allowJs, or TypeScript itself, and we can make really good, informed decisions on the code, and give you really nice, specific, powerful editor complaint squiggles as a result.