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

Autofix not working #175

Open
sethjwilliamson opened this issue Apr 20, 2023 · 3 comments
Open

Autofix not working #175

sethjwilliamson opened this issue Apr 20, 2023 · 3 comments

Comments

@sethjwilliamson
Copy link

Hi, not sure if I've read documentation wrong, if I've set it up wrong, or there's an actual issue with the plugin. I've been trying to get autofix to work but it's only showing that errors are there. --fix does not fix the issues. I also want to note that the issues from the base stylelint autofixing is working.

Here is my .stylelintrc.json:

{
  "extends": [
    "stylelint-config-standard"
  ],
  "plugins": [
    "stylelint-order"
  ],
  "rules": {
    "property-no-vendor-prefix": null,
    "order/properties-alphabetical-order": true
  }
}

The command I run is
stylelint "**/*.css" --fix

And the response is

src/App.css
 209:3  ✖  Expected box-sizing to come before width                     order/properties-alphabetical-order
 327:3  ✖  Expected grid-column to come before grid-row                 order/properties-alphabetical-order
 333:3  ✖  Expected grid-row to come before position                    order/properties-alphabetical-order
 334:3  ✖  Expected grid-column to come before grid-row                 order/properties-alphabetical-order
 335:3  ✖  Expected background-color to come before grid-column         order/properties-alphabetical-order
 ...
 
20 problems (20 errors, 0 warnings)
@hudochenkov
Copy link
Owner

What is the CSS that is not fixed?

@omar-koala
Copy link

Hi, I've been experiencing the same issue of the plugin autofixing not working and have discovered that the problem is caused by having a /* stylelint-disable */ directive present anywhere in the file (even if stylelint is later re-enabled), my solution for now was to move the conflicting block of code to a separate file and exclude that file from stylelint completely.

@seyanaracore
Copy link

seyanaracore commented Dec 11, 2023

change "extends" priority
example:
extends: ['stylelint-config-standard-scss', 'stylelint-config-clean-order'],

or:

const { getConfig } = require('stylelint-config-clean-order/src/config');

const cleanOrderRules = getConfig({ severity: 'error' }).rules;

and

rules: { ...cleanOrderRules, ...other-rules}

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

4 participants