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

Stylelint 16 Support #110

Merged
merged 3 commits into from
Feb 1, 2024
Merged

Stylelint 16 Support #110

merged 3 commits into from
Feb 1, 2024

Conversation

bert-mccutchen
Copy link
Contributor

@bert-mccutchen bert-mccutchen commented Feb 1, 2024

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.

@bert-mccutchen bert-mccutchen changed the title Styleint 16 Support Stylelint 16 Support Feb 1, 2024
script.sh Outdated Show resolved Hide resolved
Copy link
Member

@haya14busa haya14busa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your contribution! 👍

@haya14busa haya14busa merged commit dfce857 into reviewdog:master Feb 1, 2024
5 checks passed
Copy link
Contributor

github-actions bot commented Feb 1, 2024

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

@review-dog
Copy link
Member

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants