sonarjs/no-exclusive-tests
eslint-plugin-sonarjs
SuggestionRecommended
eslint.config.js
export default [
{
rules: {
"sonarjs/no-exclusive-tests": "error",
},
},
];Exclusive tests should not be committed to version control
describe("MyClass", function () {
it.only("should run correctly", function () {
/*...*/
});
});describe("MyClass", function () {
it("should run correctly", function () {
/*...*/
});
});Examples from the ESLint documentation.
sonarjs/no-exclusive-tests
eslint-plugin-sonarjs
export default [
{
rules: {
"sonarjs/no-exclusive-tests": "error",
},
},
];Oxlint does not have this rule.
Biome does not have this rule.
Equality operators should not be used in "for" loop termination conditions
Function calls should not pass extra arguments
Test and suite titles should not be empty or whitespace-only
Switch cases should end with an unconditional "break" statement
Parameterized tests should not have empty datasets