9
kiki
5y

These are the rules that apply to all of my JS projects:
- 100% typescript, “any” is not allowed
- strict prettier with pre-commit hook
- no semicolons
- no braces around single argument of an arrow function
- tabs

Comments
  • 2
    The only thing I hate you for is the tabs part.
  • 2
    You are a good person
  • 9
    Same here but instead of no semicolons mandatory semicolon usage.
  • 0
    Absolutely support this. Although I have already seen an "any" type at work. But what is a pre-commit hook? Some automation before the commit?
  • 0
    @EdoPhoenix Whichever. I had a weird thing years ago where V8 mistook the next line for a continuation so I also use obligatory semicolons but, much like the whitespaces, the only unacceptable way is mixing them.
  • 1
    I think type checking should also be on that list. Typescript obviously cannot do anything for you at runtime, so if someone sneakily makes some changes to an API, then your running frontend may go tits up either way.
  • 1
    no semicolons?
    nahhh...
Add Comment