sonarjs/in-operator-type-error
eslint-plugin-sonarjs
No autofixRecommended
eslint.config.js
export default [
{
rules: {
"sonarjs/in-operator-type-error": "error",
},
},
];"in" should not be used with primitive types
var x = "Foo";
"length" in x; // Noncompliant: TypeError
0 in x; // Noncompliant: TypeErrorvar x = new String("Foo");
"length" in x; // true
0 in x; // true
"foobar" in x; // falseExamples from the ESLint documentation.
sonarjs/in-operator-type-error
eslint-plugin-sonarjs
export default [
{
rules: {
"sonarjs/in-operator-type-error": "error",
},
},
];Oxlint does not have this rule.
Biome does not have this rule.
Lifecycle hooks should not be interleaved with test cases or nested suites
Functions should be called consistently with or without "new"
"indexOf" checks should not be for positive numbers