TypeScript definition broken because of food.json
Closed this issue · 1 comments
rothsandro commented
Is this a regression?
Yes
Description
The TypeScript definitions are broken because of the food.json import. Food is the only function that imports the json not just for the actual function but for the type definition of CuisineOrigin
.
- Create a new Angular 13 project with Angular CLI
- Install falso
- Import and use any of the rand* function
- Start the project with
npm start
The error below is thrown.
Please provide a link to a minimal reproduction of the bug
https://github.com/rothsandro/falso-typescript
Please provide the exception or error you saw
Error: node_modules/@ngneat/falso/lib/food.d.ts:2:22 - error TS2732:
Cannot find module './food.json'. Consider using '--resolveJsonModule' to import module with '.json' extension.
import { data } from './food.json';
~~~~~~~~~~~~~
Please provide the environment you discovered this bug in
@ngneat/falso 2.11.0
typescript 4.5.2
node v16.13.0
Anything else?
Workaround: set skipLibCheck
in tsconfig to false
Do you want to create a pull request?
No
maxiwer commented
I think you need to find the root cause, because this thing showed up again. What's in project:
- @ngneat/falso: ^6.1.0
- typescript: ^4.7.4
- node: v14.20.0