ESLint rules according to Alex Guerrero's personal preference
These are the ESLint rules I use in my own projects. They are completely opinionated but they can serve as inspiration or as a starter point.
Install the configuration by running:
$ npm install --save-dev eslint eslint-plugin-promise eslint-config-alexguerrero
Once the eslint-config-alexguerrero
package is installed, you can use it by specifying alexguerrero
in the extends
section of your ESLint configuration.
{
"extends": "alexguerrero",
"rules": {
// Add here the rules you want to overwrite the rules of this config
}
}
There are several rules in the eslint:recommended
ruleset these rules are not opinionated about that you might want to enforce in your project.
To use this ESLint config in conjunction with ESLint's recommended rule set, extend them both, making sure to list alexguerrero
last:
{
"extends": [
"eslint:recommended",
"alexguerrero"
],
"rules": {
// Additional, per-project rules...
}
}
To see how the alexguerrero
config compares with eslint:recommended
, refer to the source code of rules placed into the rules folder.