Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
depends.
eslint makes most sense.
Though I'd recommend looking at e.g. editorconfig / checkstyle or similar alternatives to define a cross language configuration.
It will make stuff easier long-term. -
Parzi86632yI get yelled at for using 8 space indents in private projects because people apparently can't use their arrow keys anymore, so I've got the same problem in the other direction. I usually solve it by changing it to 8 \t's per indent, and let their editor handle it. it's no longer my problem.
-
hjk10156962yI keep forgetting that this is one of the major things I love about Go. We use tabs. As in the actual tab character. The thing that was designed for indentation. It's always consistent and everyone can set the width to their liking. I honestly don't know why the fuck every language changed to this multiple spaces bullshit. Back in the C days tabs where way more common.
Also Go comes with a build-in formatter so it's super easy to correct and reject wrongly formatted code. -
hjk10156962yFor formatting TS you can use "prettier"
We have it set up as an error in the PR on violation so it can never be merged.
For GitHub you can use https://github.com/marketplace/...
We use gitlab so need to integrate it differently but it's all fairly simple. -
Bibbit7371yGet those precommit hooks running. And whenever possible in a language: enforce tabs instead of spaces since those are easily configurable inside IDEs as mentioned before.
In comes the new developer messing the repository with unreadable two space indentation in our backend codebase. I can understand it being useful to keep code within the horizontal editor "viewport" for stuff like JSX, but otherwise it's really fucking ugly and feels like the code is not indented at all
We're not using any tools for automatically standardizing code style yet, what do you recommend? If it's at all relevant, our codebase is in TypeScript.
rant