Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/nwalters512/xml-formatter-typescript-repro


https://github.com/nwalters512/xml-formatter-typescript-repro

Last synced: 3 days ago
JSON representation

Awesome Lists containing this project

README

        

# xml-formatter-typescript-repro

This repository reproduces an issue with the `xml-formatter` package when used in a TypeScript project with `"type": "module"`.

## Steps to reproduce

- Clone this repository
- Install dependencies with `yarn`
- Run `yarn start-esm`; observe that the XML file is formatted correctly
- Run `yarn start-cjs`; observe that the XML file is formatted correctly
- Run `yarn typecheck`; observe that TypeScript complains that `formatXml` is not callable:

```
src/index-esm.ts:3:13 - error TS2349: This expression is not callable.
Type 'typeof import("/Users/nathan/git/xml-formatter-typescript-repro/node_modules/xml-formatter/dist/types/index")' has no call signatures.

3 console.log(formatXml(''));
~~~~~~~~~

Found 1 error in src/index-esm.ts:3
```