ESLint 找不到要扩展的配置“google”。请检查配置名称是否正确

Med*_*305 22 firebase eslint google-cloud-functions

我正在尝试在 firebase 上部署云功能。我已从 osx 终端成功登录到 firebase CLI。当我去部署时,它会恢复这个错误。

Oops! Something went wrong! :(

ESLint: 7.19.0

ESLint couldn't find the config "google" to extend from. Please check that the name of the config is correct.
Run Code Online (Sandbox Code Playgroud)

小智 31

这是因为你没有安装

\n
Would you like to install them now with npm? \xc2\xb7 No / Yes\n
Run Code Online (Sandbox Code Playgroud)\n

您可以再次尝试配置 json .eslint 或者您可以这样做

\n
npm install eslint-config-google --save-dev\n
Run Code Online (Sandbox Code Playgroud)\n


小智 5

如此处所述: https: //eslint.org/docs/user-guide/configuring/configuration-files#using-a-configuration-from-a-plugin

属性extends值可以包括:

  • plugin:
  • 包名称(可以省略前缀,例如 的react缩写eslint-plugin-react
  • /
  • 配置名称(例如,recommended

意思是,如果您使用 google 插件扩展您的配置,如下所示.eslintrc.yml

extends:
  - google
Run Code Online (Sandbox Code Playgroud)

你必须安装它: npm install eslint-config-google --save-dev


小智 0

您很可能没有安装 eslint,因此请尝试通过运行以下命令来安装它:

npm install eslint-config-eslint --save-dev