The conversation

Lessons learnedExperience excerpt · English

Just tangentially related, but a few days ago I did a quick analysis on lint/format options for a …

Just tangentially related, but a few days ago I did a quick analysis on lint/format options for a TypeScript project and I ended up picking eslint and prettier over BiomeJS. The main reason was eslint/prettier are a bit more battle tested and according to Gemini Pro, Biome is still adding new features to catch up to eslint/prettier which makes me feel it will be a bit less stable for now. But what I wanted to comment on actually was eslint and how it nudged me down the path of ESM support. I had to fight and fight to get it to work with my Typescript project. The resolution proposed by the tool was strongly biased towards re-structuring my project away from commonjs modules towards the newer ESM. But when I started down that rabbit hole I found it frustratingly hostile to TypeScript based projects. I was playing whack-a-mole between my package.json, tsconfig, my vite config, my eslint config. Most of it had to do with ts-node and the esm module loader (or something). Eventually it wanted me to rename all of my imports with .js extensions? …

Original discussionMigrating a JavaScript Project from Prettier and ESLint to BiomeJS61 source comments · at import
2

Community replies 0

No community replies yet. Add your perspective.

Replies from the source 2

Direct replies available in this import. Original-language excerpts.

SU

ESM is actually quite simple. The problem is just that people don't know the basics and tools are encumbered by years of cruft and varying behavior. Check out how many "module" and "moduleResolution" behaviors TypeScript alone has. The trick is to start fresh and to know the basics: - use type=module - import with extensions - use a sensible shared tsconfig (this is the hard part) - don't use junk tools like webpack and jest

Full original
DH

I went through exactly what you went through and by god it was frustrating. Eventually I did get stuff to work, but in the process I became an expert in a bunch of tools that I never wanted to be an expert in. I just wanted to write my business logic :') It makes me long for Java tooling. To top it all off, I don't think could've done a better job than the people responsible for this complexity. > What did we learn from all this? > I don't know. > Well I don't know either. > I guess to not do it again...fuck if I know what we did in the first place I guess eventually all tools will converge to a de-facto mixed module/commonjs module resolution standard which roughly matches what tsx (the ts-node replacement, not the file extension) does.

Full original
Continue on Hacker News

Respect different perspectives. Share concrete experiences.

Sign in to post, reply, repost, and quote.