이것저것

tsconfig 본문

카테고리 없음

tsconfig

곰태태 2020. 10. 27. 16:30
반응형
SMALL

 

typescriptlang.org

 

Typed JavaScript at Any Scale.

TypeScript extends JavaScript by adding types to the language. TypeScript speeds up your development experience by catching errors and providing fixes before you even run your code.

www.typescriptlang.org

위의 페이지에서 번역해서 명령어 참조하는게 좋다.

공식문서 handbook 부분을 처음부터 끝까지 읽어보는게 좋다.

what's new도 1.1부터 쭉 봐보면 typescript를 이해할수있다.(많다;;)

 

전에 js파일이랑 ts파일을 동시에 열면 에러가 떴었는데

tsconfig.json 파일을 만들어서 옵션을 넣어주면 에러가 안뜨게 할수있다.

라이브러리에 대한 설정파일이다.

 

lib 옵션에서는 "ES6", "ES2020", "ES2017"등이 있는데 6의 정식명칭은 ES2015이고 2015와 2017은 중요한 애들이다.

include는 어떤 파일을 컴파일 한것인지

exclude는 어떤 파일을 컴파일 하지 않을것인지

extends는 여러개의 ts파일들이 있을때 가져와서 쓰는..?? 아직 잘 모르겠지만 나중에 자세히 알려준다함

 

 

tsc -init

해주면 파일 생성해준다.

 

{
    "compilerOptions": {
      "noImplicitAny": true,
      "noImplicitThis": true,
      "noImplicitReturns": true,
      "strict": true,
      "lib":["ES6", "ES2020", "ES2017"]
    },
    "include": ["numberBaseball.ts"],
    "exclude": ["*.js"],
    "extends": ""
  }
반응형
LIST
Comments