- Avoid using
any
as much as possible.- If you want a type meaning "any object", use
Record<string, unknown>
instead. - If you want a type meaning "any value", you probably want
unknown
instead. - See typescript-eslint - ban-types.
- If you want a type meaning "any object", use
- Prefer using
interface
overtype
when possible. - Avoid needlessly typing the return value of a function if the compiler can infer it.
- Annotate arrays as
foos: Foo[]
instead offoos: Array<Foo>
.
Last active
December 7, 2022 20:15
-
-
Save alexilyaev/f97f0821a4aa8d4181fb7cf5f8339d08 to your computer and use it in GitHub Desktop.
TypeScript Guideliens
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment