Skip to content

style: remove import group comments and separators - #751

Merged
dcalhoun merged 3 commits into
trunkfrom
style/remove-import-groups
Oct 1, 2026
Merged

dcalhoun merged 3 commits into
trunkfrom
style/remove-import-groups

Conversation

@dcalhoun

@dcalhoun dcalhoun commented Oct 1, 2026 •

Copy link
Copy Markdown
Member

What?

Remove import group comments.

Why?

Align with upstream Gutenberg core latest practices in WordPress/gutenberg#81188 and WordPress/gutenberg#81248.

How?

  • Remove the group comment lines
  • Reorder imports to be external first, internal second
  • Place imports at the top of files

Testing Instructions

N/A, no user-facing changes.

Accessibility Testing Instructions

N/A, no user-facing changes.

Screenshots or screencast

N/A, no user-facing changes.


AI-generated details

Aligns with Gutenberg's removal of import group comments (#81188, #81248): imports are now one contiguous block, with no /** External | WordPress | Internal dependencies */ comments or blank lines.

  • eslint.config.js enables @wordpress/dependency-group: never and import/order (newlines-between: never), matching Gutenberg's config. Neither is in @wordpress/eslint-plugin's recommended config.
  • The bulk change is make lint-web-fix output. The fixer also moved three relative imports below package imports (src/utils/editor.jsx and two hook tests); stylesheet load order is unaffected.
  • Open PRs: resolve import conflicts by running make lint-web-fix after rebasing.
  • Follow-up: after merge, add the squashed SHA to a new .git-blame-ignore-revs.

Verified with make lint-web and make test-web-unit (276 passing).

🤖 Generated with Claude Code

dcalhoun and others added 3 commits October 1, 2026 08:45
Gutenberg dropped the dependency group comments and blank lines between
imports; align with its ESLint configuration.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Vitest hoists `vi.mock` calls, so the import need not follow them. Keeping
imports contiguous prevents the import/order fixer from collapsing the
blank lines around the mocks.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Generated by `make lint-web-fix` under the new import rules, plus one
manual blank-line removal the fixer could not apply.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added the [Type] Task Issues or PRs that have been broken down into an individual action to take label Oct 1, 2026
@wpmobilebot

Copy link
Copy Markdown

XCFramework Build

This PR's XCFramework is available for testing. Add the following to your Package.swift:

.package(url: "https://github.com/wordpress-mobile/GutenbergKit", branch: "pr-build/751")

Built from 8d286eb

@dcalhoun
dcalhoun marked this pull request as ready for review October 1, 2026 14:44
@dcalhoun
dcalhoun requested a review from nbradbury October 1, 2026 14:49

@nbradbury nbradbury left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nice cleanup! :shipit:

@dcalhoun
dcalhoun merged commit 6ef0626 into trunk Oct 1, 2026
27 checks passed
@dcalhoun
dcalhoun deleted the style/remove-import-groups branch October 1, 2026 17:03
jkmassel added a commit that referenced this pull request Oct 2, 2026
…dia-upload-middleware

Conflicts:

- src/utils/api-fetch.js: keep core's `apiFetch.mediaUploadMiddleware` and
  the renamed `stripDraftPostIdMiddleware` from this branch, and register
  trunk's `mediaPermissionsMiddleware` after them, as it was on trunk.
- src/utils/api-fetch.test.js: keep both sides' `apiPathModifierMiddleware`
  tests and trunk's `mediaPermissionsMiddleware` tests.

Also applies trunk's lint rules to two files that only exist on this branch:
drops the import group comments from api-fetch-post-process.test.js (#751)
and adds a blank line Prettier now requires in local-wordpress.md (#722).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Type] Task Issues or PRs that have been broken down into an individual action to take

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants