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 TypeScript compilation errors related to module imports #204

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

Conversation

Codexnever
Copy link

PR Description:

This PR includes updates to the code for improved error handling and clarity, along with the addition of a type declaration file for Prettier extensions.

Changes Made:

  1. Enhanced error handling within the formatHtml and formatJs functions to gracefully handle failures when formatting HTML and JavaScript code using Prettier.
  2. Added a fallback mechanism to the formatHtml function, utilizing a custom formatter (customFormat) in case formatting with Prettier fails.
  3. Introduced a new function wrapStr to wrap a string with a maximum number of characters per line and a specified indentation.
  4. Created a type declaration file prettier-extensions.d.ts to provide type definitions for Prettier extensions, ensuring better TypeScript support and code readability.

Reason for Adding prettier-extensions.d.ts:
The prettier-extensions.d.ts file is added to provide TypeScript type definitions for Prettier extensions used in the project. This ensures that TypeScript can correctly infer types and provide helpful hints and suggestions while working with Prettier and its extensions. Having type definitions improves code quality, maintainability, and developer experience.

These changes aim to enhance the robustness and maintainability of the codebase, ensuring smoother error handling and better TypeScript support.

Copy link

changeset-bot bot commented May 20, 2024

⚠️ No Changeset found

Latest commit: c9e4bb2

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link

vercel bot commented May 20, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
pink-design ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 20, 2024 8:00am
ui-kitchensink ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 20, 2024 8:00am

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