TypeScript

TypeScript/eslint 설정

용성 2021. 8. 30. 21:25

CRA와 TS를 같이 만드는 경우

npx create-react-app my-app --template typescript

 

CRA에서 TS를 추가하는 경우

npm install --save typescript @types/node @types/react @types/react-dom @types/jest

 

eslint 설치

npm install @typescript-eslint/eslint-plugin @typescript-eslint/parser eslint-config-prettier eslint-plugin-prettier prettier -D

 

.eslintrc 설정

{
  "parser": "@typescript-eslint/parser", 
  "extends": [ 
    "prettier"
  ],
  "plugins": [
    "prettier"
  ],
  "rules": {
   "prettier/prettier": [
    "error",
    {
      "endOfLine": "auto",
      "singleQuote": true,
      "parser": "flow"
    }
  ]
  }
}
728x90

'TypeScript' 카테고리의 다른 글

TypeScript Type  (0) 2021.12.27
TypeScript 시작  (0) 2021.08.21
타입 기본(Types)  (0) 2021.05.24
타입스크립트의 기능  (0) 2021.05.24
TypeScript 기본 문법 연습  (0) 2021.02.25