sonarjs/no-same-argument-assert
eslint-plugin-sonarjs
No autofixRecommended
eslint.config.js
export default [
{
rules: {
"sonarjs/no-same-argument-assert": "error",
},
},
];Assertions should not be given twice the same argument
const assert = require('chai').assert;
describe("test the same object", function() {
it("uses chai 'assert'", function() {
const expected = '1'
const actual = (1).toString()
assert.equal(actual, actual); // Noncompliant
});
});const assert = require('chai').assert;
describe("test the same object", function() {
it("uses chai 'assert'", function() {
const expected = '1'
const actual = (1).toString()
assert.equal(actual, expected);
});
});Examples from the ESLint documentation.
sonarjs/no-same-argument-assert
eslint-plugin-sonarjs
export default [
{
rules: {
"sonarjs/no-same-argument-assert": "error",
},
},
];Oxlint does not have this rule.
Biome does not have this rule.
Regular expressions should not contain multiple spaces
HTTP Referrer-Policy should not be set to an unsafe value
Methods should not contain selector parameters
Optional properties should not redundantly include 'undefined'
Static Assets should not serve session cookies