I would like to set up an ESLint configuration globally so that I don't have to initialize it in every new project.
So, I proceeded to install ESLint and some related configurations globally using the following command:
npm install -g eslint eslint-config-airbnb eslint-plugin-import eslint-plugin-jsx-a11y eslint-plugin-react eslint-plugin-react-hooks
Once installed, I created my ESLint config file ~/.eslintrc.json with the following content:
{
"env": {
"browser": true,
"es6": true,
"node": true
},
"extends": [
"airbnb-base"
],
"rules": {
}
}
However, upon linting my JavaScript file, I encountered an error stating:
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".
Despite having the airbnb package among my global installations, the issue persisted. What could be missing? I aim to avoid installing individual ESLint plugins for each project.