npm install eslint --save-dev를하면 devDependencies에 들어간다
그냥
npm install mocha하면 dependencies에 들어간다
"author": "~~",
:dependencies": {
"mocha": "^8.1.3"
},
"devDependencies":{
"eslint": "^7,=.8.1"
}
package.json에서 확인할 수 있다.
이렇게 분리하는 이유는 실행만할 사람한테는 필요없는 node?툴?들을 깔 필요가 없기 때문
(dependencies는 실행에 필요한 dependencies, devDependencies는 실행과 개발에 필요한 dependencies)
npm install -g eslint로 전역(global)에 eslint를 설치하면
npx eslint형식이 아니라 그냥
eslint로 실행시킬 수 있다.
하지만 버전마다 다른 점이 있기 때문에
프로젝트마다 적절한 버전을 파일에 깔아줘서 관리해주는게 좋다.
npm ls --depth=0 로 현재 폴더?에 설치된 dependencies를 확인할 수 있다
npm ls -g --depth=0 로 전역(global)에 설치된 dependencies를 확인할 수 있다
ESLint의 User guide에 있는 6가지
Getting Started
...
는 읽어두는게 좋다
읽어두면 ESLint기능은 다 다룰 수 있을 것