SonarQube JavaScript
  1. SonarQube JavaScript
  2. SONARJS-54

Rule: Avoid use of parentheses where not required by syntax or semantics

    Details

    • Type: New Feature New Feature
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.0
    • Component/s: None
    • Labels:
      None
    • Number of attachments :
      0

      Description

      <p>Avoid use of parentheses where not required by syntax or semantics</p>

      <pre>
      function sayHello() {
      var a = typeof (37); // NOK
      var b = typeof 38;

      var c = {};
      c.a = a;
      c.b = b;
      delete (a); // NOK
      delete b;

      void 0;
      void (1); // NOK
      }
      </pre>

        Activity

        Hide
        Eriks Nukis added a comment -

        Implemented and pull request https://github.com/SonarCommunity/javascript/pull/1 created

        Show
        Eriks Nukis added a comment - Implemented and pull request https://github.com/SonarCommunity/javascript/pull/1 created
        Hide
        Evgeny Mandrikov added a comment -

        Has been merged.

        Show
        Evgeny Mandrikov added a comment - Has been merged.
        Hide
        Freddy Mallet added a comment -

        Replace the violation message "Avoid use of parentheses where not required by syntax or semantics" by "Those parentheses are useless"

        Show
        Freddy Mallet added a comment - Replace the violation message "Avoid use of parentheses where not required by syntax or semantics" by "Those parentheses are useless"
        Hide
        Evgeny Mandrikov added a comment -

        Done.

        Show
        Evgeny Mandrikov added a comment - Done.
        Hide
        Freddy Mallet added a comment -

        Manually tested !

        Show
        Freddy Mallet added a comment - Manually tested !

          People

          • Assignee:
            Unassigned
            Reporter:
            Anonymous
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: