Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve documentation of "always-multi-line" in at-rule-name-newline-after #2273

Closed
davegomez opened this issue Jan 20, 2017 · 6 comments
Closed
Labels
status: ready to implement is ready to be worked on by someone type: documentation an improvement to the documentation

Comments

@davegomez
Copy link

davegomez commented Jan 20, 2017

Describe the issue. Is it a bug or a feature request (new rule, new option, etc.)?

I think there's a bug the rule, it shows an error even when the snippet complies with it. It doesn't happen with all the @mixin at-rules but only with these specially long and deeply nested rules that you can find in the Flexbox Grid SCSS code.

Which rule, if any, is this issue related to?

at-rule-name-newline-after

What CSS is needed to reproduce this issue?

@mixin columns(
  $selector: $column-selector,
  $properties: $column-properties,
  $columns: $column-count,
  $queries: $queries
) {
  @each $size in $sizes {
    @include queries($size, $queries) {
      @for $i from 0 through $columns {
        @if ($i == 0) {
          #{$selector}#{$block-delimiter}#{$size} {
            @content;

            @include autoWidth();
          }
        }

        @else {
          #{$selector}#{$block-delimiter}#{$size}#{$modifier-delimiter}#{$i} {
            @content;

            @each $prop in $properties {
              @include percentWidth($prop, $columns, $i);
            }
          }
        }
      }
    }
  }
}

What stylelint configuration is needed to reproduce this issue?

{
  "rules": {
    "at-rule-name-newline-after": "always-multi-line"
  }
}

Which version of stylelint are you using?

7.7.1

How are you running stylelint: CLI, PostCSS plugin, Node API?

CLI with stylelint scss/**/*.scss --syntax scss and IDE/Editor plugins

Does your issue relate to non-standard syntax (e.g. SCSS, nesting, etc.)?

Yes, it's related to SCSS syntax.

What did you expect to happen?

No errors to be flagged.

What actually happened (e.g. what warnings or errors you are getting)?

The following errors were flagged:

scss/_fg-grid.scss
 118:6  ✖  Expected newline after at-rule name "@mixin"   at-rule-name-newline-after
@hudochenkov
Copy link
Member

The rule works like expected.

@mixin columns(
  $selector: $column-selector,
  $properties: $column-properties,
  $columns: $column-count,
  $queries: $queries
) {}

After at-rule name mixin and before at-rule's block {} there are multiple lines. You can check examples in docs.

I think we should improve description for this rule. It's clear from examples what this rule checks, but it's not — from a text.

@hudochenkov hudochenkov added the type: documentation an improvement to the documentation label Jan 20, 2017
@jeddy3
Copy link
Member

jeddy3 commented Jan 21, 2017

The rule works like expected.

Agreed.

I think we should improve description for this rule.

Agreed. Currently, the docs say:

There must always be a newline after at-rule names in multiline-line at-rule blocks.

It's the "at-rule blocks" bit that is off.

Any idea what the bit between at-rule name and the opening brace is called?

@jeddy3 jeddy3 changed the title at-rule-name-newline-after flagging nonexistent errors Improve documentation of "always-multi-line" in at-rule-name-newline-after Jan 21, 2017
@jeddy3 jeddy3 added the status: ready to implement is ready to be worked on by someone label Jan 21, 2017
@hudochenkov
Copy link
Member

Any idea what the bit between at-rule name and the opening brace is called?

For @media it's called media query list. PostCSS AST calls it params. I propose to use “parameters list”.

@jeddy3
Copy link
Member

jeddy3 commented Jan 21, 2017

I propose to use “parameters list”.

SGTM. It's called group rule body for conditional group rules - so going with something generic like "parameters list" sounds good to me.

@davidtheclark
Copy link
Contributor

davidtheclark commented Jan 21, 2017 via email

@jeddy3
Copy link
Member

jeddy3 commented Jan 30, 2017

Done in #2304

@jeddy3 jeddy3 closed this as completed Jan 30, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: ready to implement is ready to be worked on by someone type: documentation an improvement to the documentation
Development

No branches or pull requests

4 participants