Roots Discourse

Stylelint Automatic Fixes

With Sage 9’s new stylelint checks, I’m wondering has anyone implemented any tools to automatically correct formatting issues?

With the upcoming update, you can do this with

yarn lint:styles -- --fix

Until then you can run the full command manually if you want:

stylelint 'resources/assets/styles/**/*.{css,sass,scss,sss,less}' --fix


node node_modules/.bin/stylelint 'resources/assets/styles/**/*.{css,sass,scss,sss,less}' --fix

The bottom option is not working for me. It displays the issues but does not fix them.

1 Like

I’m facing the same problem here. Running any of those commands won’t make the trick. I’m dealing with plenty of minor errors which not let me build the main.css file.

Any idea?

Thanks in advance!

Thanks, have you integrated this? I’m interested to see how you configured things.

I currently disabled the linting from webpack.config.js.

i get the same “error Command failed with exit code 2.” error

Any ideas on how to make the --fix work?