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

MI-39: Convert to Typescript & support CJS #13

Merged
merged 4 commits into from
Nov 11, 2024
Merged

Conversation

kai-nguyen-aligent
Copy link
Contributor

@kai-nguyen-aligent kai-nguyen-aligent commented Nov 8, 2024

While trying to use this package with Nx, I have bumped into lot's of issues with eslint & prettier because we only support ESM while Nx plugins & tools chain are still CJS by default. As a result, I create this PR to:

  1. Build to cjs and mjs files for consumption instead of directly publish our code in src folder.
  2. Re-exports to support both ESM & CJS consumers.
  3. Remove eslint-plugin-prettier from our eslint configuration because of the following reasons:
    • We use prettier separately from eslint when it comes to formatting. eslint-plugin-prettier is a plugin that helps execute formatting through eslint. For our use case, eslint-config-prettier is more suitable.
    • Using eslint-plugin-prettier in CJS resolve into a bug as described here.

Copy link
Contributor

@styler3 styler3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kai-nguyen-aligent Looks good. I have requested one minor change and also had a question about backwards compatibility.

package.json Outdated Show resolved Hide resolved
package.json Outdated Show resolved Hide resolved
@styler3 styler3 merged commit c292a69 into main Nov 11, 2024
2 checks passed
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.

2 participants