0.0.18 • Published 6 years ago
eslint-config-davemcc v0.0.18
eslint-config-davemcc
Get up and running quickly with:
- ESLint
- Prettier
- Typescript support
Installing
In an npm project run:
npx install-peerdeps --dev eslint-config-davemcc
Create a .eslintrc
file in the root of the project directory:
{
"extends": ["davemcc"],
// Override rules:
"rules": {
"lines-between-class-members": "on",
"prettier/prettier": [
"error",
{
"printWidth": 80,
"tabWidth": 2
}
]
}
}
Alternatively, put this object in package.json
under the property "eslintConfig"
.
VSCode
Add the following to VSCode settings.json:
// ESLint
"eslint.autoFixOnSave": true,
"eslint.validate": [
"javascript",
{
// Enable auto fix for .ts files too
"language": "typescript",
"autoFix": true
},
],
// Prettier
"prettier.disableLanguages": [
"javascript",
"typescript"
],
With the above settings, ESLint will run on save. If you have Prettier installed as a VSCode extensions for fixing e.g. .html files, that's fine, but make sure to include the above code.