Skip to content

Latest commit

 

History

History
133 lines (101 loc) · 1.78 KB

function-parentheses-newline-inside.md

File metadata and controls

133 lines (101 loc) · 1.78 KB

Pattern: Incorrect newline inside function parentheses

Issue: -

Description

Require a newline or disallow whitespace on the inside of the parentheses of functions.

  a {
    transform: translate(
      1,             /* ↑ */
      1              /* ↑ */
    );               /* ↑ */
  }                  /* ↑ */
/** ↑                   ↑
 * The newline inside these two parentheses */

Examples

"always"

There must always be a newline inside the parentheses.

The following patterns are considered problems:

a { transform: translate(1, 1); }
a { transform: translate(1,
  1
  ); }

The following patterns are not considered problems:

a {
  transform: translate(
    1, 1
  );
}
a {
  transform: translate(
    1,
    1
  );
}

"always-multi-line"

There must always be a newline inside the parentheses of multi-line functions.

The following patterns are considered problems:

a { transform: translate(1,
  1) }

The following patterns are not considered problems:

a { transform: translate(1, 1) }
a { transform: translate( 1, 1 ) }
a {
  transform: translate(
    1, 1
  );
}
a {
  transform: translate(
    1,
    1
  );
}

"never-multi-line"

The following patterns are considered problems:

a {
  transform: translate(
    1, 1
  );
}
a {
  transform: translate(
    1,
    1
  );
}

The following patterns are not considered problems:

a { transform: translate(1, 1) }
a { transform: translate( 1, 1 ) }
a { transform: translate(1,
  1) }

Further Reading