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

'Unexpected an empty line before property "undefined"' #87

Closed
jamesarosen opened this issue Jul 9, 2019 · 7 comments
Closed

'Unexpected an empty line before property "undefined"' #87

jamesarosen opened this issue Jul 9, 2019 · 7 comments

Comments

@jamesarosen
Copy link
Contributor

jamesarosen commented Jul 9, 2019

Given this stylelint configuration:

'order/properties-order': [
  [
    'color',
    'font-size',
  ],
  {
    unspecified: 'bottom',
    emptyLineBeforeUnspecified: 'never',
  },
]

and the following SCSS:

.foo {
  color: blue;
  font-size: 12px;

  &__bar {
    color: purple;
  }
}

I get the following error:

   5:3  ✖  Unexpected an empty line before property "undefined"            order/properties-order
@jamesarosen jamesarosen changed the title Unexpected an empty line before property "undefined" 'Unexpected an empty line before property "undefined"' Jul 9, 2019
@hudochenkov
Copy link
Owner

Thank you for the report! I'll take a look in a few days.

@hudochenkov
Copy link
Owner

Indeed. Bug is happening when emptyLineBeforeUnspecified is specified.

@hudochenkov
Copy link
Owner

I've fixed some existing incorrect tests for emptyLineBeforeUnspecified and added more #90. Now we need to fix the code.

@njbraun would you like to help fix this option, please?

@njbraun
Copy link
Contributor

njbraun commented Jul 26, 2019

@jamesarosen I want to make sure we're capturing your issue correctly. From the example you gave, I'm potentially seeing 3 issues:

  1. The error message incorrectly identifies the &__bar { color: purple; } block as "undefined" Instead, the error message should read: 5:3 ✖ Unexpected an empty line before property "&__bar {" order/properties-order

  2. The error message 5:3 ✖ Unexpected an empty line before property "undefined" order/properties-order shouldn't include the word an between Unexpected and empty.

  3. The error itself is unexpected. You don't count the line &__bar { as an "unspecified" item, so this rule should not be active and the example you gave should pass stylelint without issue.

Let us know why this was originally filed.

@hudochenkov
Copy link
Owner

@njbraun there should not be any violations, because there are no unspecified properties.

@jamesarosen
Copy link
Contributor Author

I am specifically referring to (3)

@hudochenkov
Copy link
Owner

Fix released in stylelint-order@4.0.0. Happy New Year!

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

No branches or pull requests

3 participants