sonarjs/null-dereference
eslint-plugin-sonarjs
No autofixRecommended
eslint.config.js
export default [
{
rules: {
"sonarjs/null-dereference": "error",
},
},
];Properties of variables with "null" or "undefined" values should not be accessed
if (x === undefined) {
console.log(x.bar); // Noncompliant; TypeError will be thrown
}The documentation shows no correct example for this rule.
Examples from the ESLint documentation.
sonarjs/null-dereference
eslint-plugin-sonarjs
export default [
{
rules: {
"sonarjs/null-dereference": "error",
},
},
];Oxlint does not have this rule.
Biome does not have this rule.
Non-existent operators '=+', '=-' and '=!' should not be used
"<object>" tags should provide an alternative content
Similar tests should be grouped in a single Parameterized test
Origins should be verified during cross-origin communications