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

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

There is a newer version: 10.17.0.28100
Show newest version

Shared naming conventions allow teams to collaborate efficiently. This rule checks that all function names match a provided regular expression.

Noncompliant Code Example

With the default regular expression ^[a-z][a-zA-Z0-9]*$:

function DoSomething(){...}  // Noncompliant

Compliant Solution

function doSomething(){...}

Exceptions

This rule ignores React Functional Components, which are JavaScript functions named with a capital letter and returning a React element (JSX syntax).

function Welcome() {
  const greeting = 'Hello, World!';

  // ...

  return (
    <div className="Welcome">
      <p>{greeting}</p>
    </div>
  );
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy