Skip to content

Commit 2b55838

Browse files
fix: fix cosmiconfig TypeScriptLoader
1 parent e533ddc commit 2b55838

File tree

6 files changed

+24
-5
lines changed

6 files changed

+24
-5
lines changed

.changeset/khaki-rockets-fly.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'openapi-ts-request': patch
3+
---
4+
5+
fix: fix cosmiconfig TypeScriptLoader

.eslintrc.cjs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,13 @@ module.exports = {
55
'plugin:@typescript-eslint/recommended',
66
'plugin:@typescript-eslint/recommended-requiring-type-checking',
77
],
8-
ignorePatterns: ['dist', 'node_modules', 'test', '*.cjs'],
8+
ignorePatterns: [
9+
'dist',
10+
'node_modules',
11+
'test',
12+
'*.cjs',
13+
'openapi-ts-request.config.ts',
14+
],
915
plugins: [],
1016
parserOptions: {
1117
ecmaVersion: 'latest',

openapi-ts-request.config.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
export default [
2+
{
3+
schemaPath: 'http://petstore.swagger.io/v2/swagger.json',
4+
serversPath: './src/apis/app',
5+
},
6+
];

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@
3232
"lint:fix": "eslint ./src --report-unused-disable-directives --max-warnings=0 --fix",
3333
"test": "rm -rf ./test/apis/ ./test/mocks && npm run build && cd ./test && node ./test.js && cd ..",
3434
"test:windows": "rimraf ./test/apis/ ./test/mocks && npm run build && cd ./test && node ./test.js && cd ..",
35-
"prepare": "husky"
35+
"prepare": "husky",
36+
"openapi-ts-request": "openapi-ts"
3637
},
3738
"dependencies": {
3839
"@prettier/sync": "^0.5.2",

src/bin/cli.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
#!/usr/bin/env node
22
import chalk from 'chalk';
33
import { cosmiconfigSync } from 'cosmiconfig';
4-
import { TypeScriptLoader } from 'cosmiconfig-typescript-loader';
4+
import { TypeScriptLoaderSync } from 'cosmiconfig-typescript-loader';
55

66
import { GenerateServiceProps, generateService } from '../index';
77

88
const explorerSync = cosmiconfigSync('openapi-ts-request', {
99
loaders: {
10-
'.ts': TypeScriptLoader(),
10+
'.ts': TypeScriptLoaderSync(),
1111
},
1212
});
1313

tsconfig.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
"dist",
2121
"**/__tests__",
2222
"**/__test__",
23-
"**/demo"
23+
"**/demo",
24+
"openapi-ts-request.config.ts"
2425
]
2526
}

0 commit comments

Comments
 (0)