Underscore (the character, not the library) specific linting rules
$ npm install eslint --save-dev
$ npm install eslint-plugin-no-underscore --save-dev
Add plugins
section and specify no-underscore
as a plugin>
{
"plugins": [
"no-underscore"
]
}
Enable the rule:
"rules": {
"no-underscore/no-underscore": "warn"
}
- allowConstants [bool], (ex.: API_URL)
- allowLeadingUnderscores [bool], (ex.: _myFancyLocalVariable)
- disallowValues [bool], (ex.: var a = 'abc_def';)
Example:
"rules": {
"no-underscore/no-underscore": ["warn", {
"allowConstants": true
}]
}