ESLint报错:Could not find config file.
如果你的ESLint的版本大于 8,同时使用 .eslinrc.js
和 .eslintignore
作为配置文件,且目前用的是 VSCODE ,就有可能遇到报错:
Could not find config file.
这个是因为 VSCode 中 ESLint 插件的配置 eslint.useFlatConfig
的问题,其默认值是空值导致 ESLint 默认使用 flat 的配置方式,在 VSCode 的配置文件里加上:
{
"eslint.useFlatConfig": false,
}
即可!