FEB:)DAIN

[Parsing Error] 초기 세팅할때 Parsing error: Cannot read file '.../tsconfig.json' 에러가 발생했다면 본문

코딩/트러블 슈팅

[Parsing Error] 초기 세팅할때 Parsing error: Cannot read file '.../tsconfig.json' 에러가 발생했다면

얌2 2024. 4. 15. 21:32
728x90

https://stackoverflow.com/questions/64933543/parsing-error-cannot-read-file-tsconfig-json-eslint

 

Parsing error: Cannot read file '.../tsconfig.json'.eslint

The error Parsing error: Cannot read file '.../tsconfig.json'.eslint shows in all .ts files in the src folder including index.ts. I have no idea how to set up configs. The issue just shows a red li...

stackoverflow.com

 

위 링크에 들어가면 Parsing error를 해결하는 여러가지 방법들이 나오는데,

나는 그 중 아래 두 가지 방법이 문제 해결에 도움이 되었다.

 

1)

// .eslintrc.js

  extends: [ '...','@typescript-eslint/parser'],

2)

// .vscode/settings.json

{
  "eslint.workingDirectories": [
    {
      "mode": "auto"
    }
  ]
}

하지만 첫 번째 방법은 다른 사람의 코드에 영향을 주기에 .gitignore에 있는 .vscode 안 파일을 변경하는 두 번째 방법을 선택했다.

내가 선택한 두 번째 방법은 ESLint가 작업 디렉토리를 자동으로 결정하도록 설정하여 해결하는 방식이다. 이 설정을 사용하면 ESLint가 VS Code의 현재 작업 중인 파일이나 폴더의 위치를 기준으로 작업 디렉토리를 결정한다. 이는 ESLint가 적절한 프로젝트 환경에서 linting을 수행할 수 있도록 도와준다.

728x90