reviewdog / action-stylelint

Run stylelint with reviewdog
https://github.com/marketplace?type=actions&query=reviewdog
MIT License
46 stars 24 forks source link

Stylelint 16 Support #110

Closed bert-mccutchen closed 7 months ago

bert-mccutchen commented 7 months ago

Why?

First Issue

I noticed when trying to run this action in a workflow that pre-installs Stylelint 16, it fails with the following error:

Error: EISDIR: illegal operation on a directory, read

I found out that the issue stems from blank --config and --ignore-pattern flag values being passed to Stylelint 16. In previous versions of Stylelint, it handles these blank flag values without issue.

Second Issue

You can't pass multiple file paths into INPUT_STYLELINT_INPUT.

This is due to INPUT_STYLELINT_INPUT being wrapped in single quotes, so Stylelint is handling it as if it is a single path. Previously, in much older versions of Stylelint, the quotes were needed to fix globbing issues. This does not seem to be an issue anymore, i've checked in 15+.

What

  1. Updated the npx command for Stylelint to only pass flags that are populated.
  2. Removed the quotes surrounding INPUT_STYLELINT_INPUT in the npx command.
  3. Refactored the script to be a bit more DRY and human readable.
    • Moved core logic into self-explaining functions.
    • DRY'd up the code by using the functions.
github-actions[bot] commented 7 months ago

🚀 [bumpr] Bumped! New version:v1.19.0 Changes:v1.18.1...v1.19.0

review-dog commented 7 months ago

Hi, @bert-mccutchen! We merged your PR to reviewdog! 🐶 Thank you for your contribution! ✨

We just invited you to join the @reviewdog organization on GitHub. Accept the invite by visiting https://github.com/orgs/reviewdog/invitation. By joining the team, you'll be a part of reviewdog community and can help the maintenance of reviewdog.

Thanks again!