React app에서 eslint를 사용하려는데 빨간줄이 마구마구 떴다.
그걸 해결하는 방법은
eslint에 가서,
module.exports = {
extends: ['airbnb-base'],
rules: {
'linebreak-style': 0,
'no-console': 'off',
},
};
module.exports = {
extends: [
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended',
],
parser: '@typescript-eslint/parser',
plugins: ['@typescript-eslint'],
overrides: [
{
files: ['*.js', '*.jsx'],
rules: {
'@typescript-eslint/explicit-function-return-type': 'off',
},
},
],
};
이렇게 추가해준다.
터미널에서 추가
npm i typescript eslint parser
[ESLint] Parsing error: Unexpected token (tistory.com)
[ESLint] Parsing error: Unexpected token
ESLint를 돌리는데 Parsing error: Unexpected token 라는 에러가 계속 떴습니다. 알아보니 ESLint의 기본 parser는 Espree로, 기본적으로 ECMA 버전이 5로 설정되어있기 때문에 그 이후 문법이나 Typescript 문법은 pa
r4bb1t.tistory.com
'[Dev] 🎯Self Study' 카테고리의 다른 글
[프로젝트] 시작할 때, 순서와 각종 오류 해결하기 (0) | 2023.01.27 |
---|---|
[React] 기본 세팅부터, 코드 스니펫 (0) | 2023.01.13 |
[오류 기록] Gulp-SASS. JS - SyntaxError , CSS 및 JS MIME type 오류 해결 (0) | 2022.12.19 |
[Notion] 노션 입문하기 (대시보드와 단축키) (0) | 2022.10.31 |
[Git 오류해결] Git & VScode에서, push 오류 해결하기 (0) | 2022.10.29 |