sonarjs/no-implicit-global
eslint-plugin-sonarjs
No autofixRecommended
eslint.config.js
export default [
{
rules: {
"sonarjs/no-implicit-global": "error",
},
},
];function f(){
i = 1; // Noncompliant; i is global
for (j = 0; j < array.length; j++) { // Noncompliant; j is global now too
// ...
}
}function f(){
var i = 1;
for (let j = 0; j < array.length; j++) {
// ...
}
}Examples from the ESLint documentation.
sonarjs/no-implicit-global
eslint-plugin-sonarjs
export default [
{
rules: {
"sonarjs/no-implicit-global": "error",
},
},
];Oxlint does not have this rule.
Biome does not have this rule.
Return values from functions without side effects should not be ignored
Assertions comparing incompatible types should not be made
Functions should not have identical implementations