Skip to content

Set up prettier-plugin-organize-imports#1250

Closed
Arman-Luthra wants to merge 2 commits into
Shopify:mainfrom
Arman-Luthra:chore/prettier-organize-imports-540
Closed

Set up prettier-plugin-organize-imports#1250
Arman-Luthra wants to merge 2 commits into
Shopify:mainfrom
Arman-Luthra:chore/prettier-organize-imports-540

Conversation

@Arman-Luthra

Copy link
Copy Markdown

What are you adding in this PR?

Closes #540.

This sets up prettier-plugin-organize-imports as requested in the issue and the linked review discussion on #529, so pnpm format now sorts imports and removes unused ones.

The work is split into two commits so the mechanical diff is reviewable on its own, as suggested in that discussion:

  1. Setup: adds prettier-plugin-organize-imports@4.3.0 to the workspace root devDependencies, registers it in .prettierrc.json, and adds editor.codeActionsOnSave: { "source.organizeImports": "explicit" } to .vscode/settings.json. Peer requirements are satisfied by the repo's existing prettier ^3.0.0 and typescript ^5.9.0.
  2. Reformat: runs pnpm format across the workspace, organizing imports in 473 files.

An empty changeset is included, since this is tooling-only and changes no published package behavior.

One risk with this plugin is that it can drop imports that exist only for side effects. I checked the formatted scope for those: the single side-effect-only import (test-setup in LiquidDocTagHoverProvider.spec.ts) survived the reformat, and the type-check plus full test suite pass covers the rest.

What's next? Any followup issues?

None. If this sits for a while before merge, the mechanical commit may need a fresh rebase to avoid conflicts; happy to redo it on request.

Tophatting

  • pnpm format:check passes after the reformat, so the output is stable and idempotent
  • pnpm build:ts and pnpm type-check pass across all packages with zero errors
  • pnpm vitest run passes the full suite: 296 test files, 1882 passed, 1 skipped
  • pnpm lint reports 17 pre-existing problems in vscode-extension that reproduce identically on an unmodified checkout, so they are unrelated to this change

Before you deploy

  • I included a changeset (empty, since this is tooling-only with no published package behavior change)

Arman-Luthra and others added 2 commits July 6, 2026 19:29
Adds prettier-plugin-organize-imports so pnpm format sorts imports and
removes unused ones, and enables organize-imports-on-save in VS Code.

Closes Shopify#540

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Mechanical diff from running pnpm format with
prettier-plugin-organize-imports enabled. No behavior change.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@Arman-Luthra Arman-Luthra requested a review from a team as a code owner July 7, 2026 03:21
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.

Setup the prettier organize import plugin

1 participant