[babel-plugin] TypeScript types are wrong

Open Beginner friendly
#889 5 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
65/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Quiet
Domain
tooling

Research direction

Start with the resolved type declarations for @stylexjs/babel-plugin and compare them with the package's JavaScript export behavior. Reproduce the report using the arethetypeswrong.dev check linked in the issue and verify that Node16 TypeScript consumers no longer need an incorrect .default access.

Written by the indexing model from the issue text.

Description

bug good first issue help wanted
Describe the issue

The resolved types use export default where the JavaScript file appears to use module.exports =. This will cause TypeScript under the node16 module mode to think an extra .default property access is required, but that will likely fail at runtime.

Expected behavior

These types should use export = instead of export default.

Steps to reproduce

See https://arethetypeswrong.github.io/?p=%40stylexjs%2Fbabel-plugin%400.10.1

Test case

No response

Additional comments

No response

Dominant language
JavaScript
Stars
10.3k
Forks
485
Avg merge
3d 19h
Merged PRs (30d)
17

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from facebook/stylex

All issues in facebook/stylex

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.