sonarjs/no-reference-error
eslint-plugin-sonarjs
No autofix
eslint.config.js
export default [
{
rules: {
"sonarjs/no-reference-error": "error",
},
},
];var john = {
firstName: "john",
show: function() { console.log(firstName); } // Noncompliant: firstName is not defined
}
john.show();var john = {
firstName: "john",
show: function() { console.log(this.firstName); }
}
john.show();Examples from the ESLint documentation.
No tracked preset enables this rule, so it has no reach yet.
None of the tracked presets enable this rule. Turn it on with the config below.
sonarjs/no-reference-error
eslint-plugin-sonarjs
export default [
{
rules: {
"sonarjs/no-reference-error": "error",
},
},
];Oxlint does not have this rule.
Biome does not have this rule.
Increment (++) and decrement (--) operators should not be used in a method call or mixed with other operators in an expression
Test and hook callbacks should use a single completion style