본문 바로가기

■ Web개발/기타등등

ESlint module 에러. Parsing error

Parsing error: "parserOptions.project" has been set for @typescript-eslint/parser. The file does not match your project config: .eslintrc.js. 

The file must be included in at least one of the projects provided.eslint

 

 

이런식으로 에러가 떳다.

아래의 링크를 참조해서 오류를 고쳤는데.. 3가지 방법이 있다

 

https://github.com/nestjs/nest/issues/4900

 

eslint: Parsing error: "parserOptions.project" has been set for @typescript-eslint/parser. · Issue #4900 · nestjs/nest

Here is the fix #4900 (comment) Bug Report I installed nest and start new project. and there is a problem with eslint: in .eslint.js I got error Parsing error: "parserOptions.project" has...

github.com

1. eslintrc.js 를 eslintrc.ts로 변경

2. "createDefaultProgram" : true를 parserOptions에 추가 (parserOptions는 eslintrc.js 안에 module.exports 안에 만들어준다)

parserOptions: {
    "project": "./tsconfig.json",
    sourceType: "module",
    tsconfigRootDir: __dirname,
    //"createDefaultProgram": true
  },

3. ignorePatterns: ['.eslintrc.js'], 를 추가해준다

 

 

현재 tslint에서 eslint로 변경중인데.. 뭔가 복잡하다.