Skip to content

Commit bf30cbf

Browse files
committed
1 parent 427c138 commit bf30cbf

File tree

4 files changed

+23
-2
lines changed

4 files changed

+23
-2
lines changed

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -441,6 +441,16 @@ npm install node-fetch --save-dev
441441
npm install form-data --save-dev
442442
```
443443

444+
In order to compile the project and resolve the imports, you will need to enable the `allowSyntheticDefaultImports`
445+
in your `tsconfig.json` file.
446+
447+
```json
448+
{
449+
"allowSyntheticDefaultImports": true
450+
}
451+
```
452+
453+
444454
[npm-url]: https://npmjs.org/package/openapi-typescript-codegen
445455
[npm-image]: https://img.shields.io/npm/v/openapi-typescript-codegen.svg
446456
[license-url]: LICENSE

src/templates/core/node/request.hbs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{{>header}}
22

3-
import * as FormData from 'form-data';
3+
import FormData from 'form-data';
44
import fetch, { BodyInit, Headers, RequestInit, Response } from 'node-fetch';
55
import { types } from 'util';
66

test/e2e/scripts/compileWithTypescript.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,16 @@ function compileWithTypescript(dir) {
1212
module: 'es6',
1313
moduleResolution: 'node',
1414
lib: ['es6', 'es2017', 'dom'],
15+
declaration: false,
16+
declarationMap: false,
17+
sourceMap: false,
18+
noImplicitReturns: true,
19+
noImplicitThis: true,
20+
noImplicitAny: true,
21+
strict: true,
22+
strictNullChecks: true,
23+
strictFunctionTypes: true,
24+
allowSyntheticDefaultImports: true,
1525
},
1626
include: ['./index.ts'],
1727
};

tsconfig.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414
"noImplicitAny": true,
1515
"strict": true,
1616
"strictNullChecks": true,
17-
"strictFunctionTypes": true
17+
"strictFunctionTypes": true,
18+
"allowSyntheticDefaultImports": true
1819
},
1920

2021
"files": [

0 commit comments

Comments
 (0)