nodaguti / stylelint-no-unused-selectors

A rule for stylelint to disallow unused selectors
MIT License
78 stars 11 forks source link

fix: run asynchronous processing outside of walkRules #639

Open 3846masa opened 2 years ago

3846masa commented 2 years ago

In some cases, unused class names may not be detected when stylelint is running for a short time.

This problem is reproduced when the execution time of stylelint-no-unused-selectors is long compared to the execution time of stylelint.

This occurs because postcss walkRules does not wait for asynchronous processing.

In this PR, asynchronous processing is executed outside of walkRules to ensure that the process is properly awaited.

Code that reproduces the bug

https://gist.github.com/3846masa/425887e280190c572252969b81f07ec8