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

class-name-format not working with variable interpolation #952

Closed
ncoden opened this issue Nov 14, 2016 · 6 comments
Closed

class-name-format not working with variable interpolation #952

ncoden opened this issue Nov 14, 2016 · 6 comments
Labels

Comments

@ncoden
Copy link
Contributor

ncoden commented Nov 14, 2016

I am using gulp-sass-lint v1.3.2 with sass-lint v1.10.2.

For the following code:

    // Static (unresponsive) row gutters
    @each $breakpoint, $value in $grid-column-gutter {
      &.#{$gutter}-#{$breakpoint} {
        > .#{$column} {
          @include grid-col-gutter($value);
        }
      }
    }

(from foundation-sites / grid/_classes.scss)

The following warning is throw on &.#{$gutter}-#{$breakpoint}:

   59:19  warning  Class '.-' should match regular expression /([a-z0-9]+-?)+/  class-name-format

The sass-lint config is :

...
  class-name-format:
    - 1
    - convention: '([a-z0-9]+-?)+'
...

(from .sass-lint.yml)

Sass-lint seems to ignore variable interpolation, and so consider the variable name as .-. I expect class-name-format to consider the class name as \.(.*)\-(.*) for the regex check.

@DanPurdy DanPurdy added the bug label Nov 15, 2016
@DanPurdy
Copy link
Member

I'll double check this, shouldn't be throwing any issues here.

@coreyjv
Copy link

coreyjv commented Apr 26, 2017

Is there an update on this bug?

@ncoden
Copy link
Contributor Author

ncoden commented May 2, 2017

Poke @DanPurdy

@DanPurdy
Copy link
Member

Sorry for this insane delay, life getting in the way of things... I will check this in #1131 as we should be ignoring interpolated classnames in the next release.

@DanPurdy
Copy link
Member

Yup, just run it in the tests this doesn't throw the error anymore. WIll mark it as fixed with that PR but give it a final test before we release it. Sorry again for the delay.

@DanPurdy DanPurdy closed this as completed Oct 3, 2017
@DanPurdy
Copy link
Member

DanPurdy commented Oct 3, 2017

Released in 1.12.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants