This commit is contained in:
Ferdi Koomen 2020-11-15 10:48:31 +01:00
parent 427c138c39
commit bf30cbfb85
4 changed files with 23 additions and 2 deletions

View File

@ -441,6 +441,16 @@ npm install node-fetch --save-dev
npm install form-data --save-dev
```
In order to compile the project and resolve the imports, you will need to enable the `allowSyntheticDefaultImports`
in your `tsconfig.json` file.
```json
{
"allowSyntheticDefaultImports": true
}
```
[npm-url]: https://npmjs.org/package/openapi-typescript-codegen
[npm-image]: https://img.shields.io/npm/v/openapi-typescript-codegen.svg
[license-url]: LICENSE

View File

@ -1,6 +1,6 @@
{{>header}}
import * as FormData from 'form-data';
import FormData from 'form-data';
import fetch, { BodyInit, Headers, RequestInit, Response } from 'node-fetch';
import { types } from 'util';

View File

@ -12,6 +12,16 @@ function compileWithTypescript(dir) {
module: 'es6',
moduleResolution: 'node',
lib: ['es6', 'es2017', 'dom'],
declaration: false,
declarationMap: false,
sourceMap: false,
noImplicitReturns: true,
noImplicitThis: true,
noImplicitAny: true,
strict: true,
strictNullChecks: true,
strictFunctionTypes: true,
allowSyntheticDefaultImports: true,
},
include: ['./index.ts'],
};

View File

@ -14,7 +14,8 @@
"noImplicitAny": true,
"strict": true,
"strictNullChecks": true,
"strictFunctionTypes": true
"strictFunctionTypes": true,
"allowSyntheticDefaultImports": true
},
"files": [