우주선

eslint --fix found some errors ( Error: unreachable ) 본문

JavaScript

eslint --fix found some errors ( Error: unreachable )

선주우 2022. 10. 31. 18:05

신나게 커밋하려는데 Eslint가 오류를 뱉었다.

✖ eslint --fix found some errors. Please fix them and try committing again.

unreachable
Error: unreachable
  at CodePathState.popChoiceContext (/~내폴더~/node_modules/eslint/lib/code-path-analysis/code-path-state.js:444:23)

보니까 이 프로젝트에 설정된 eslint로 

nullish 병합 연산자(nullish coalescing operator) 즉 ?? 을 쓸 수 없었다

 

이슈글에서 보니 eslint 버전이 6.1.0이면 지원된다길래 package.json을 열었더니...

"@nuxtjs/eslint-config": "^1.0.1",
"@nuxtjs/eslint-module": "^1.0.0",
"babel-eslint": "^10.0.1",
"eslint": "^6.1.0",
"eslint-plugin-nuxt": ">=0.4.2",​

음... 6.1.0이상인데 ?

 

 

nuxtjs-eslint때문이 아닐까 추측하는데 기존 의존성이 깨질까봐 건드리기 무서웠다...ㅎ 시간도 없고...ㅎ 한 줄 쓰자고 npm 패키지 새로 다운받기도 싫었고...ㅎ 구구절절 핑계 대면서 그냥 ?? 을 안 쓰고 다른 방법으로 구현했다.

어쨌든 이 에러는 eslint버전과 nullish 병합 연산자 때문에 일어날 수도 있다는 것을 알았다. (찜찜한 결말!)

 

혹시 아신다면? 여기에 댓글을 ... (제발)  

 

Comments