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

The plugin does not do a thing #22

Open
soullivaneuh opened this issue Sep 6, 2019 · 4 comments
Open

The plugin does not do a thing #22

soullivaneuh opened this issue Sep 6, 2019 · 4 comments

Comments

@soullivaneuh
Copy link

With this css:

h1 {
  position: absolute;
  display: block;
  float: right;
  color: black;
  background-color: blue;
  border: 1px black solid;
}

This configuration (basically copy/pasta).

{
  "extends": [
    "stylelint-config-standard",
    "stylelint-config-rational-order"
  ],
  "plugins": [
    "stylelint-order",
    "stylelint-config-rational-order/plugin"
  ],
  "rules": {
    "order/properties-order": [],
    "plugin/rational-order": [true, {
      "border-in-box-model": false,
      "empty-line-between-groups": true,
    }]
  }
}

And the command:

stylelint --config config/.stylelintrc --fix fixtures/main.css

Strictly nothing happen.

@vdkrasny
Copy link

vdkrasny commented Sep 12, 2019

It looks like your CSS file has already been sorted according to the plugin settings.
Try to reorder rules and run the command again to make sure the plugin works.

@rgranger
Copy link

same issue here :

I have this minimal config :

{
  "extends": [
    "stylelint-config-standard",
    "stylelint-config-sass-guidelines",
    "stylelint-config-rational-order"
  ],
  "rules": {
    "selector-class-pattern": ["[a-z]",{
      "resolveNestedSelectors": true
    }],
    "max-nesting-depth": [2, {}]
  }
}

When i run stylelint, I get the following output :

image

When I then run stylelint --fix, I have no output from styleint (like when all the warnings have been fixed). But there is no change in the files. And then when I rerun stylelint, I get the previous errors again

@rgranger
Copy link

Weirdly, when i had this line to the config :

{
  "extends": [
    "stylelint-config-standard",
    "stylelint-config-sass-guidelines",
    "stylelint-config-rational-order"
  ],
  "rules": {
    "order/properties-alphabetical-order":  [false], // <-- This line
    "selector-class-pattern": ["[a-z]",{
      "resolveNestedSelectors": true
    }],
    "max-nesting-depth": [2, {}]
  }
}

The stylelint --fix works as expected. But then I get warnings from order/properties-alphabetical-order whereas it should be disabled by the config... Weird.

@rgranger
Copy link

Ok, so after looking it up, it's not "[false]" to disable alphabetical-order, but "null".

So with this config :

{
  "extends": [
    "stylelint-config-standard",
    "stylelint-config-sass-guidelines",
    "stylelint-config-rational-order"
  ],
  "rules": {
    "order/properties-alphabetical-order":  null,
    "selector-class-pattern": ["[a-z]",{
      "resolveNestedSelectors": true
    }],
    "max-nesting-depth": [2, {}]
  }
}

The --fix is working as expected. But I don't understand why I have to add this line manually. Shouldn't the plugin do it for me ?

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

No branches or pull requests

3 participants