ESLint Parsing error: "parserOptions.project" has been set for @typescript-eslint/parser. エラー
ViteでTypeScript + React + ESlint(airbnb) の環境構築をしている際に遭遇したエラー。
環境
エラー内容
.eslintrc.js
およびvite.config.ts
で下記エラーが出る。
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. (日本語訳) 解析エラー: "parserOptions.project" は @typescript-eslint/parser に設定されています。 このファイルはプロジェクト設定と一致しません: eslintrc.js このファイルは、提供されたプロジェクトの少なくとも1つに含まれている必要があります。
当該ファイルが、他のどのファイルからもimportされないことに関するエラーのよう。
それぞれ設定ファイルであり、importされないのは当然のためlint対象から除外する。
lint対象からの除外
.eslintignore
ファイルを作成し、当該ファイル名を記述する。
.eslintignore.js vite.config.js