no-underscore-dangle
eslint
No autofix
eslint.config.js
export default [
{
rules: {
"no-underscore-dangle": "error",
},
},
];let foo_;
const __proto__ = {};
foo._bar();const _ = require('underscore');
const obj = _.contains(items, item);
obj.__proto__ = {};
const file = __filename;
function foo(_bar) {};
const bar = { onClick(_bar) {} };
const baz = (_bar) => {};Examples from the ESLint documentation.
no-underscore-dangle
eslint
export default [
{
rules: {
"no-underscore-dangle": "error",
},
},
];no-underscore-dangle
eslint plugin · suspicious
{
"rules": {
"no-underscore-dangle": "error"
}
}nursery/noDanglingUnderscore
nursery · since 2.6.3
{
"linter": {
"rules": {
"nursery": {
"noDanglingUnderscore": "error"
}
}
}
}Require return statements to either always or never specify values
Disallow variable declarations from shadowing variables declared in the outer scope