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-plugin-html eslint-config-node
npx install-peerdeps --dev eslint-config-airbnb
{
"singleQuote": true,
"useTabs": true
}
{
"extends": ["airbnb", "prettier", "plugin:node/recommended"],
"plugins": ["prettier", "html"],
"settings": {
"html/html-extensions": ["edge"],
"html/report-bad-indent": "warn",
},
"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",
"no-empty-function": "warn"
},
"globals": {
"use": true
}
}
// Auto-save configs
"editor.formatOnSave": true,
// tell the ESLint plugin to run on save
"eslint.autoFixOnSave": true,
- ESLint Rules - https://eslint.org/docs/rules/
- Prettier Options - https://prettier.io/docs/en/options.html
- Airbnb Style Guide - https://github.com/airbnb/javascript