Skip to content

Commit a6ca126

Browse files
committed
feat: Update ESLint configuration to use new eslint.config.js file across all packages
1 parent e0c9c42 commit a6ca126

File tree

9 files changed

+14
-18
lines changed

9 files changed

+14
-18
lines changed

packages/api/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"scripts": {
1010
"build": "tsup src/index.ts --dts --format esm,cjs --out-dir dist",
1111
"test": "jest",
12-
"lint": "eslint src --ext .ts --config ../../.eslintrc.js"
12+
"lint": "eslint src --ext .ts --config ../../eslint.config.js"
1313
},
1414
"dependencies": {
1515
"@mixcore/shared": "workspace:*"

packages/api/src/api-services.ts

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -80,17 +80,13 @@ export class ApiService implements ApiService {
8080
body,
8181
};
8282
for (const hook of this.hooks) if (hook.onRequest) await hook.onRequest(req);
83-
try {
84-
const res = await fetch(req.url, req);
85-
for (const hook of this.hooks) if (hook.onResponse) await hook.onResponse(res, req);
86-
const respData = await res.json().catch(() => undefined);
87-
if (!res.ok) {
88-
return { isSucceed: false, data: respData, errors: [res.statusText], status: res.status };
89-
}
90-
return { isSucceed: true, data: respData, status: res.status };
91-
} catch (err) {
92-
throw err;
83+
const res = await fetch(req.url, req);
84+
for (const hook of this.hooks) if (hook.onResponse) await hook.onResponse(res, req);
85+
const respData = await res.json().catch(() => undefined);
86+
if (!res.ok) {
87+
return { isSucceed: false, data: respData, errors: [res.statusText], status: res.status };
9388
}
89+
return { isSucceed: true, data: respData, status: res.status };
9490
}
9591

9692
/**

packages/base/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"scripts": {
99
"build": "tsup src/index.ts --dts --format esm,cjs --out-dir dist",
1010
"test": "jest",
11-
"lint": "eslint src --ext .ts --config ../../.eslintrc.js"
11+
"lint": "eslint src --ext .ts --config ../../eslint.config.js"
1212
},
1313
"dependencies": {
1414
"@mixcore/api": "workspace:*"

packages/config/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"scripts": {
1010
"build": "tsup src/index.ts --dts --format esm,cjs --out-dir dist",
1111
"test": "jest",
12-
"lint": "eslint src --ext .ts --config ../../.eslintrc.js"
12+
"lint": "eslint src --ext .ts --config ../../eslint.config.js"
1313
},
1414
"dependencies": {
1515
"@mixcore/shared": "workspace:*",

packages/database/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"scripts": {
99
"build": "tsup src/index.ts --dts --format esm,cjs --out-dir dist",
1010
"test": "jest",
11-
"lint": "eslint src --ext .ts --config ../../.eslintrc.js"
11+
"lint": "eslint src --ext .ts --config ../../eslint.config.js"
1212
},
1313
"dependencies": {
1414
"@mixcore/api": "workspace:*",

packages/file/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"scripts": {
99
"build": "tsup src/index.ts --dts --format esm,cjs --out-dir dist",
1010
"test": "jest",
11-
"lint": "eslint src --ext .ts --config ../../.eslintrc.js"
11+
"lint": "eslint src --ext .ts --config ../../eslint.config.js"
1212
},
1313
"dependencies": {
1414
"@mixcore/api": "workspace:*"

packages/navigation/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"scripts": {
99
"build": "tsup src/index.ts --dts --format esm,cjs --out-dir dist",
1010
"test": "jest --passWithNoTests",
11-
"lint": "eslint src --ext .ts --config ../../.eslintrc.js"
11+
"lint": "eslint src --ext .ts --config ../../eslint.config.js"
1212
},
1313
"license": "SEE LICENSE IN LICENSE",
1414
"repository": "https://github.com/mixcore/javascript-sdk",

packages/template/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"scripts": {
99
"build": "tsup src/index.ts --dts --format esm,cjs --out-dir dist",
1010
"test": "jest",
11-
"lint": "eslint src --ext .ts --config ../../.eslintrc.js"
11+
"lint": "eslint src --ext .ts --config ../../eslint.config.js"
1212
},
1313
"dependencies": {
1414
"@mixcore/api": "workspace:*",

packages/user/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"scripts": {
99
"build": "tsup src/index.ts --dts --format esm,cjs --out-dir dist",
1010
"test": "jest",
11-
"lint": "eslint src --ext .ts --config ../../.eslintrc.js"
11+
"lint": "eslint src --ext .ts --config ../../eslint.config.js"
1212
},
1313
"dependencies": {
1414
"@mixcore/api": "workspace:*",

0 commit comments

Comments
 (0)