npm install -g typescript // window인 경우
sudo npm install -g typescript // Mac인 경우
빠르게 설치 해줍시다!
물론, 이전에 node.js가 설치 되어있어야합니다.
tsconfig.json
{
"compilerOptions": {
"target": "es5",
"module": "commonjs",
}
}
아주 기본으로 쓰는 설정입니다. 아마 init을 통해 생성하면, 여러가지 옵션들이 주석처리된 상태로 생성되긴 합니다.
commonjs는 require 문법
es2015, esnext는 import 문법을 사용합니다.
{
"compilerOptions": {
"target": "es5",
"module": "commonjs",
"noImplicitAny": true, // any타입을 입력했을 때 에러띄워줌
"strictNullChecks": true // null,undefined 타입을 조작하면 에러
}
}
위 설정 대로 설정해도 좋습니다.
더 많은 설정,정보는 아래 링크를 참고해주세요
https://www.typescriptlang.org/tsconfig