NaturalIntelligence / NaturalIntelligence/fast-xml-builder
`XMLBuilder` object should be exported as a named export, not just the type
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 22
- Forks
- 8
- PR merge metrics
- No merged PRs in 30d
Description
The Problem
This default import from the documentation gives an eslint warning:
// eslint[import-x/no-named-as-default]: "Using exported name 'XMLBuilder' as identifier for default export."
import XMLBuilder from "fast-xml-builder";
This is because XMLBuilder is also a named export in the package (in fxb.d.ts)
Alternatively, this import will pass eslint and a build but will crash during runtime:
import { XMLBuilder } from "fast-xml-builder";
This is because the named XMLBuilder export is only a type, not the function itself.
The Solution
It would be nice if fxb.js also exported the default function Builder as a named export. Keeping the name as Builder makes sense to me but XMLBuilder is what's currently documented
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by comparing the exports in fxb.js with the declared exports in fxb.d.ts. Verify the documented default and named import forms with the package build and runtime, then confirm that the intended named XMLBuilder or Builder import works without the eslint warning or a runtime crash.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- developer-experience
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 82/100