Optional - Set format on save and any global prettier options
npm i -D eslint prettier eslint-plugin-prettier eslint-config-prettier eslint-plugin-node eslint-config-node
npx install-peerdeps --dev eslint-config-airbnb
{
"extends": ["airbnb", "prettier", "plugin:node/recommended"],
"plugins": ["prettier"],
"rules": {
"prettier/prettier": "error",
"no-unused-vars": "warn",
"no-console": "off",
"func-names": "off",
"no-process-exit": "off",
"object-shorthand": "off",
"class-methods-use-this": "off"
}
}
- ESLint Rules - https://eslint.org/docs/rules/
- Prettier Options - https://prettier.io/docs/en/options.html
- Airbnb Style Guide - https://github.com/airbnb/javascript
Airbnb flat config is still not supported by the
airbnb
andairbnb-base
so I suggest trying this one instead:eslint-config-airbnb-extended
. It’s really good, up-to-date, and supports new tools like import-x and stylistic. Plus, it has helpful CLI support too!Checkout: https://www.npmjs.com/package/eslint-config-airbnb-extended