Skip to content

feat(cli): add prettier-plugin-organize-imports support#286

Open
gonzoblasco wants to merge 1 commit into
akd-io:developfrom
gonzoblasco:feature/266-prettier-plugin-organize-imports
Open

feat(cli): add prettier-plugin-organize-imports support#286
gonzoblasco wants to merge 1 commit into
akd-io:developfrom
gonzoblasco:feature/266-prettier-plugin-organize-imports

Conversation

@gonzoblasco

Copy link
Copy Markdown

What

Closes #266

Adds prettier-plugin-organize-imports as an optional plugin that users can enable with --prettier-plugin-organize-imports.

Why

prettier-plugin-organize-imports automatically removes unused imports and sorts them using the TypeScript language service. It's a natural complement to Prettier and commonly requested (*closes #266*).

CNS already uses this plugin internally as a tmpDependency for formatting generated code, but it wasn't available as an option for the generated project.

How

  • New plugin prettier-plugin-organize-imports activated when both --prettier and --prettier-plugin-organize-imports flags are set
  • Installs the plugin as a devDependency in the generated project
  • .prettierrc is now generated dynamically: includes "plugins": ["prettier-plugin-organize-imports"] when the flag is set, otherwise {}
  • Validation: throws a clear error if the flag is used without --prettier
  • Added to the technologies sort order for README/landing page

Testing

  • tsc --noEmit passes
  • Unit tests pass (pnpm test:cli)

Closes akd-io#266

Adds a new plugin that activates when both Prettier and the
--prettier-plugin-organize-imports flag are enabled. The plugin:
- Installs prettier-plugin-organize-imports as a devDependency
- Registers it in .prettierrc via dynamic content generation
- Adds the technology to the README/landing page
- Validates that Prettier is required

The .prettierrc content is now generated dynamically based on
whether organize-imports is enabled, avoiding file conflicts.
@vercel

vercel Bot commented Jul 15, 2026

Copy link
Copy Markdown

@gonzoblasco is attempting to deploy a commit to the 9ty Team on Vercel.

A member of the Team first needs to authorize it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support for prettier-plugin-organize-imports

1 participant