꾸준히 성장하는 개발자

ESLint 본문

React

ESLint

ahleum 2022. 1. 22. 00:41

create-react-app으로 설치하면 기본적으로 설치가 된다

코드 스타일 (들여쓰기 등)을 공통적으로 스타일을 맞추기 좋다

 

모든 javascript 프로젝드에서 사용이 가능하다 

 

https://eslint.org/

 

ESLint - Pluggable JavaScript linter

Customize Preprocess code, use custom parsers, and write your own rules that work alongside ESLint's built-in rules. You can customize ESLint to work exactly the way you need it for your project.

eslint.org

 

 

파일을 작성하고

 

검사를 시행

 

터미널에     npx eslint index.js(파일명)       작성

 

검사한 내용을 고치고 싶다면 위에 보이는 것처럼 아까 작성한 구문에 --fix를 추가로 적어주면 된다.

npx eslint index.js(파일명) --fix  

 

 


이 플러그인을 깔아주면

틀린부분을 알려준다.  깔아놓자!! 

'React' 카테고리의 다른 글

husky , lint-staged  (0) 2022.01.23
Prettier  (0) 2022.01.22
[react] CDN, create-react-app 두가지 방법으로 사용하기  (0) 2022.01.21
Component Lifecycle  (0) 2022.01.21
react Event Handling  (0) 2022.01.14