Fix TypeScript compilation errors related to module imports
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:
- Enhanced error handling within the
formatHtmlandformatJsfunctions to gracefully handle failures when formatting HTML and JavaScript code using Prettier. - Added a fallback mechanism to the
formatHtmlfunction, utilizing a custom formatter (customFormat) in case formatting with Prettier fails. - Introduced a new function
wrapStrto wrap a string with a maximum number of characters per line and a specified indentation. - Created a type declaration file
prettier-extensions.d.tsto 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.
⚠️ No Changeset found
Latest commit: c9e4bb27dc6b542300b5af35973a12e66e29bc8d
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
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 |