4 ms·
> I don't want to rewrite in TypeScript, because I believe the core of ESLint should be vanilla JS why though?
by AbuAssar 4y ago
> I don't want to rewrite in TypeScript, because I believe the core of ESLint should be vanilla JS
why though?
- redox99 4y agoThe fact that they would use JSDoc type annotations and tsc instead of just typescript seems insane to me.
- have_faith 4y agoYeah, surely in some hypothetical future it's not that much work to simply go back to plain JS from TS if they're worried about some sort of lock-in. Seems like you might as well just write it in TS then if it's relatively trivial to eject if needed.
- adamddev1 4y agoYa I am also perplexed about how people keep suggesting using jsdoc instead of TypeScript. Is it just to avoid the tooling?
- NateEag 4y agoI think it's to maximize potential contributor base. JS is the front-end browser language. That's its origin story and it almost certainly will always have that job, because of web browser backwards compatibility. That's why it's so universally known / used / understood. Once you target TypeScript you're suddenly looking at a much smaller set of devs who know it, and you're married to a language that's effectively owned by a single company (MS, to boot). You can get decent gains in type-checking by writing JSDoc and using tsc in your build process without adding much friction for new contributors.
- tonto 4y agoI think its more that eslint at its core does not support typescript and they want to run the eslint tool theyre developing over the eslint codebase. It's hard to argue with this but it doesnt seem like the greatest outcome
- madeofpalk 4y agoI would guess that more people know how to write Typescript than annotate with JSDoc.
- ohbtvz 4y agoThe kind of people who'd be willing to contribute to eslint are very probably not afraid of writing in typescript.
- tytho 4y agoFrom personal experience, you don’t ever “just use TypeScript”. You have to install plugins, adapters, parsers for every other tool (linters, formatters, bundlers) to also make them work with TypeScript. Adding TypeScript into the mix increases the number of dependencies (dev or not) dramatically. If you use the jsdoc flavor of TypeScript, you only need to install the one dependency. Not saying it’s the best reason, but a reason nonetheless.
- robby_w_g 4y agoOver the weekend, I converted an app from JS + Create React App to Typescript + Parcel v2. The typescript tooling was extremely simple to setup with only a few added packages... until I had to setup eslint. That's when I had to install a half dozen plugins, adapters, parsers, etc like you said. Granted, the linked eslint rewrite seems to have plans to make the typescript linting tooling simpler. However, I might end up switching to Rome in the meantime just for simpler dependency management.
- Aeolun 4y agoRome is very nice right now. My linting finishes in 50ms, as it’s supposed to, instead of minutes in eslint. Of course they don’t have nearly the same amount of rules, but we’ll get there.
- robby_w_g 4y agoMy project currently pulls in the airbnb rules, which in my opinion has too many rules. It might be nice to start from a clean slate, I'll give Rome a shot next weekend
- satvikpendem 4y agoJust the other day I read this thread on Reddit about the link above and this thread stood out to me. This person uses TypeScript files to define types, then uses JSDoc to import the types into JS. They said they didn't want a build tool but I agree, it seemed insane to me. https://old.reddit.com/r/javascript/comments/z4lwlo/complete_rewrite_of_eslint_github_discussion_by/ixtmt3r/?context=99 https://old.reddit.com/r/javascript/comments/z4lwlo/complete...
- echeese 4y agoProbably so they can run it through ESLint