Open yoanmalie opened 7 years ago
Hi @yoanmalie! I'm not sure I understand what you're trying to do. Do you want scss-lint to fail when a property is missing (omitted)?
@trotzig I want a warning in the console, when scss-lint find a property which is not ordered in the scss-lint.yml file.
With this alert, then i can add the missing properties to the PropertySortOrder.
Ah, okay. Thanks for explaining that.
By looking at the specs for this, it looks like we only report lints if ignore_unspecified
is disabled, and the unspecified properties appear in the middle somewhere. If they are listed at the bottom the check will pass. See https://github.com/brigade/scss-lint/blob/da9edb7a4cbade21eccef4b0dd41c1e10a249448/spec/scss_lint/linter/property_sort_order_spec.rb#L307 for context.
Can you verify that this is the behavior you're seeing too? If not, would you be willing to take a stab at fixing this in a PR?
Ignore_unspecified
is disabled by default. And that do not work, i've never seen an alert about an unspecified property :/
But in case, I have rewrote this rule in my scss-lint.yml, (see my first message), and it does not work either.
I'm not a developer, it would have been a pleasure to contribute to fix issues.
That's okay.
I'm trying to produce a repro case locally, but I can't seem to force the behavior you're describing. Perhaps you can help me out here?
⨠ echo "
↳ PropertySortOrder:
↳ enabled: true
↳ ignore_unspecified: false
↳ order:
↳ - display
↳ - position
↳ " > .scss-lint.yml
⨠ echo "
↳ .foo {
↳ display: block;
↳ top: 2px;
↳ position: absolute;
↳ }
↳ " > styles.scss
⨠ cat styles.scss | scss-lint
styles.scss:4:3 [W] PropertySortOrder: Properties should be ordered display, position, top
→ exit status: 1
⨠ scss-lint -v
scss-lint 0.52.0
Ok now i understand much better where unspecified properties going.
So my new question would be: It's could be nice if unspecified properties can be better visible in the warning.
I'm sorry about my poor english vocabulary, I have difficulty being understood sometimes.
It's could be nice if unspecified properties can be better visible in the warning.
Ah, that's a good idea!
I'll change the title of this issue to make it clearer what change we want. I don't have the bandwidth to take this on myself, so we'll have to rely on the open-source community to help out.
Hello,
I want an alert when a property specified in CSS file is omitted in the custom order on the
PropertySortOrder
key. But i can't keep it working. It look likeignore_unspecified
does nothing.Using scss_lint 0.52.0 on Ubuntu 16.04
With this scss-lint.yml config :