Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nwalters512/sql-formatter-typescript-repro
https://github.com/nwalters512/sql-formatter-typescript-repro
Last synced: 3 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/nwalters512/sql-formatter-typescript-repro
- Owner: nwalters512
- Created: 2023-05-25T23:13:44.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-11-15T22:43:55.000Z (12 months ago)
- Last Synced: 2024-10-10T03:10:52.041Z (27 days ago)
- Language: TypeScript
- Size: 3.91 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# sql-formatter-typescript-repro
This repository reproduces an issue with the TypeScript types for the `sql-formatter` package.
## Reproduction steps
- Clone repository
- Run `yarn`
- Run `yarn build`
- Observe the following error:```
src/index.ts:1:24 - error TS1479: The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("sql-formatter")' call instead.
To convert this file to an ECMAScript module, change its file extension to '.mts', or add the field `"type": "module"` to '/Users/nathan/git/sql-formatter-typescript-repro/package.json'.1 import { format } from 'sql-formatter';
~~~~~~~~~~~~~~~Found 1 error in src/index.ts:1
```