All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.sonar.l10n.javascript.rules.javascript.S3723.html Maven / Gradle / Ivy

There is a newer version: 10.17.0.28100
Show newest version

This rule is deprecated, and will eventually be removed.

Why is this an issue?

Modern browsers ignore unneeded, trailing commas, so there are no negatives to having them unless you’re supporting an IE 8 application. Since they make adding new properties simpler, their use is preferred. This rule raises an issue when the last item in a multiline construct (array or object literal, import or export statement, function declaration or call) does not end with a trailing comma and does not lie on the same line as the closing curly brace, bracket or parenthesis.

Noncompliant code example

var joe = {
  fname: "Joe",
  lname: "Smith"      // Noncompliant
};

Compliant solution

var joe = {
  fname: "Joe",
  lname: "Smith",    // OK
};

var joe = {
  fname: "Joe",
  lname: "Smith"};   // OK




© 2015 - 2024 Weber Informatics LLC | Privacy Policy