# 이제 없애야할 나쁜 TypeScript 습관들

> Clean Markdown view of GeekNews topic #3685. Use the original source for factual precision when an external source URL is present.

## Metadata

- GeekNews HTML: [https://news.hada.io/topic?id=3685](https://news.hada.io/topic?id=3685)
- GeekNews Markdown: [https://news.hada.io/topic/3685.md](https://news.hada.io/topic/3685.md)
- Type: news
- Author: [xguru](https://news.hada.io/@xguru)
- Published: 2021-02-04T09:17:22+09:00
- Updated: 2021-02-04T09:17:22+09:00
- Original source: [startup-cto.net](https://startup-cto.net/10-bad-typescript-habits-to-break-this-year/)
- Points: 15
- Comments: 3

## Topic Body

1. strict 모드를 사용하지 않는 것

2. 디폴트 값을 || 로 정의 하는 것

ㅤ→ㅤ??를 쓰거나, 파라미터 단위 폴백 정의할 것

3. any를 타입으로 쓰는 것

ㅤ→ unknown 으로 교체할 것

4. val as SomeType

ㅤ→ 타입가드 함수로 체크할 것

5. 테스트에서 as any 사용하는 것

6. Optional 속성

7. 한글자 Generic

ㅤ→ 이름만으로 설명가능한 풀 타입 네임 사용

8. Non-boolean boolean 검사

9. !! 연산자

10. != null

## Comments



### Comment 4404

- Author: kbumsik
- Created: 2021-02-04T23:49:32+09:00
- Points: 1

다른 언어 코드에서 !! 이걸 봐서 이게 뭔가 하고 물었더니 최근 자바스크립트 주로 하다보니 무의식적으로 했다고...ㅋ

### Comment 4402

- Author: bichi
- Created: 2021-02-04T11:20:48+09:00
- Points: 2

infer 랑 never 잘쓰기는  빠졌네요

### Comment 4401

- Author: bichi
- Created: 2021-02-04T11:19:47+09:00
- Points: 1

아뉘 공식 빌트인 타입도 any 쓰는 마당에

any 와 unknown의 용도를 분명이 할 것이 맞지요
