sonarjs/no-same-line-conditional
eslint-plugin-sonarjs
SuggestionRecommended
eslint.config.js
export default [
{
rules: {
"sonarjs/no-same-line-conditional": "error",
},
},
];if (condition1) {
// ...
} if (condition2) { // Noncompliant
//...
}if (condition1) {
// ...
} else if (condition2) {
//...
}if (condition1) {
// ...
}
if (condition2) {
//...
}Examples from the ESLint documentation.
sonarjs/no-same-line-conditional
eslint-plugin-sonarjs
export default [
{
rules: {
"sonarjs/no-same-line-conditional": "error",
},
},
];Oxlint does not have this rule.
Biome does not have this rule.
Assertions should not be given twice the same argument
Methods should not contain selector parameters
Regular expressions should not contain multiple spaces
Static Assets should not serve session cookies
HTTP Referrer-Policy should not be set to an unsafe value
Tests should not be skipped without providing a reason