Skip to content

Latest commit

 

History

History
131 lines (98 loc) · 1.69 KB

File metadata and controls

131 lines (98 loc) · 1.69 KB

at-function-named-arguments

Require named parameters in SCSS function call rule.

animation: animation($duration: 250ms) {
//
// Require or disallow this

Options

string: "always"|"never"

always

The following patterns are considered warnings:

.foo {
  animation: animation(250ms, 100ms, infinite);
}
.foo {
  animation: animation(250ms);
}
.foo {
  border: reset($value: 20, "bar", $color: #fff);
}

The following patterns are not considered warnings:

.foo {
  animation: animation($duration: 250ms);
}
.foo {
  animation: animation($duration: 250ms, $delay: 100ms, $direction: infinite);
}

never

The following patterns are considered warnings:

.foo {
  border: reset($value: 20);
}
.foo {
  animation: animation($duration: 250ms, $delay: 100ms, $direction: infinite);
}
.foo {
  border: reset($value: 20, "bar", $color: #fff);
}

The following patterns are not considered warnings:

.foo {
  animation: animation(250ms, 100ms, infinite);
}

Optional secondary options

"ignore": ["single-argument"]

Given:

{ "ignore": ["single-argument"] }

The following patterns are not considered warnings:

.foo {
  @include animation($duration: 250ms);
}
.foo {
  @include reset(20);
}

ignoreFunctions: ["/regex/", "string"]

Given:

["always", { ignoreFunctions: ["/^my-/i", "custom"] }];

The following patterns are not considered warnings:

.foo {
  border: custom(20, 30);
}
.foo {
  border: my-func(20, 30);
}
.foo {
  border: MY-FUNC(20, 30);
}