Sharable config for ESlint
Install this config using NPM.
npm install -D @dootrix/eslint-config
Then in the .eslintrc.js file (or what ever you may call it)
// eslint-disable-next-line unicorn/prefer-module
module.exports = {
root: true,
env: {
node: true,
amd: true,
},
extends: ["@dootrix/eslint-config/javascript", "@dootrix/eslint-config/javascript/prettier"],
};Changing the values as you need to...
Options for setups are as follows. Note that prettier configs should always be
the last item to include (if you want it).
@dootrix/eslint-config/javascript
@dootrix/eslint-config/javascript/vue
@dootrix/eslint-config/javascript/prettier
@dootrix/eslint-config/typescript
@dootrix/eslint-config/typescript/react
@dootrix/eslint-config/typescript/prettier
Make sure you have ESLint extention installed and add the
following into the project's settings file (/.vscode/settings.json) (deleting
as appropriate).
{
"[typescript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[scss]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[json]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[vue]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"typescript.format.enable": false,
"editor.formatOnSave": true
}