Skip to content

コードにスペース追加 #159

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 14, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions styleguide.md
Original file line number Diff line number Diff line change
@@ -188,13 +188,13 @@ enum Color {
**悪い**

```typescript
let foo = {x:123,y:undefined};
let foo = { x: 123, y: undefined };
```

**良い**

```typescript
let foo:{x:number,y?:number} = {x:123};
let foo: { x: number, y?: number } = { x: 123 };
```

* 一般的に `undefined`を使用してください\(代わりに`{valid:boolean,value?:Foo}`のようなオブジェクトを返すことを検討してください\)
@@ -294,7 +294,7 @@ const foo: string = "hello";

## 配列 {#配列}

* 配列に`foos:Array<Foo>`の代わりに`foos:Foo[]`として配列にアノテーションをつけます。
* 配列に`foos: Array<Foo>`の代わりに`foos: Foo[]`として配列にアノテーションをつけます。

> 理由:読みやすい。TypeScriptチームによって使用されています。脳が`[]`を検出するように訓練されているので、何かが配列であることを知りやすくなります。