I’m a web developer and I’m trying to consolidate one of our apps, that we decided to transform into a monorepository a few months ago. It’s composed of apps in Javascript and/or Typescript — 2 backends, 2 frontends and 4 shared utility packages in TS.
We start by only using npm workspaces
, without really thinking about uniforming our tsconfig and linter rules. Some apps are entirely in JS, with no linter applied. And when we have tsconfig and eslint files, it’s mostly copy/paste with no real consistency across our apps.
My initial goal is to force ourselves to code in TS, and enforce stricter rules, on any new code added in the apps. So, even in our JS only app, I would like to force the creation of TS files, with tsconfig + eslint stricter rules.
My ultimate goal would be to have unified and consistent tsconfig and eslint rules in our monorepo.
I tried to work on unified tsconfig first, but had to fix a lot of dependencies issues (even with the npm workspaces, some apps were not able to detect a shared package was built at times…). So I decided to implement Nx
first, to resolve this dependencies issue first.
It’s been working well so far, and now I have to go back to uniforming the tsconfig (I was thinking about having backend and frontend tsconfig files, extended by each app accordingly). To force ourselves to submit TS files, under stricter linter rules, I was thinking about using husky
with a pre-commit hook using stricter rules.
I’m sure a lot of devs here already tackled this kind of work. I would like to read your opinion about it, feedback and advices, stuff you tried that did not work, other practice you would strongly recommend… Anything to avoid sinking into a rabbit hole 🙂
Thank you very much and have a good day!
PS: I’m French, sorry if my English is not always clear.