sasstools / sass-lint

Pure Node.js Sass linting
MIT License
1.77k stars 532 forks source link

[sass] Empty space between blocks between @each and class #930

Open Uelb opened 7 years ago

Uelb commented 7 years ago

What version of Sass Lint are you using? 1.9.1

Please include any relevant parts of your configuration My config file

options:
  formatter: stylish
files:
  include: '**/*.s+(a|c)ss'
rules:
  # Extends
  extends-before-mixins: 2
  extends-before-declarations: 2
  placeholder-in-extend: 0

  # Mixins
  mixins-before-declarations: 2

  # Line Spacing
  one-declaration-per-line: 2
  empty-line-between-blocks: 2
  single-line-per-selector: 2

  # Disallows
  no-attribute-selectors: 0
  no-color-hex: 0
  no-color-keywords: 2
  no-color-literals: 2
  no-combinators: 0
  no-css-comments: 2
  no-debug: 1
  no-disallowed-properties: 0
  no-duplicate-properties: 2
  no-empty-rulesets: 2
  no-extends: 0
  no-ids: 2
  no-important: 2
  no-invalid-hex: 2
  no-mergeable-selectors: 2
  no-misspelled-properties: 2
  no-qualifying-elements: 0
  no-trailing-whitespace: 2
  no-trailing-zero: 2
  no-transition-all: 2
  no-universal-selectors: 0
  no-url-protocols: 0
  no-vendor-prefixes: 2
  no-warn: 1
  property-units: 0

  # Nesting
  force-attribute-nesting: 2
  force-element-nesting: 2
  force-pseudo-nesting: 2

  # Name Formats
  class-name-format: 2
  function-name-format: 2
  id-name-format: 0
  mixin-name-format: 2
  placeholder-name-format: 2
  variable-name-format: 2

  # Style Guide
  attribute-quotes: 2
  bem-depth: 0
  border-zero:
    - 2
    -
      convention: none
  brace-style: 2
  clean-import-paths: 2
  empty-args: 2
  hex-length:
    - 2
    -
      style: long
  hex-notation:
    - 2
    -
      style: uppercase
  indentation: 2
  leading-zero: 2
  max-line-length: 0
  max-file-line-count: 0
  nesting-depth: 1
  property-sort-order: 2
  pseudo-element: 2
  quotes: 2
  shorthand-values: 2
  url-quotes: 2
  variable-for-property: 2
  zero-unit: 2

  # Inner Spacing
  space-after-comma: 2
  space-before-colon: 2
  space-after-colon: 2
  space-before-brace: 2
  space-before-bang: 2
  space-after-bang: 2
  space-between-parens: 2
  space-around-operator: 2

  # Final Items
  trailing-semicolon: 2
  final-newline: 2

What did you do? Please include the actual source code causing the issue.

// left-padded, right-padded, top-padded, bottom-padded
@each $position in $positions
  .#{$position}-padded
    padding-#{$position}: $normal-padding

// Error here
.vertically-padded
  @extend .top-padded
  @extend .bottom-padded

.horizontally-padded
  @extend .left-padded
  @extend .right-padded

.padding
  @extend .vertically-padded
  @extend .horizontally-padded

What did you expect to happen? No error

What actually happened? Please include any error messages given to you by Sass Lint. Error : Space expected between blocks empty-line-between-blocks On the line just before .vertically padded

If you're using a IDE plugin have you tried the CLI too? Using Sublime Text, but have tried the CLI too, and it fails the same way.

More details I can put any number of empty lines between the end of the each block and the class but it still fails

DanPurdy commented 7 years ago

Thanks for the report, this seems to be related to an issue we were having with our AST, but this should be fixed in the next release of that so I'll check it then!

👍

chengyin commented 6 years ago

Hi there,

Sorry to reply this rather old issue. I think this is still an issue, is it? In my experience, empty lines are mixin, each, for are all unrecognized, leading to false positives.

Will this be fixed? Besides // sass-lint:disable-line empty-line-between-blocks is there a workaround?

Thank you.