Skip to content

Fix node_modules ignore for codeFilename paths containing a dot-prefixed directory - #9282

Merged
jeddy3 merged 6 commits into
stylelint:mainfrom
tuhtah:fix/ignore-dot-paths
May 14, 2026
Merged

jeddy3 merged 6 commits into
stylelint:mainfrom
tuhtah:fix/ignore-dot-paths

Conversation

@tuhtah

@tuhtah tuhtah commented May 12, 2026

Copy link
Copy Markdown
Contributor

Using the absolute path with micromatch.isMatch() falsely triggers the hidden directories ignore rule.

Closes: #9278

@changeset-bot

changeset-bot Bot commented May 12, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 49ec472

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

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

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

@tuhtah

tuhtah commented May 12, 2026

Copy link
Copy Markdown
Contributor Author

Added a test case that should catch the hidden directory problem.

Using the absolute path with micromatch.isMatch() falsely triggers the
hidden directories ignore rule.
@jeddy3 jeddy3 changed the title Fix test failure inside paths containing dot directories (#9278) Fix node_modules ignore for codeFilename paths containing a dot-prefixed directory May 13, 2026

@jeddy3 jeddy3 left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@tuhtah Thanks for the pull request.

I've requested a change to the approach to address the root cause in a way that aligns with how we do it elsewhere in the codebase.

Let's also add:

!lib/__tests__/fixtures/.hidden/node_modules

To .gitignore.


As the PR is now in review, please no longer force push: see the contributing guide.

Comment thread .changeset/fix-dot-dir-test-failure.md Outdated
Comment thread lib/__tests__/fixtures/dot-dir/.hidden-folder/node_modules/test.css
Comment thread lib/__tests__/ignore.test.mjs Outdated
Comment thread lib/__tests__/ignore.test.mjs Outdated
Comment thread lib/standalone.mjs Outdated
@jeddy3 jeddy3 mentioned this pull request May 13, 2026
4 tasks done
tuhtah and others added 4 commits May 13, 2026 16:09
Co-authored-by: Richard Hallows <jeddy3@users.noreply.github.com>
Co-authored-by: Richard Hallows <jeddy3@users.noreply.github.com>
Co-authored-by: Richard Hallows <jeddy3@users.noreply.github.com>
@tuhtah

tuhtah commented May 13, 2026

Copy link
Copy Markdown
Contributor Author

@jeddy3 Thank you for the review.

I have now addressed all the flagged points and reran the tests locally.

Please, let me know if you'd like me to rebase and/or squash the commits.

@github-actions

Copy link
Copy Markdown
Contributor

This PR is packaged and the instant preview is available (49ec472). View the demo website.

Install it locally:

npm i -D https://pkg.pr.new/stylelint@49ec472

@jeddy3 jeddy3 left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@tuhtah Thanks for making the changes.

LGTM.

Local reproduction steps (bug is environmental):

  1. Clone stylelint/stylelint into .tmp (or any . folder)
  2. npm ci && npm run prepare && npm t (1 test should fail)
  3. gh pr checkout 9282
  4. npm t (all tests pass)

(We typically wait for a 2nd approval before merging.)

Please, let me know if you'd like me to rebase and/or squash the commits.

We'll squash when we merge.

@jeddy3
jeddy3 merged commit 63c5992 into stylelint:main May 14, 2026
20 checks passed
@tuhtah
tuhtah deleted the fix/ignore-dot-paths branch May 14, 2026 09:14
renovate Bot added a commit to andrei-picus-tink/auto-renovate that referenced this pull request May 16, 2026
| datasource | package   | from    | to      |
| ---------- | --------- | ------- | ------- |
| npm        | stylelint | 17.11.0 | 17.11.1 |


## [v17.11.1](https://github.com/stylelint/stylelint/blob/HEAD/CHANGELOG.md#17111---2026-05-14)

It fixes 2 bugs.

- Fixed: `node_modules` ignore for `codeFilename` paths containing a dot-prefixed directory ([#9282](stylelint/stylelint#9282)) ([@tuhtah](https://github.com/tuhtah)).
- Fixed: `declaration-block-no-redundant-longhand-properties` range for contiguous redundant longhand properties ([#9273](stylelint/stylelint#9273)) ([@pamelalozano16](https://github.com/pamelalozano16)).
renovate Bot added a commit to andrei-picus-tink/auto-renovate that referenced this pull request May 17, 2026
| datasource | package   | from    | to      |
| ---------- | --------- | ------- | ------- |
| npm        | stylelint | 17.11.0 | 17.11.1 |


## [v17.11.1](https://github.com/stylelint/stylelint/blob/HEAD/CHANGELOG.md#17111---2026-05-14)

It fixes 2 bugs.

- Fixed: `node_modules` ignore for `codeFilename` paths containing a dot-prefixed directory ([#9282](stylelint/stylelint#9282)) ([@tuhtah](https://github.com/tuhtah)).
- Fixed: `declaration-block-no-redundant-longhand-properties` range for contiguous redundant longhand properties ([#9273](stylelint/stylelint#9273)) ([@pamelalozano16](https://github.com/pamelalozano16)).
renovate Bot added a commit to andrei-picus-tink/auto-renovate that referenced this pull request May 22, 2026
| datasource | package   | from    | to      |
| ---------- | --------- | ------- | ------- |
| npm        | stylelint | 17.11.0 | 17.12.0 |


## [v17.12.0](https://github.com/stylelint/stylelint/blob/HEAD/CHANGELOG.md#17120---2026-05-20)

It fixes 3 bugs, including a false negative one.

- Fixed: `block-no-empty` reported range when using comments ([#9294](stylelint/stylelint#9294)) ([@romainmenke](https://github.com/romainmenke)).
- Fixed: `declaration-property-value-no-unknown` false negatives for custom properties defined in reference files ([#9292](stylelint/stylelint#9292)) ([@romainmenke](https://github.com/romainmenke)).
- Fixed: `value-keyword-layout-mappings` false positives for `caption-side` ([#9293](stylelint/stylelint#9293)) ([@romainmenke](https://github.com/romainmenke)).


## [v17.11.1](https://github.com/stylelint/stylelint/blob/HEAD/CHANGELOG.md#17111---2026-05-14)

It fixes 2 bugs.

- Fixed: `node_modules` ignore for `codeFilename` paths containing a dot-prefixed directory ([#9282](stylelint/stylelint#9282)) ([@tuhtah](https://github.com/tuhtah)).
- Fixed: `declaration-block-no-redundant-longhand-properties` range for contiguous redundant longhand properties ([#9273](stylelint/stylelint#9273)) ([@pamelalozano16](https://github.com/pamelalozano16)).
robbevp pushed a commit to robbevp/website-robbevanpetegem that referenced this pull request Jul 7, 2026
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [@tree-company/eslint-config](https://github.com/tree-company/developer-handbook) | devDependencies | minor | [`^0.5.0` -> `^0.6.0`](https://renovatebot.com/diffs/npm/@tree-company%2feslint-config/0.5.0/0.6.0) |
| [@tree-company/stylelint-config](https://github.com/tree-company/developer-handbook) | devDependencies | minor | [`^0.5.0` -> `^0.6.0`](https://renovatebot.com/diffs/npm/@tree-company%2fstylelint-config/0.5.0/0.6.0) |
| [stylelint](https://stylelint.io) ([source](https://github.com/stylelint/stylelint)) | devDependencies | minor | [`17.8.0` -> `17.12.0`](https://renovatebot.com/diffs/npm/stylelint/17.8.0/17.12.0) |

---

### Release Notes

<details>
<summary>stylelint/stylelint (stylelint)</summary>

### [`v17.12.0`](https://github.com/stylelint/stylelint/blob/HEAD/CHANGELOG.md#17120---2026-05-20)

[Compare Source](stylelint/stylelint@17.11.1...17.12.0)

It fixes 3 bugs, including a false negative one.

- Fixed: `block-no-empty` reported range when using comments ([#&#8203;9294](stylelint/stylelint#9294)) ([@&#8203;romainmenke](https://github.com/romainmenke)).
- Fixed: `declaration-property-value-no-unknown` false negatives for custom properties defined in reference files ([#&#8203;9292](stylelint/stylelint#9292)) ([@&#8203;romainmenke](https://github.com/romainmenke)).
- Fixed: `value-keyword-layout-mappings` false positives for `caption-side` ([#&#8203;9293](stylelint/stylelint#9293)) ([@&#8203;romainmenke](https://github.com/romainmenke)).

### [`v17.11.1`](https://github.com/stylelint/stylelint/blob/HEAD/CHANGELOG.md#17111---2026-05-14)

[Compare Source](stylelint/stylelint@17.11.0...17.11.1)

It fixes 2 bugs.

- Fixed: `node_modules` ignore for `codeFilename` paths containing a dot-prefixed directory ([#&#8203;9282](stylelint/stylelint#9282)) ([@&#8203;tuhtah](https://github.com/tuhtah)).
- Fixed: `declaration-block-no-redundant-longhand-properties` range for contiguous redundant longhand properties ([#&#8203;9273](stylelint/stylelint#9273)) ([@&#8203;pamelalozano16](https://github.com/pamelalozano16)).

### [`v17.11.0`](https://github.com/stylelint/stylelint/blob/HEAD/CHANGELOG.md#17110---2026-05-05)

[Compare Source](stylelint/stylelint@17.10.0...17.11.0)

It adds 2 features, including a `loader` property to `referenceFiles: {}` for when the order of appearance in the reference styles matters.

- Added: `loader` to experimental `referenceFiles: {}` ([#&#8203;9251](stylelint/stylelint#9251)) ([@&#8203;romainmenke](https://github.com/romainmenke)).
- Added: `autofixed` to the result object ([#&#8203;8771](stylelint/stylelint#8771)) ([@&#8203;Rob--W](https://github.com/Rob--W)).

### [`v17.10.0`](https://github.com/stylelint/stylelint/blob/HEAD/CHANGELOG.md#17100---2026-05-03)

[Compare Source](stylelint/stylelint@17.9.1...17.10.0)

It adds 3 rules and fixes 4 bugs. You can use the `*-layout-mappings` rules to enforce logical or physical properties, units and keywords.

- Added: `selector-no-invalid` rule ([#&#8203;9232](stylelint/stylelint#9232)) ([@&#8203;jeddy3](https://github.com/jeddy3)).
- Added: `unit-layout-mappings` rule ([#&#8203;9229](stylelint/stylelint#9229)) ([@&#8203;jeddy3](https://github.com/jeddy3)).
- Added: `value-keyword-layout-mappings` rule ([#&#8203;9233](stylelint/stylelint#9233)) ([@&#8203;jeddy3](https://github.com/jeddy3)).
- Fixed: inconsistent error messages when module is not found ([#&#8203;9260](stylelint/stylelint#9260)) ([@&#8203;ybiquitous](https://github.com/ybiquitous)).
- Fixed: `property-layout-mappings` false negatives for property names in declaration values ([#&#8203;9222](stylelint/stylelint#9222)) ([@&#8203;jeddy3](https://github.com/jeddy3)).
- Fixed: `property-layout-mappings` false positives for `@page` properties ([#&#8203;9223](stylelint/stylelint#9223)) ([@&#8203;jeddy3](https://github.com/jeddy3)).
- Fixed: `selector-pseudo-class-no-unknown` false positives for nested `webkit-scrollbar` part ([#&#8203;9259](stylelint/stylelint#9259)) ([@&#8203;rkdfx](https://github.com/rkdfx)).

### [`v17.9.1`](https://github.com/stylelint/stylelint/blob/HEAD/CHANGELOG.md#1791---2026-04-27)

[Compare Source](stylelint/stylelint@17.9.0...17.9.1)

It fixes 4 bugs. We also documented the `messageArgs` each rule provides to the `message` configuration property.

- Fixed: `ConfigurationError` regression for custom syntaxes ([#&#8203;9245](stylelint/stylelint#9245)) ([@&#8203;jeddy3](https://github.com/jeddy3)).
- Fixed: MD5 hash algorithm to SHA256 for caching ([#&#8203;9241](stylelint/stylelint#9241)) ([@&#8203;rkdfx](https://github.com/rkdfx)).
- Fixed: `property-no-deprecated` autofix for `page-break-*: always` ([#&#8203;9214](stylelint/stylelint#9214)) ([@&#8203;rkdfx](https://github.com/rkdfx)).
- Fixed: `selector-no-deprecated` false positives for `::part()` ([#&#8203;9227](stylelint/stylelint#9227)) ([@&#8203;SaekiTominaga](https://github.com/SaekiTominaga)).

### [`v17.9.0`](https://github.com/stylelint/stylelint/blob/HEAD/CHANGELOG.md#1790---2026-04-23)

[Compare Source](stylelint/stylelint@17.8.0...17.9.0)

It adds 3 new features. Adding the `referenceFiles` property to your configuration object makes the `no-unknown-animations`, `no-unknown-custom-media` and `no-unknown-custom-properties` rules more useful.

- Added: experimental `referenceFiles` to configuration object ([#&#8203;9179](stylelint/stylelint#9179)) ([@&#8203;jeddy3](https://github.com/jeddy3)).
- Added: experimental `abortSignal` option to Node.js API for cancellation support ([#&#8203;9213](stylelint/stylelint#9213)) ([@&#8203;adalinesimonian](https://github.com/adalinesimonian)).
- Added: `maxWarnings` to configuration object ([#&#8203;9181](stylelint/stylelint#9181)) ([@&#8203;mrginglymus](https://github.com/mrginglymus)).

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

👻 **Immortal**: This PR will be recreated if closed unmerged. Get [config help](https://github.com/renovatebot/renovate/discussions) if that's undesired.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0MS42MS4wIiwidXBkYXRlZEluVmVyIjoiNDEuNjEuMCIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOltdfQ==-->

Reviewed-on: https://git.robbevp.be/robbevp/website-robbevanpetegem/pulls/510
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.

Fix node_modules ignore for codeFilename paths containing a dot-prefixed directory

3 participants