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
The Problem
This default import from the documentation gives an eslint warning:
This is because
XMLBuilderis also a named export in the package (infxb.d.ts)Alternatively, this import will pass
eslintand abuildbut will crash during runtime:This is because the named
XMLBuilderexport is only a type, not the function itself.The Solution
It would be nice if
fxb.jsalso exported the default functionBuilderas a named export. Keeping the name asBuildermakes sense to me butXMLBuilderis what's currently documented