{ "extends":["plugin:@nx/react","../../.eslintrc.json"], "ignorePatterns":["!**/*"], "overrides":[ { "files":["*.ts","*.tsx","*.js","*.jsx"], // We set parserOptions.project for the project to allow TypeScript to create the type-checker behind the scenes when we run linting "parserOptions":{ "project":["apps/org/tsconfig(.*)?.json"] }, "rules":{ "@typescript-eslint/await-thenable":"error" } }, { "files":["*.ts","*.tsx"], "rules":{} }, { "files":["*.js","*.jsx"], "rules":{} } ] }
{ "extends":["plugin:@nx/react","../../.eslintrc.json"], "ignorePatterns":["!**/*"], "overrides":[ { "files":["*.ts","*.tsx","*.js","*.jsx"], // We set parserOptions.project for the project to allow TypeScript to create the type-checker behind the scenes when we run linting "parserOptions":{ "project":["lib/ui-component/tsconfig.*?.json"] }, "rules":{ "@typescript-eslint/await-thenable":"error" } }, { "files":["*.ts","*.tsx"], "rules":{} }, { "files":["*.js","*.jsx"], "rules":{} } ] }
다시 린트를 돌려보면 다음과 같은 에러 발생한다
1
Parsing error: ESLint was configured to run on `<tsconfigRootDir>/apps/org/jest.config.ts` using `parserOptions.project`
아무리 봐도 jest.config.ts가 include 되어있는데 자꾸 include 하란다. 그래서 tsconfig.json에 있는 exclude 목록에서 jest.config.ts를 제거해보니 정상동작함. 아무래도 include, exclude 둘다 되어있어서 충돌이 난게 아닐까 싶다.
성공!
prettier 설정
eslint의 prettier 설정으로 대체함.
eslint-plugin-prettier
eslint에서 prettier를 설정할 수 있게 해줌. nx에서 prettier가 있어서 충돌나니 prettier 제거해준 후 설치