TS Series

공부의 기록·2022년 2월 5일
0

TypeScript

목록 보기
1/2
post-thumbnail

Introduce

본 문서는 2022년 2월 6일 에 작성되었습니다.

시리즈에 대한 전체적인 목차와 소개를 담고 있습니다.

Thoery

✅ Installation

npm i typescript -global
npm i tsc-watch

🤔 TypeScript ?

TypeScript=JavaScript+TypeTypeScript = JavaScript + Type

TypeScript 는 JavaScript 슈퍼셋 오픈소스 프로그래밍 언어입니다.

JavaScript 에 Type 이라는 개념이 도입되어, 안정성을 확보할 수 있다.

따라서 다음과 같은 상황에 TypeScript 를 사용하면 좋다.

  1. 버그를 최소화하고 싶을 때,
  2. 협업을 진행하고 싶을 때,
  3. 대규모 프로젝트를 진행하고 싶을 때,

🤔 Package.json Settings

# basic settings

"script": {
  "start": "node index.js"
}

# typescript settings

"script": {
  "start": "node index.js",
  "prestart": "tsc",
  "tsc": "tsc"
}

Error Lists

발생한 TypeScript Setting 에러를 모아두었습니다.

❌ error TS18003: [tsconfig.js]

error TS18003: No inputs were found in config file 'D:/파일까지의-경로/tsconfig.json'. Specified 'include' paths were '["index.ts"]' and 'exclude'

# Before

{
    "compilerOptions": {
        "module": "commonjs",
        "target": "ES2015",
        "sourceMap": true
    },
    "include": ["index.ts"],
    "exclude": ["node_modules"]
}

# After

{
    "compilerOptions": {
        "module": "commonjs",
        "target": "ES2015",
        "sourceMap": true
    },
    "include": ["./index.ts"],
    "exclude": ["./node_modules"]
}
profile
2022년 12월 9일 부터 노션 페이지에서 작성을 이어가고 있습니다.

0개의 댓글