-
Notifications
You must be signed in to change notification settings - Fork 4
monorepo, eslint 설정
OriginJang edited this page Nov 12, 2019
·
7 revisions
npm install yarn --global
- root에서 yarn init 실행
yarn init
- monorepo 디렉토리 생성
mkdir server client
- monorepo init(server 디렉토리만)
cd server
yarn init
- root 디렉토리의 package.js 수정
{
...
workspaces: [server, client],
private: true,
...
}
-
vscode extensions에서 ESLint 설치
-
elint package 설치
root 디렉토리
yarn workspace server add eslint --dev
- .eslintrc.json
cd server
- command + shift + p 로 팔레트를 실행한 다음 create ESLINT Configuration 입력
- options
- How would you like to use ESLint? To check syntax, find problems, and enforce code style
- What type of modules does your project use? CommonJS (require/exports)
- Which framework does your project use? None of these
- Does your project use TypeScript? No
- Where does your code run? Node
- How would you like to define a style for your project? Use a popular style guide
- Which style guide do you want to follow? Airbnb (https://github.com/airbnb/javascript)
- What format do you want your config file to be in? JSON
- Would you like to install them now with npm? Yes
각각의 monorepo에 맞는 옵션을 적용한 eslint를 실행하기 위해서는 working directories에 repo를 설정해줘야한다.
./.vscode
{
"eslint.workingDirectories": ["server", "client"],
}
directory
root
|-.vscode
| |-settings.json
|
|-client
| |-.eslintrc.json
|
|-server
| |-.eslintrc.json
© BoostCamp - Try Catch
권기웅 mosball | 나영균 younguna | 장기원 OriginJang | 조정현 JeonghyunJo