Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: [PIPE-23403]: Add import sort prettier plugin to sort the imports #453

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

praneshg239
Copy link
Contributor

Added @ianvs/prettier-plugin-sort-imports prettier sort plugin. This will sort the imports in the following order.

  1. At the top, portion for copyright comments or some other comments in future
  2. Linebreak
  3. React or React named imports (react-dom, react-router-dom)
  4. Linebreak
  5. Third party imports (lodash, immer, @ tanstack etc,..)
  6. Linebreak
  7. Monorepo packages (@harnessio/* packages)
  8. Linebreak
  9. Local imports

Imported packages and imports within the brackets from a module also gets sorted alphabetically.

Before

Screenshot 2024-11-17 at 9 04 04 PM

After

Screenshot 2024-11-17 at 9 04 36 PM

@praneshg239 praneshg239 marked this pull request as draft November 17, 2024 16:01
Copy link

netlify bot commented Nov 17, 2024

Deploy Preview for harness-xd-review ready!

Name Link
🔨 Latest commit 942cc6a
🔍 Latest deploy log https://app.netlify.com/sites/harness-xd-review/deploys/673a134a825fa90008ecdd5a
😎 Deploy Preview https://deploy-preview-453--harness-xd-review.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

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.

1 participant