【发布时间】:2022-12-20 03:35:27
【问题描述】:
我想让一个 eslint 配置在全球范围内工作,这样我就不需要在每个项目中都初始化它。
然后我在全局安装了 eslint 和一些配置扩展。
npm install -g eslint eslint-config-airbnb eslint-plugin-import eslint-plugin-jsx-a11y eslint-plugin-react eslint-plugin-react-hooks
这是我的 eslint 配置文件~/.eslintrc.json
{
"env": {
"browser": true,
"es6": true,
"node": true
},
"extends": [
"airbnb-base"
],
"rules": {
}
}
但是当我检查我的 js 文件时出现错误
ESLint couldn't find the config "airbnb-base" to extend from. Please check that the name of the config is correct.
The config "airbnb-base" was referenced from the config file in "/home/molly/.eslintrc.json".
我错过了什么 ?我不想在每个项目中安装 eslint-plugin**
【问题讨论】:
标签: javascript typescript eslint eslintrc