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

Add --globby-options flag #6437

Merged
merged 18 commits into from Nov 11, 2022
Merged

Conversation

sidverma32
Copy link
Contributor

Which issue, if any, is this issue related to?

closes #6109

@changeset-bot
Copy link

changeset-bot bot commented Oct 31, 2022

🦋 Changeset detected

Latest commit: 9913d85

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
stylelint Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@sidverma32 sidverma32 marked this pull request as ready for review October 31, 2022 13:01
@jeddy3 jeddy3 changed the title Added: Support for --globby-options flag Add --globby-options flag Oct 31, 2022
@silversonicaxel
Copy link

Should you also update this documentation file https://github.com/stylelint/stylelint/blob/main/docs/user-guide/usage/options.md ?

@sidverma32
Copy link
Contributor Author

Should you also update this documentation file https://github.com/stylelint/stylelint/blob/main/docs/user-guide/usage/options.md ?

Sure , Updated!

Copy link
Member

@ybiquitous ybiquitous left a comment

Choose a reason for hiding this comment

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

@sidverma32 Thanks for creating the pull request. Please consider addressing my reviews.

lib/cli.js Outdated Show resolved Hide resolved
lib/cli.js Outdated Show resolved Hide resolved
lib/cli.js Outdated Show resolved Hide resolved
docs/user-guide/usage/cli.md Outdated Show resolved Hide resolved
docs/user-guide/usage/cli.md Outdated Show resolved Hide resolved
lib/cli.js Show resolved Hide resolved
Copy link
Member

@ybiquitous ybiquitous left a comment

Choose a reason for hiding this comment

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

Thanks for addressing the reviews! With a little more brushing up, I believe this PR is ready to merge.

lib/cli.js Outdated Show resolved Hide resolved
lib/__tests__/cli.test.js Outdated Show resolved Hide resolved
lib/__tests__/cli.test.js Show resolved Hide resolved
docs/user-guide/usage/cli.md Outdated Show resolved Hide resolved
docs/user-guide/usage/cli.md Outdated Show resolved Hide resolved
docs/user-guide/usage/options.md Outdated Show resolved Hide resolved
lib/cli.js Outdated Show resolved Hide resolved
Copy link
Member

@ybiquitous ybiquitous 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 improving the code. We are very close to the merge.

lib/cli.js Outdated Show resolved Hide resolved
lib/cli.js Outdated Show resolved Hide resolved
lib/__tests__/cli.test.js Outdated Show resolved Hide resolved
Copy link
Member

@ybiquitous ybiquitous 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. LGTM 👍🏼

@sidverma32
Copy link
Contributor Author

Thank you. LGTM 👍🏼

Thanks a lot for the guidance and huge learning experience for me . I think this feature roll-out will give end user's a better option for dot files :)

@ybiquitous ybiquitous merged commit b54083c into stylelint:main Nov 11, 2022
@silversonicaxel
Copy link

amazing guys

@silversonicaxel
Copy link

silversonicaxel commented Nov 14, 2022

hello everyone,
I updated in my project the stylelint libs to fix my hidden folders linting issues.

    "stylelint": "^14.15.0",
    "stylelint-config-prettier": "^9.0.4",
    "stylelint-config-standard": "^29.0.0",
    "stylelint-config-standard-scss": "^6.1.0",
    "stylelint-order": "^5.0.0",
    "stylelint-prettier": "^2.0.0",
    "stylelint-scss": "^4.3.0",
    "stylelint-selector-bem-pattern": "^2.1.1",

I made some tests in a Storybook folder where the application lives.

I just created a linting issue in two files that are not in hidden folders.

with --go and --globby-options applied to stylelint all works still as expected.

Then I created a linting issue in two files that are in hidden folders in a secondary level.

apps/foundation-storybook/.storybook/sb-theme/styles/sb-sidebar.css

and

apps/foundation-storybook/.storybook/sb-theme/styles/sb-sidebar.scss

but also in primary level

.test/sb-sidebar.css

and

.test/sb-sidebar.css

and here is the issue

#storybook-explorer-tree .sidebar-item {
  padding-bottom: 8px;
  font-size: 16px;
  padding-top: 8px;
}

where font-size should be first css property and padding-bottom the second one.

and these are the commands of package.json

    "lint:scss": "stylelint --fix '**/*.scss' --globby-options",
    "lint:css": "stylelint --fix '**/*.css' --globby-options",

and

    "lint:scss": "stylelint --fix '**/*.scss' --go",
    "lint:css": "stylelint --fix '**/*.css' --go",

but any fix is done.

I am not sure if this is still intended, but I fear something is not working as expected.
any opinions, ideas about it?

thanks

@ybiquitous
Copy link
Member

@silversonicaxel Did you pass a value to the --globby-options flag like this?

stylelint --fix '**/*.scss' --globby-options '{"dot":true}'

@silversonicaxel
Copy link

Indeed my bad, it works, thanks a lot

infotexture added a commit to infotexture/dita-bootstrap.extension that referenced this pull request Jan 8, 2024
Stylelint ignores hidden folders by default, so we need to pass --globby-options '{"dot":true}' to ensure that CSS files in `.github` workflow folders are checked.

For background, see:
- stylelint/stylelint#6109
- stylelint/stylelint#6437 (comment)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Add --globby-options flag
3 participants