pink icon indicating copy to clipboard operation
pink copied to clipboard

Fix TypeScript compilation errors related to module imports

Open Codexnever opened this issue 1 year ago • 2 comments

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.

Codexnever avatar May 20 '24 07:05 Codexnever

⚠️ 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

changeset-bot[bot] avatar May 20 '24 07:05 changeset-bot[bot]

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

vercel[bot] avatar May 20 '24 07:05 vercel[bot]