feat(cli): add prettier-plugin-organize-imports support#286
Open
gonzoblasco wants to merge 1 commit into
Open
Conversation
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.
|
@gonzoblasco is attempting to deploy a commit to the 9ty Team on Vercel. A member of the Team first needs to authorize it. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Closes #266
Adds
prettier-plugin-organize-importsas 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
tmpDependencyfor formatting generated code, but it wasn't available as an option for the generated project.How
prettier-plugin-organize-importsactivated when both--prettierand--prettier-plugin-organize-importsflags are setdevDependencyin the generated project.prettierrcis now generated dynamically: includes"plugins": ["prettier-plugin-organize-imports"]when the flag is set, otherwise{}--prettierTesting
tsc --noEmitpassespnpm test:cli)