Stylelint: fix current issues and prevent future issues
See original GitHub issueProblem
We have stylelint in our repository, but we don’t run it systematically, so we currently have 1000+ errors:
% yarn stylelint -q '**/*.scss' | grep '✖' | wc -l
error Command failed with exit code 2.
1302
Solution
- Verify whether the rules causing errors make sense.
- Fix the current errors automatically (and - in a separate commit - manually if necessary).
- Run
stylelint
as part oflint-staged
, to avoid introducing new errors. - Run
stylelint
as part of the.github/workflows/testing.yml
workflow.
Bonus: Integrate stylelint
with ESLint (to avoid having to run it separately).
Issue Analytics
- State:
- Created a year ago
- Comments:12 (11 by maintainers)
Top Results From Across the Web
Managing issues - Stylelint
Managing issues. We manage issues consistently for the benefit of ourselves and our users. Labels. Use labels. When you first triage an issue,...
Read more >Stylelint not reporting any errors on Preact project #250 - GitHub
Running stylelint against any files doesn't generate any errors, nor does --fix do anything. This is the same config I use in all...
Read more >How do I set stylelint to fix errors automatically? - Stack Overflow
auto-correct options for Stylelint. It fixes all issues for me. To check the errors first: npx stylelint "**/*.{css,scss}".
Read more >Stylelint | WebStorm Documentation - JetBrains
Stylelint can automatically fix detected problems in the current file in unambiguous cases using the Stylelint Auto Fix functionality. To apply ...
Read more >Level up your CSS linting using Stylelint - LogRocket Blog
Use VS Code with the Stylelint extension to provide squiggly underlines for errors, and I set errors to be fixed automatically on save;...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@mustaphaturhan Maybe
declaration-property-value-disallowed-list
, we should be able to replaceborder: none
withborder: 0
.no-descending-specificity
example, the solution looks good to me.no-duplicate-selectors
error, we should then be able to merge the two blocks that start withul.main-menu
like this:Awesome, thank you so much! 🙏