Skip to content

Declare missing prettier and stylelint workspace dependencies - #81065

Merged
manzoorwanijk merged 1 commit into
trunkfrom
fix/declare-missing-workspace-deps
Aug 3, 2026
Merged

Declare missing prettier and stylelint workspace dependencies#81065
manzoorwanijk merged 1 commit into
trunkfrom
fix/declare-missing-workspace-deps

Conversation

@manzoorwanijk

Copy link
Copy Markdown
Member

What?

Declares two missing workspace dependencies so packages no longer rely on hoisting from the root:

  • packages/prettier-config: add prettier (npm:wp-prettier@^3.0.3) as a devDependency.
  • tools/stylelint: add stylelint as a dependency.

Why?

  • The prettier-config unit tests resolve prettier from within the package (require.resolve( 'prettier' )), but the package never declared it — it's only a peer dependency there.
  • @wordpress/stylelint-config, a dependency of tools/stylelint, declares stylelint as a peer dependency, so the consuming workspace must provide it directly.

Both currently work only because the dependencies happen to be hoisted to the root node_modules; declaring them explicitly makes the workspaces correct under isolated/linked install strategies.

How?

Adds the missing entries to the respective package.json files and updates the lockfile.

Testing Instructions

  1. npm install
  2. npm run test:unit -- packages/prettier-config — tests pass.
  3. npm run lint:css — stylelint still runs.

Use of AI Tools

Written with the help of Claude Code, reviewed and tested by the author.

- prettier-config tests resolve prettier from the package, so declare it
  as a devDependency (wp-prettier alias).
- tools/stylelint must provide stylelint directly since
  @wordpress/stylelint-config declares it as a peer dependency.
@manzoorwanijk manzoorwanijk added the [Type] Code Quality Issues or PRs that relate to code quality label Aug 3, 2026
@manzoorwanijk
manzoorwanijk marked this pull request as ready for review August 3, 2026 06:49
@manzoorwanijk
manzoorwanijk requested a review from ntwb as a code owner August 3, 2026 06:49
@github-actions

github-actions Bot commented Aug 3, 2026

Copy link
Copy Markdown

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: manzoorwanijk <manzoorwanijk@git.wordpress.org>
Co-authored-by: Mamaduka <mamaduka@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@github-actions

github-actions Bot commented Aug 3, 2026

Copy link
Copy Markdown

Size Change: 0 B

Total Size: 7.78 MB

compressed-size-action

@Mamaduka Mamaduka 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.

Thanks, @manzoorwanijk!

@manzoorwanijk
manzoorwanijk enabled auto-merge (squash) August 3, 2026 06:55
@manzoorwanijk
manzoorwanijk merged commit c63f50f into trunk Aug 3, 2026
56 checks passed
@manzoorwanijk
manzoorwanijk deleted the fix/declare-missing-workspace-deps branch August 3, 2026 07:28
@github-actions github-actions Bot added this to the Gutenberg 23.8 milestone Aug 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Type] Code Quality Issues or PRs that relate to code quality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants