We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4f454b5 commit bae1b9dCopy full SHA for bae1b9d
1 file changed
skills/react-container-presentation-component/references/typescript-and-scss-rules.md
@@ -3,9 +3,36 @@
3
## TypeScript Rules
4
5
- Do not use `any`.
6
+
7
+ ```ts
8
+ // Bad
9
+ const handler = (e: any) => {};
10
11
+ // Good
12
+ const handler = (e: React.ChangeEvent<HTMLInputElement>) => {};
13
+ ```
14
15
- Use `type` for props instead of `interface`.
16
17
18
19
+ interface ButtonProps {
20
+ label: string;
21
+ }
22
23
24
+ type ButtonProps = { label: string };
25
26
27
- Explicitly annotate function return types.
-- Prefer `@` alias imports and avoid deep relative imports.
28
29
30
31
+ const getLabel = () => "hello";
32
33
34
+ const getLabel = (): string => "hello";
35
36
37
## SCSS Rules
38
0 commit comments