Notice
Recent Posts
Recent Comments
Link
«   2025/06   »
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30
Archives
Today
Total
관리 메뉴

Studyyyyy

ESlint - Parsing error: Unexpected token '.' 본문

카테고리 없음

ESlint - Parsing error: Unexpected token '.'

manyYun 2024. 9. 5. 10:51

프로젝트 중간에 eslint를 추가해줬는데, 다른부분은 그렇다쳐도 

?.

이 문법이 쓰인곳에 자꾸 Parsing error: Unexpected token 이라는 에러를 띄웠다.

 

https://jhlee-dev.tistory.com/19

 

Parsing error: Unexpected token =eslint 해결하기

Class형 컴포넌트 안에 state 설정을 하는데 Parsing error: Unexpected token =eslint 라는 에러가 떴다. eslint가 낸 오류메시지. 현재 내 개발환경과 ESLint의 구문분석의 호환성 때문에 생긴 문제 ESLint가 ES6~7을

jhlee-dev.tistory.com

그래서 링크를 참조하여 babel-eslint를 추가했는데,

여기서 또 문제는 .eslintrc.js에 parser: "babel-eslint" 를 추가해주니

Strings must use singlequote 라는 오류가 또 떴다ㅠㅠ

 

이 문제는 rules에

'quotes': ['error', { singleQuote: true }]

를 추가해주면 해결된다. (https://stackoverflow.com/questions/57343517/how-to-disable-eslintprettier-prettier-single-quotes-error)