babel / babel/website

addDefault adds underscore even if nameHint provided

Open
#2,312 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
777
Forks
1.4k
Avg merge
16h 45m
Merged PRs (30d)
3

Description

Documentation shows an example without underscore
https://babeljs.io/docs/en/next/babel-helper-module-imports.html#import-hintedname-from-source

But in fact, it is added to the name
https://github.com/babel/babel/blob/e498bee10f0123bb208baa228ce6417542a2c3c4/packages/babel-helper-module-imports/test/index.js#L299

I understand why an underscore is necessary for _default(a reserved word). But I can't understand why it's necessary when nameHint is provided.

Should we change documentation or implementation?

Contributor guide

No contributing guide indexed for this repository

Research direction

Compare the documented example at the Babel helper module imports page with the behavior and assertion around packages/babel-helper-module-imports/test/index.js#L299. First determine whether the intended result is a documentation correction or an implementation change; the work is done when the chosen behavior and its documentation agree.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, typescript
Domain
documentation
Issue type
Documentation
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.