Skip to content

Hotfix/1.1.2 Add order/order rule exception#5

Closed
lusimeon wants to merge 3 commits intomasterfrom
hotfix/1.1.2
Closed

Hotfix/1.1.2 Add order/order rule exception#5
lusimeon wants to merge 3 commits intomasterfrom
hotfix/1.1.2

Conversation

@lusimeon
Copy link
Copy Markdown

@lusimeon lusimeon commented Jun 26, 2019

Hello,
This PR add an exception for @include for-each-breakpoints in order/order rule to prevent errors throw for this kind of cases :

  .flex {
    display: flex;
  }

  .flex-inline {
    display: inline-flex;
  }

  @include font-size('display-1);
  @include for-each-breakpoints using ($breakpoint) {
    .flex--#{$breakpoint} {
      display: flex;
    }

    .flex-inline--#{$breakpoint} {
      display: inline-flex;
    }
  }

The rule will match the first @include but not the second one.

Is it ok for you ?

@lusimeon lusimeon changed the title Hotfix/1.1.2 Hotfix/1.1.2 Add order/order rule exception Jun 26, 2019
@lusimeon lusimeon added the bug Something isn't working label Jun 26, 2019
@titouanmathis
Copy link
Copy Markdown
Collaborator

Could you provide an example of SCSS which throws an error with the configuration before your changes, and examples for SCSS which throws an error and SCSS which is valid after your changes?

You can follow the examples here: https://stylelint.io/user-guide/rules/font-family-no-duplicate-names/#options 😉

@titouanmathis titouanmathis self-requested a review July 1, 2019 09:38
Copy link
Copy Markdown
Collaborator

@titouanmathis titouanmathis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the bug you encountered @lusimeon is an edge case that can be fixed by adding a disable comment before the erroneous lines:

// stylelint-disable-next-line order/order
@include for-each-breakpoints using ($breakpoint) {
  // ...
}

@titouanmathis titouanmathis deleted the hotfix/1.1.2 branch July 1, 2019 09:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants