Re:Starting a TypeScript Project in 2021
by meheleventyone on Wednesday April 21, 2021 @10:38AM
(#26890231)
I’m aware of the difference just wondering what benefits people have found. Catching == versus === is a good one.
Re:Starting a TypeScript Project in 2021
by ponyous on Wednesday April 21, 2021 @12:30PM
(#26891817)
import order, empty function bodies, leading underscores in different scenarios (if you have such conventions), sort object keys (not just alphabetically, but by use, eg. shorthands last { name: 'Jim', surname }...)
There is some overlap and it's not as crucial to have a good linter as it used to be.
Re:Starting a TypeScript Project in 2021
by GORRILA on Wednesday April 21, 2021 @11:09AM
(#26890653)
Two common rules I like to enforce are no nested ternaries and no unused variables.
tsconfig's noUnusedLocals can help you with the last one.
And it allows you to opt out when needed by starting the variable with an underscore, which is much nicer than eslint-disable-next-line...
That's configurable in the rule though.
https://eslint.org/docs/rules/no-unused-vars#varsignorepatte...
Generally, linting is things that are valid in the language, but still better to do otherwise.
[1] https://eslint.org/docs/rules/