에러일지/React.js
[React] [eslint] ESLint configuration in .eslintrc.js is invalid: - Property "parser" is the wrong type (expected string/null but got `["@typescript-eslint","import"]`).
레오나르도 다빈츠
2023. 2. 14. 16:48
에러
Compiled with problems:
ERROR
[eslint] ESLint configuration in .eslintrc.js is invalid:
- Property "parser" is the wrong type (expected string/null but got `["@typescript-eslint","import"]`).
원인
나는 이렇게 설정했었다.
module.exports = {
parser: [
'@typescript-eslint', // @typescript-eslint/parser
'import', // eslint-plugin-import
],
}
array를 못받는 모양..
아래처럼 수정해주었다.
제발... 알고쓰자.........!!!!!!!!!!!!! 😭
module.exports = {
// ....
parser: '@typescript-eslint/parser', // 이렇게 수정
rules: {
// ....
'react/react-in-jsx-scope': 'off', // 추가
},
}
개인적으로 공부한 내용을 정리하는 블로그로
잘못된 개념을 게시하지않도록 주의하고 있으나 오류가 있을 수 있습니다.