0

저는 VSCode 1.18.1에서 eslint를 사용하고 VSCode에서 더 예쁜/예쁘 확장 0.26.0을 사용하고 있습니다. 내 VSCode 구성에서 내가 "prettier.eslintIntegration": true, 있습니다. 사용 내 의존성이 될이 같은 형식더 예쁜 + 줄 바꿈

"eslint": "^3.19.0", 
"eslint-config-airbnb-base": "^11.1.3", 
"eslint-plugin-import": "^2.2.0", 
일반적으로

예뻐-eslint :

다음
return somePromise.then(result => 
    someOtherPromise(result, { foo: 'bar' }) 
); 

나는 업그레이드 :

"eslint": "^4.11.0", 
"eslint-config-airbnb-base": "^12.1.0", 
"eslint-plugin-import": "^2.8.0", 

그리고이 지금처럼 예뻐-eslint가 포맷 파일 대신 :

return somePromise.then(result => 
    someOtherPromise(result, { foo: 'bar' })); 

이것은 사소한 예이지만 들여 쓰기가 몇 단계 깊숙이 들어가면 읽을 수 없게됩니다. 나는 옛날 스타일을 선호한다.

업그레이드 된 종속성을 사용하여 이전 서식 스타일을 구현할 수 있습니까?

답변

0

eslint-config-prettier의 규칙을 추가하여 문제를 해결할 수 있습니다. 내 .eslintrc.js에서

:

module.exports = { 
    extends: ["airbnb-base", "prettier"], 
    //... 
}