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

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

There is a newer version: 10.20.0.29356
Show newest version

This rule is deprecated, and will eventually be removed.

Why is this an issue?

Shared naming conventions allow teams to collaborate effectively. This rule raises an issue when the brace-style is not respecting the convention setup in parameter:

Noncompliant code example

Using the parameter default (1tbs):

if (condition)
{                                                      //Noncompliant
  doSomething();
}                                                      //Noncompliant
else {
  doSomethingElse();
}

Compliant solution

if (condition) {                                   //Compliant
  doSomething();
} else {                                           //Compliant
  doSomethingElse();
}

Exceptions

  • Object literals appearing as arguments can start on their own line.
functionWithObject(
   {                                                 //Compliant
        g: "someValue"
   }
);
  • When blocks are inlined (left and right curly braces on the same line), no issue is triggered.
if(condition) {doSomething();}                       //Compliant




© 2015 - 2024 Weber Informatics LLC | Privacy Policy