Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nwalters512/xml-formatter-typescript-repro
https://github.com/nwalters512/xml-formatter-typescript-repro
Last synced: 3 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/nwalters512/xml-formatter-typescript-repro
- Owner: nwalters512
- Created: 2024-04-24T22:03:25.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2024-04-24T22:15:59.000Z (7 months ago)
- Last Synced: 2024-10-10T03:10:51.589Z (27 days ago)
- Language: JavaScript
- Size: 6.84 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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
```