본문 바로가기

Code/web-frontend

CRA Typescript strict of eslint

d타입스크립트가 적용된 CRA 프로젝트에서 Eslint를 수정해보려합니다.

 

아래 명령어로 CRA Typescript 버전을 생성

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

이렇게 간단한 컴포넌트

 

근데 저 빨강색 밑줄이 거슬린다. jsx에서는 잘만 썼는데..후..

저거는 tsconfig.json 에서 strict: true 로 설정되어있어서 그렇다. 저거 끄면 기존 처럼 쓸 수 있다. 

모든 eslint가 꺼지는 것은 아니다. 몇가지만 disabled 되는데 아래에 strict가 어떤것들을 설정하는지 자세히 알수 있다.

 

https://kovalevski.net/how-to-configure-tsconfigjson-typescript-strict-options/ 

 

How To Configure tsconfig.json: TypeScript Strict options

TypeScript is not just a superset of JavaScript with static types. It is also a quite configurable tool that can be used for different types of projects. One parameter or group of parameters that can be configured is strict. If you are not familiar with st

kovalevski.net