๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ

๐Ÿ‘ฉ๐Ÿปโ€๐Ÿ’ป dev

Parsing error: ESLint was configured to run on `<tsconfigRootDir>/xxx` using `parserOptions.project`: /yyy/tsconfig.lint.json However, that TSConfig does not include this file

๋ชจ๋…ธ๋ ˆํฌ ๋ ˆํฌ์ง€ํ„ฐ๋ฆฌ ๊ตฌ์กฐ๋Š” ๋‹ค์Œ๊ณผ ๊ฐ™๋‹ค.

.github
.husky
apps
    ใ„ด storybook
    ใ„ด web
packages
    ใ„ด design-system
         ใ„ด .turbo
         ใ„ด dist
         ใ„ด node_modules
         ใ„ด src
         ใ„ด turbo
         ใ„ด  typings
         ใ„ด eslintrc.cjs
         ใ„ด package.json
         ใ„ด tsconfig.json
         ใ„ด tsconfig.lint.json

    ใ„ด eslint-config
    ใ„ด typescript-config
package.json
pnpm-lock.yaml
.npmrc
// ...์ƒ๋žต

 

๋ชจ๋…ธ๋ ˆํฌ๋กœ ํŒŒ์ผ์„ ๊ตฌ์„ฑํ•˜๊ณ  ์žˆ์—ˆ๊ณ , husky๋กœ precommit์— lint๋ฅผ ํ•˜๋„๋ก ์„ค์ • ์ค‘์— ๋‹ค์Œ๊ณผ ๊ฐ™์€ ์—๋Ÿฌ๊ฐ€ ๋ฐœ์ƒํ–ˆ๋‹ค.

 

๋ฌธ์ œ๋Š” TSConfig๊ฐ€ ์ด ํŒŒ์ผ์„ ํฌํ•จํ•˜๊ณ  ์žˆ์ง€ ์•Š๊ณ  ์žˆ๋‹ค๋Š” ๊ฒƒ์ด๋‹ค.

์ตœ์ƒ๋‹จ์—์„œ ์ปค๋ฐ‹์„ ํ•˜๊ธฐ ์ „, husky pre-commit์— prettier๋กœ formatํ•˜๊ณ  eslint๋กœ lint๋ฅผ ํ•˜๋„๋ก ์„ค์ •ํ•ด์ฃผ๊ณ ์ž ํ–ˆ๋‹ค.

packages/design-system์˜ lint๋Š” src์™€ turbo ๊ฒฝ๋กœ ์•„๋ž˜์˜ ํŒŒ์ผ๋“ค์— ํ•œ์— lint๋ฅผ ํ•˜๋„๋ก ์„ค์ •์ด ๋˜์–ด ์žˆ์—ˆ๊ธฐ ๋•Œ๋ฌธ์—

ํ•ด๋‹น ๊ฒฝ๋กœ๋ฅผ ์ถ”๊ฐ€ํ•ด์ค˜์•ผ ํ–ˆ๋‹ค. 

 

turborepo๋ฅผ ์ฒ˜์Œ ์จ๋ดค๋Š”๋ฐ, ์ข‹์€ ์ ์€ ์•„๋ฌด๋ž˜๋„ ์—๋Ÿฌ ๋กœ๊ทธ๊ฐ€ ์ž˜ ๋˜์–ด ์žˆ๋Š” ๊ฒƒ ๊ฐ™๋‹ค.

์นœ์ ˆํ•˜๊ฒŒ ํ•ด๊ฒฐ ๋ฐฉ๋ฒ•๋„ ์„ค๋ช…ํ•ด์ฃผ๊ณ  ์žˆ๋‹ค.

However, that TSConfig does not include this file. Either:
- Change ESLint's list of included files to not include this file
- Change that TSConfig to include this file 
- Create a new TSConfig that includes this file and include it in your parserOptions.project 

 

์˜ต์…˜ 1 : EsLint ์„ค์ • ํŒŒ์ผ์˜ include์— ํ•ด๋‹น ํŒŒ์ผ์ด ํฌํ•จ๋˜์ง€ ์•Š๋„๋ก ํ•˜๊ธฐ

์˜ต์…˜ 2 : TSConfig ํŒŒ์ผ์— include์— ํŒŒ์ผ ์ถ”๊ฐ€ํ•ด ์ฃผ๊ธฐ

์˜ต์…˜ 3 : TSConfig ํŒŒ์ผ์„ ์ƒˆ๋กœ ๋งŒ๋“ค๊ณ , ์ด ํŒŒ์ผ์„ ์ถ”๊ฐ€ํ•ด ์ฃผ๊ณ , parserOptions.project์—  ํฌํ•จํ•ด ์ฃผ๊ธฐ

 

๋‹ค์Œ๊ณผ ๊ฐ™์ด packages/design-system/tsconfig.lint.json์— ์˜ต์…˜ 2์—์„œ ์–ธ๊ธ‰ํ•œ ๋ฐ”์™€ ๊ฐ™์ด ๋ฆฐํŠธ๋ฅผ ํ•ด์ค„ ํด๋” ๊ฒฝ๋กœ๋ฅผ ์ถ”๊ฐ€ํ•ด ์ค€๋‹ค.

{
  "extends": "@tripie/typescript-config/react-library.json",
  "compilerOptions": {
    "outDir": "dist"
  },
  "include": ["src", "turbo", "typings"],
  "exclude": ["node_modules", "dist"]
}