sonarjs/content-length
eslint-plugin-sonarjs
No autofixRecommended
eslint.config.js
export default [
{
rules: {
"sonarjs/content-length": "error",
},
},
];The documentation shows no incorrect example for this rule.
const form = new Formidable();
form.maxFileSize = 8000000; // Compliant: 8MBlet diskUpload = multer({
storage: diskStorage,
limits: {
fileSize: 8000000 // Compliant: 8MB
}
});let jsonParser = bodyParser.json(); // Compliant, when the limit is not defined, the default value is set to 100kb
let urlencodedParser = bodyParser.urlencoded({ extended: false, limit: "2mb" }); // CompliantExamples from the ESLint documentation.
sonarjs/content-length
eslint-plugin-sonarjs
export default [
{
rules: {
"sonarjs/content-length": "error",
},
},
];Oxlint does not have this rule.
Biome does not have this rule.
Objects should not be created to be dropped immediately without being used
Content security policy fetch directives should not be disabled
Regular expression quantifiers and character classes should be used concisely
Comma and logical OR operators should not be used in switch cases
Cross-Origin Resource Sharing (CORS) policy should be restricted to trusted origins