eslint-config-bravissimo
This is the ESLint configuration for Bravissimo projects. It's based off Airbnb's style guide with a few customisations.Rules
The following rules apply in addition to (or instead of) the base Airbnb rules:- 2-space indentation including case clauses (
indent
)
No dangling commas (comma-dangle
)
Max line length of 120 chars, excluding URLs (max-len
)
Use thegenerator-star-spacing
rule fromeslint-plugin-babel
to enable support of async/await (see this comment)
Use theobject-shorthand
rule fromeslint-plugin-babel
to handle async functions correctly (note: this is an older version of the plugin that does not support the additional properties defined in the airbnb config) - Allow functions to be defined after they're used given they'll always be safely hoisted (
no-use-before-define
)
Ensure every function and method has a valid jsdoc comment (require-jsdoc
andvalid-jsdoc
)
Installation
$ npm install --save-dev \
eslint@^3.2.2 \
eslint-plugin-babel@^3.3.0 \
eslint-plugin-import@^1.12.0 \
eslint-config-bravissimo@^2.0.0 \
Usage
Add the following lines to yourpackage.json
:"eslintConfig": {
"extends": [
"bravissimo"
]
},
Alternatively, add the following to an .eslintrc
file in your project root:{
"extends": "bravissimo"
}