[eslint] Error: Unexpected token 'export'
웹 (WEB)/에러해결 2020. 11. 21. 21:46

참고 : https://hoilzz.github.io/webpack/11-eslint-prettier/ eslint의 parser가 공식적으로 ES 표준만을 지원하기 때문에, ES6~7 파싱 시 문제가 생긴다. 따라서, .eslintrc.js 파일의 export default를 module.export로 변경하기 export는 ES6 syntax이고, module export는 commonJS syntax이다. babel-eslint 설치 후 .eslintrc.js에 "parser": "babel-eslint",추가하기 두 방법 중 하나를 사용하면 된다.