0.0.2 • Published 4 years ago
eslint-config-thedaviddias v0.0.2
Table of Content
Installation
should be installed as one of your project's devDependencies
:
npm install --save-dev eslint-config-thedaviddias
You can install the peerDependencies
running the following command:
npx install-peerdeps --dev eslint-config-thedaviddias
Usage
Create the .eslintrc.js
and add the following extend:
module.exports = {
extends: 'thedaviddias',
rules: {
// you can override with you own rules here
},
}
"scripts": {
"lint": "npx eslint src/ --ext .js --max-warnings 0",
"lint:fix": "npx eslint --fix src/ --ext .js --max-warnings 0"
},
VSCode settings
Create a folder .vscode
at the root of your currrent project with a settings.json
file.
"editor.formatOnSave": true,
// turn it off for JS and JSX, we will do this via eslint
"[javascript]": {
"editor.formatOnSave": false
},
"[javascriptreact]": {
"editor.formatOnSave": false
},
// tell the ESLint plugin to run on save
"editor.codeActionsOnSave": {
"source.fixAll": true
},
// Optional BUT IMPORTANT: If you have the prettier extension enabled for other languages like CSS and HTML, turn it off for JS since we are doing it through Eslint already
"prettier.disableLanguages": ["javascript", "javascriptreact"],
Inspiration
I can't thanks enough @kentcdoodds and @wesbos for the inspiration and their estlint-config I used to build my own.
Licence
MIT
0.0.2
4 years ago