Linting and Formatting with Prettier 💅, built on top of Airbnb linting config.
npm install eslint-config-pavo --save-dev
Create a .eslintrc
file.
Add this configuration to extend:
{
"extends": "eslint-config-pavo"
"rules": {
// Your projects overrides.
}
}
You can layer multiple configurations depending upon your projects type:
{
"extends": ["eslint-config-pavo", "eslint-config-pavo/<config-name>"]
}
Additional configs available are:
- react
- jest
Running the linter via scripts defined in package.json
"scripts": {
"lint": "./node_modules/.bin/eslint src",
"lint:fix": "npm run lint -- --fix",
}
Then on the command line:
npm run lint
npm run lint:fix
Extensions:
Sample .vscode/settings.json
config:
{
"eslint.options": {
"configFile": ".eslintrc",
"parserOptions": {
"ecmaVersion": 6,
"sourceType": "module"
}
},
"eslint.enable": true,
"prettier.eslintIntegration": true,
"editor.renderWhitespace": "all",
"editor.trimAutoWhitespace": true,
"editor.formatOnSave": true,
"prettier.singleQuote": true,
"prettier.stylelintIntegration": true,
"prettier.trailingComma": "all"
}