@@ -5,7 +5,7 @@ toc_min_heading_level: 2
55toc_max_heading_level : 2
66---
77
8- import { Chip , MainTitle , Rule , TableOfContents } from ' @site/src/components' ;
8+ import { MainTitle , Note , Rule , TableOfContents } from ' @site/src/components' ;
99import { UseDocumentTitle } from ' @site/src/hooks' ;
1010
1111<UseDocumentTitle >TypeScript Style Guide</UseDocumentTitle >
@@ -77,10 +77,10 @@ Being expressive and keeping types as **narrow as possible** brings benefits to
7777
7878As rule of thumb, explicitly declare a type when it help narrows it.
7979
80- <Chip >
80+ <Note >
8181 Just because you don't need to add types, doesn't mean you shouldn't. In some cases explicit type declaration can
8282 increase code readability and intent.
83- </Chip >
83+ </Note >
8484
8585``` ts
8686// ❌ Avoid - Don't explicitly declare a type, it can be inferred.
@@ -346,11 +346,11 @@ TypeScript offers two options for type definitions - `type` and `interface`. As
346346
347347All types must be defined with ` type ` alias <Rule href = ' https://typescript-eslint.io/rules/consistent-type-definitions/#type' />.
348348
349- <Chip >
349+ <Note >
350350 Consider using interfaces if developing a package that can be further extended, team is more comfortable working with
351351 interfaces etc. In such case disable lint rule where needed e.g. using type unions (type Status = 'loading' | 'error')
352352 etc.
353- </Chip >
353+ </Note >
354354
355355``` ts
356356// ❌ Avoid interface definitions
@@ -392,10 +392,10 @@ app.listen(process.env.PORT, () => {...}
392392
393393Array types must be defined with generic syntax <Rule href='https://typescript-eslint.io/rules/array-type/#generic' />.
394394
395- <Chip >
395+ <Note >
396396 As there is no functional difference between 'generic' and 'array' definition, feel free to set the one your team
397397 finds most readable to work with.
398- </Chip >
398+ </Note >
399399
400400` ` ` ts
401401// ❌ Avoid
0 commit comments