typescript-axios: @ts-ignore possible unused imports (#3742)

Depending on the template parameters some imports may not get used -
this causes a typescript compiler error that must be manually fixed.

Signed-off-by: Silas Davis <silas@monax.io>
This commit is contained in:
Silas Davis 2019-08-26 11:40:34 +01:00 committed by Esteban Gehring
parent 197294a167
commit c290555e5e
6 changed files with 12 additions and 2 deletions

View File

@ -6,6 +6,8 @@
import * as globalImportUrl from 'url';
import { Configuration } from './configuration';
import globalAxios, { AxiosPromise, AxiosInstance } from 'axios';
// Some imports not used depending on template conditions
// @ts-ignore
import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from './base';
{{#models}}
@ -17,4 +19,4 @@ import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } fr
{{/withSeparateModelsAndApi}}{{#withSeparateModelsAndApi}}
{{#apiInfo}}{{#apis}}{{#operations}}export * from './{{apiPackage}}/{{classFilename}}';
{{/operations}}{{/apis}}{{/apiInfo}}
{{/withSeparateModelsAndApi}}
{{/withSeparateModelsAndApi}}

View File

@ -6,6 +6,8 @@
import * as globalImportUrl from 'url';
import globalAxios, { AxiosPromise, AxiosInstance } from 'axios';
import { Configuration } from '{{apiRelativeToRoot}}configuration';
// Some imports not used depending on template conditions
// @ts-ignore
import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '{{apiRelativeToRoot}}base';
{{#imports}}import { {{classname}} } from '{{apiRelativeToRoot}}{{tsModelPackage}}';

View File

@ -3,6 +3,8 @@
{{>licenseInfo}}
import { Configuration } from "./configuration";
// Some imports not used depending on template conditions
// @ts-ignore
import globalAxios, { AxiosPromise, AxiosInstance } from 'axios';
export const BASE_PATH = "{{{basePath}}}".replace(/\/+$/, "");

View File

@ -16,6 +16,8 @@
import * as globalImportUrl from 'url';
import { Configuration } from './configuration';
import globalAxios, { AxiosPromise, AxiosInstance } from 'axios';
// Some imports not used depending on template conditions
// @ts-ignore
import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from './base';
/**

View File

@ -14,6 +14,8 @@
import { Configuration } from "./configuration";
// Some imports not used depending on template conditions
// @ts-ignore
import globalAxios, { AxiosPromise, AxiosInstance } from 'axios';
export const BASE_PATH = "http://petstore.swagger.io/v2".replace(/\/+$/, "");