diff options
| author | syuilo <syuilotan@yahoo.co.jp> | 2019-04-17 16:59:39 +0900 |
|---|---|---|
| committer | syuilo <syuilotan@yahoo.co.jp> | 2019-04-17 16:59:39 +0900 |
| commit | bf71b311239478f779f42c63e30b2e694f6c25db (patch) | |
| tree | d58611ff636dc00eeb61bb6f74866fe32ccdfc0f /CONTRIBUTING.md | |
| parent | Fix error (diff) | |
| download | sharkey-bf71b311239478f779f42c63e30b2e694f6c25db.tar.gz sharkey-bf71b311239478f779f42c63e30b2e694f6c25db.tar.bz2 sharkey-bf71b311239478f779f42c63e30b2e694f6c25db.zip | |
Update CONTRIBUTING.md
Diffstat (limited to 'CONTRIBUTING.md')
| -rw-r--r-- | CONTRIBUTING.md | 36 |
1 files changed, 33 insertions, 3 deletions
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 6825225e0e..edc6244d39 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -46,10 +46,40 @@ Convert な(na) to にゃ(nya) Revert Nyaize ## Code style -### Use semicolon -To avoid ASI Hazard +### セミコロンを省略しない +ASI Hazardを避けるためでもある + +### 中括弧を省略しない +Bad: +``` ts +if (foo) + bar; +else + baz; +``` + +Good: +``` ts +if (foo) { + bar; +} else { + baz; +} +``` + +ただし**`if`が一行**の時だけは省略しても良い +Good: +``` ts +if (foo) bar; +``` + +### `export default`を使わない +インテリセンスと相性が悪かったりするため + +参考: +* https://gfx.hatenablog.com/entry/2017/11/24/135343 +* https://basarat.gitbooks.io/typescript/docs/tips/defaultIsBad.html -### Don't use `export default` Bad: ``` ts export default function(foo: string): string { |