create vite@latest
를 사용해 React + TS 환경을 구축했을 경우.eslintrc.cjs
파일과vite.config.ts
파일에서 ESLint 오류가 발생하는 경우 해결하는 방법
.eslintrc.cjs
Parsing error: ESLint was configured to run on `<tsconfigRootDir>/.eslintrc.cjs` using `parserOptions.project`: /users/macrent/documents/github-repositories/todolist/tsconfig.json
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
See the typescript-eslint docs for more info: https://typescript-eslint.io/linting/troubleshooting#i-get-errors-telling-me-eslint-was-configured-to-run--however-that-tsconfig-does-not--none-of-those-tsconfigs-include-this-fileeslint
vite.config.ts
Parsing error: ESLint was configured to run on `<tsconfigRootDir>/vite.config.ts` using `parserOptions.project`: /users/macrent/documents/github-repositories/todolist/tsconfig.json
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
See the typescript-eslint docs for more info: https://typescript-eslint.io/linting/troubleshooting#i-get-errors-telling-me-eslint-was-configured-to-run--however-that-tsconfig-does-not--none-of-those-tsconfigs-include-this-fileeslint
.eslintrc.cjs
파일에 아래 속성을 추가한다.
/* eslint-env node */
module.exports = {
// ...
ignorePatterns: [".eslintrc.cjs", "vite.config.ts"],
};