Skip to content
Snippets Groups Projects
Unverified Commit bf71b311 authored by syuilo's avatar syuilo
Browse files

Update CONTRIBUTING.md

parent 9399a44c
No related branches found
No related tags found
No related merge requests found
......@@ -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 {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment