반응형
실행할 때는 전혀 문제가 안되지만 상당히 거슬렸던 경고표시
Parsing error: cannot read file tsconfig.json
기본적으로 프로젝트의 parserOptions는 현재 작업 디렉토리 기준으로 확인되는데, eslint가 포함된 폴더와 다른 작업 디렉토리에서 실행하면 tsconfig.json @typescript-eslint/parser가 파일을 찾을 수 없다고 한다.
.eslintrc.js 에 tsconfigRootDir을 __dirname 으로 설정하면 위 경고가 사라진다.
parser: '@typescript-eslint/parser',
parserOptions: {
project: 'tsconfig.json',
tsconfigRootDir: __dirname, // 추가
sourceType: 'module',
},
참고 : https://stackoverflow.com/questions/64933543/parsing-error-cannot-read-file-tsconfig-json-eslint
반응형
'Backend' 카테고리의 다른 글
[Spring Boot]GlobalExceptionHandler (Feat. @ControllerAdvice) (0) | 2024.02.21 |
---|---|
[Nest.js]핫 리로딩(Hot Reload) 설정 (0) | 2022.09.12 |
[Nest.js(Node.js)]Naver Cloud Platform 으로 문자 서비스(SMS) API 구현 (0) | 2022.03.07 |
[Nest.js] TypeError: (0 , cookie_parser_1.default) is not a function (0) | 2022.02.09 |