It seems to be a little ritual that I have: when I onboard onto new projects I always meddle with the linting setup. I don't know why or how it happens, but it happens every time :D
This particular rabbit hole started when I noticed that, on some files, when I saved the file without making any changes, my editor would change the file. This made me realise that several files (eg. most of the changes you see in src/app) had not been committed to the repo with the appropriate styling (mostly prettier).
So the next step of the investigation took me to lint-staged and, lo and behold, this wasn't configured to run on typescript files - I found the culprit!
So, after realising this, I figured I could use the chance to extend the prettier and eslint config a bit with my own personal preferences, and then run the eslint and prettier configs on the whole repository manually.
I was doing this on my separate auth branch but figured it would be best to isolate all of this into its own branch to make it easier to review. So here it is.
To recap the things happening here:
Made sure lint-staged is running on appropriate files
Pulled more extensive eslint and tsconfig from my other personal projects for even more lint & type checks
Added prettier-plugin-tailwindcss to have a consistent order in class names
Added database.types.ts to eslintignore & prettierignore (because auto-generated)
Ran npx prettier --write . on the whole folder to fix existing style issues
It seems to be a little ritual that I have: when I onboard onto new projects I always meddle with the linting setup. I don't know why or how it happens, but it happens every time :D
This particular rabbit hole started when I noticed that, on some files, when I saved the file without making any changes, my editor would change the file. This made me realise that several files (eg. most of the changes you see in
src/app
) had not been committed to the repo with the appropriate styling (mostly prettier).So the next step of the investigation took me to lint-staged and, lo and behold, this wasn't configured to run on typescript files - I found the culprit!
So, after realising this, I figured I could use the chance to extend the prettier and eslint config a bit with my own personal preferences, and then run the eslint and prettier configs on the whole repository manually.
I was doing this on my separate auth branch but figured it would be best to isolate all of this into its own branch to make it easier to review. So here it is.
To recap the things happening here:
lint-staged
is running on appropriate filesprettier-plugin-tailwindcss
to have a consistent order in class namesdatabase.types.ts
to eslintignore & prettierignore (because auto-generated)npx prettier --write .
on the whole folder to fix existing style issues