This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # This script install all npm dependencies for every sub projects. | |
| (cd web && npm ci) && | |
| (cd e2e && npm ci) | |
| (cd design-system && npm ci) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Item | Taiwan | U.S.A | |
|---|---|---|---|
| 第一次產檢週數 | 隨意 | 八週後 | |
| 超音波次數 | 每次都照 | 三次 (w12 /w20/ w36) | |
| Targaryen | Daenerys Targaryen | Dragonstone | |
| Greyjoy | Pyke | Euron Greyjoy |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { createStitches } from '@stitches/react'; | |
| export const { | |
| styled, | |
| css, | |
| globalCss, | |
| keyframes, | |
| getCssText, | |
| theme, | |
| createTheme, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash -x | |
| branch=$(git branch | sed -n -e 's/^\* \(.*\)/\1/p') | |
| project="$1" | |
| folder="$2" | |
| glob="$2/**/*.{ts,tsx}" | |
| app="$project/$glob" | |
| types="../../../../node_modules/@types/**/*.d.ts" | |
| # STEP 1 - format files in so prettier changes do not show up in diff because ts-migrate uses prettier |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
| { | |
| "compilerOptions": { | |
| "incremental": true, | |
| "rootDir": ".", | |
| "sourceMap": true, | |
| "declaration": false, | |
| "moduleResolution": "node", | |
| "emitDecoratorMetadata": true, | |
| "allowSyntheticDefaultImports": true, | |
| "jsx": "react", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* 一般型別 */ | |
| type A = "a" | "b" | "c"; | |
| type B = "b" | "c" | "d"; | |
| // Inferred Type: "b" | "c" | |
| type Intersection = A & B; | |
| /* 物件 */ | |
| type A = { | |
| a: number; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| type objProps = { | |
| a: object; // Useful as a placeholder. | |
| b: {}; // Can have any properties and values. | |
| c: { | |
| id: string; | |
| title: string; | |
| }; | |
| d: { | |
| id: string; | |
| title: string; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| type BasicComponent = { | |
| // Primitive data types 原始型別,可以是 boolean、number、string、null、undefined 以及 Symbol | |
| a: number, | |
| // Union Types,值可以為多種型別中的一種,以下可以是 number 或 string | |
| b: number | string, | |
| // Optional Properties 可有可無 | |
| c?: string, | |
| // Literal Type 明文型別,值本身就是型別,也就是 d 一定要等於 'Hello' | |
| d: 'Hello', | |
| // 特殊型別,包括 any、never |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // 這裡是用 type 引入但其實 RouteComponentProps 是 interface | |
| import type { RouteComponentProps } from 'react-router'; | |
| interface globalProps { | |
| history: RouteComponentProps['history']; | |
| matchUrl: string; | |
| }; | |
| interface someComponentProps extends globalProps { | |
| data: { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| type FunctionProps = { | |
| // Does not take any arguments. Does not return anything. | |
| onHover: () => void; | |
| // Takes a number. Returns nothing (e.g. undefined). | |
| onChange: (id: number) => void; | |
| // Takes an event that is based on clicking on a button. | |
| // Returns nothing. | |
| onClick(event: React.MouseEvent<HTMLButtonElement>): void; | |
| }; |
NewerOlder