Skip to content

Commit d627aad

Browse files
fix: fix eslint config (#79)
Because - eslint config is not correctly configured This commit - fix eslint config --------- Co-authored-by: Naman Anand <iamnamananand996@gmail.com>
1 parent c3a4448 commit d627aad

20 files changed

+47
-33
lines changed

.eslintrc.cjs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
module.exports = {
2+
root: true,
3+
extends: ["@instill-ai/eslint-config-cortex"],
4+
ignorePatterns: [
5+
".eslintrc.cjs",
6+
"tsup.config.ts",
7+
"vitest.config.ts",
8+
"dist/",
9+
"examples/",
10+
"setupTests.ts",
11+
"turbo.json",
12+
],
13+
};

src/connector/ConnectorClient.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class ConnectorClient {
2929
private axiosInstance: AxiosInstance;
3030

3131
constructor(baseUrl: string, appVersion: string, apiToken: string) {
32-
let URL: Nullable<string> = `${baseUrl}/vdp/${appVersion}`;
32+
const URL: Nullable<string> = `${baseUrl}/vdp/${appVersion}`;
3333

3434
this.axiosInstance = axios.create({
3535
baseURL: URL,

src/connector/index.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
export * from "./types";
2-
export * from "./ConnectorClient";
3-
2+
export { default } from "./ConnectorClient";

src/helper/axiosInstance.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ const createAxiosInstance = (
77
appVersion: string,
88
product: string
99
): AxiosInstance => {
10-
let URL: Nullable<string> = `${baseUrl}/${product}/${appVersion}`;
10+
const URL: Nullable<string> = `${baseUrl}/${product}/${appVersion}`;
1111

1212
return axios.create({
1313
baseURL: URL,

src/helper/createClient.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,13 @@ export function createClient(
2525
}
2626
}
2727

28-
if (!process.env.API_GATEWAY_URL && !env("API_GATEWAY_URL")) {
28+
if (!env("API_GATEWAY_URL")) {
2929
throw new Error("API_GATEWAY_URL or API_GATEWAY_URL is not defined");
3030
}
3131

32-
let baseURL: Nullable<string> = `${
33-
process.env.API_GATEWAY_URL ?? env("API_GATEWAY_URL")
34-
}/${product}/${env("API_VERSION")}`;
32+
const baseURL: Nullable<string> = `${env("API_GATEWAY_URL")}/${product}/${env(
33+
"API_VERSION"
34+
)}`;
3535

3636
return axios.create({
3737
baseURL,

src/helper/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ export { createClient } from "./createClient";
22
export { getQueryString } from "./getQueryString";
33
export { getInstillApiErrorMessage } from "./getInstillApiErrorMessage";
44
export * from "./config";
5-
export * from "./axiosInstance";
5+
export { default } from "./axiosInstance";

src/index.ts

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
import ConnectorClient from "./connector/ConnectorClient";
2-
import MetricClient from "./metric/MetricClient";
3-
import AuthClient from "./mgmt/AuthClient";
4-
import ModelClient from "./model/ModelClient";
5-
import OperationClient from "./operation/OperationClient";
6-
import PipelineClient from "./pipeline/PipelineClient";
7-
import OrganizationClient from "./organization/OrganizationClient";
1+
import ConnectorClient from "./connector";
2+
import MetricClient from "./metric";
3+
import AuthClient from "./mgmt";
4+
import ModelClient from "./model";
5+
import OperationClient from "./operation";
6+
import OrganizationClient from "./organization";
7+
import PipelineClient from "./pipeline";
88

99
class InstillClient {
1010
public Pipeline: PipelineClient;
@@ -30,7 +30,6 @@ export * from "./types";
3030
export * from "./connector";
3131
export * from "./helper";
3232
export * from "./metric";
33-
export * from "./mgmt";
3433
export * from "./model";
3534
export * from "./operation";
3635
export * from "./pipeline";

src/metric/MetricClient.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ class MetricClient {
1010
private axiosInstance: AxiosInstance;
1111

1212
constructor(baseUrl: string, appVersion: string, apiToken: string) {
13-
let URL: Nullable<string> = `${baseUrl}/core/${appVersion}`;
13+
const URL: Nullable<string> = `${baseUrl}/core/${appVersion}`;
1414

1515
this.axiosInstance = axios.create({
1616
baseURL: URL,

src/metric/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
export * from "./pipeline";
2+
export { default } from "./MetricClient";

src/mgmt/AuthClient.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class AuthClient {
3030
private axiosInstance: AxiosInstance;
3131

3232
constructor(baseUrl: string, appVersion: string, apiToken: string) {
33-
let URL: Nullable<string> = `${baseUrl}/core/${appVersion}`;
33+
const URL: Nullable<string> = `${baseUrl}/core/${appVersion}`;
3434

3535
this.axiosInstance = axios.create({
3636
baseURL: URL,
@@ -84,7 +84,11 @@ class AuthClient {
8484
* MGMT Mutation
8585
* -----------------------------------------------------------------------*/
8686

87-
async updateAuthenticatedUserMutation({ payload }: { payload: Partial<User> }) {
87+
async updateAuthenticatedUserMutation({
88+
payload,
89+
}: {
90+
payload: Partial<User>;
91+
}) {
8892
return updateAuthenticatedUserMutation({
8993
axiosInstance: this.axiosInstance,
9094
payload: payload,

0 commit comments

Comments
 (0)