Uploaded image for project: 'Rules Repository'
  1. Rules Repository
  2. RSPEC-4437

ReactJS class names should follow the ReactJS naming convention

    XMLWordPrintable

    Details

    • Type: Code Smell Detection
    • Status: Active
    • Resolution: Unresolved
    • Message:
      Rename this class to be compliant with the UpperCamelCase naming convention.
    • Highlighting:
      Hide

      Primary: Class name

      Show
      Primary: Class name
    • Default Severity:
      Minor
    • Impact:
      Low
    • Likelihood:
      Low
    • Default Quality Profiles:
      Sonar way
    • Targeted languages:
      JavaScript
    • Irrelevant for Languages:
      ABAP, C#, C, C++, Cobol, CSS, Flex, HTML, Java, Objective-C, PHP, PL/I, PL/SQL, Python, RPG, Swift, T-SQL, TypeScript, VB.Net, VB6, XML
    • Remediation Function:
      Constant/Issue
    • Constant Cost:
      1min
    • Analysis Scope:
      Main Sources

      Description

      Shared coding conventions allow teams to collaborate effectively. This rule checks that classes extending React.PureComponent or React.Component are named with UpperCamelCase (aka PascalCase).

      Noncompliant Code Example

      export default class my-super-component extends React.PureComponent { // Noncompliant
       ...
      }
      

      Compliant Solution

      export default class MySuperComponent extends React.PureComponent {
       ...
      }
      

        Attachments

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            alexandre.gigleux Alexandre Gigleux
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated: