Skip to content

Open Source Wealth Management Software. Angular + NestJS + Prisma + Nx + TypeScript 🤍

Feature/switch no-empty-function rule in eslint configuration from warn to error (#3979)

dw-076ff34b0c488
diff --git a/.eslintrc.json b/.eslintrc.json
index d3f7edea90..cdda2a9826 100644
--- a/.eslintrc.json
+++ b/.eslintrc.json
@@ -144,7 +144,6 @@
// and can be remove once solved
"@typescript-eslint/consistent-type-definitions": "warn",
"@typescript-eslint/prefer-function-type": "warn",
- "@typescript-eslint/no-empty-function": "warn",
"@typescript-eslint/prefer-nullish-coalescing": "warn", // TODO: Requires strictNullChecks: true
"@typescript-eslint/consistent-type-assertions": "warn",
"@typescript-eslint/prefer-optional-chain": "warn",
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 9800f9251a..9e80f3b054 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## Unreleased
+### Changed
+
+- Switched the `no-empty-function` rule from `warn` to `error` in the `eslint` configuration
+
### Fixed
- Fixed an issue with the X-axis scale of the dividend timeline on the analysis page
diff --git a/README.md b/README.md
index 989cc37ea1..dca360c398 100644
--- a/README.md
+++ b/README.md
@@ -177,6 +177,12 @@ Deprecated: `GET http://localhost:3333/api/v1/auth/anonymous/<INSERT_SECURITY_TO
`200 OK`
+```
+{
+ "status": "OK"
+}
+```
+
### Import Activities
#### Prerequisites
diff --git a/apps/api/src/app/health/health.controller.ts b/apps/api/src/app/health/health.controller.ts
index 31bdb2e8f7..62ee204198 100644
--- a/apps/api/src/app/health/health.controller.ts
+++ b/apps/api/src/app/health/health.controller.ts
@@ -3,7 +3,9 @@ import { TransformDataSourceInRequestInterceptor } from '@ghostfolio/api/interce
import {
Controller,
Get,
+ HttpCode,
HttpException,
+ HttpStatus,
Param,
UseInterceptors
} from '@nestjs/common';
@@ -17,7 +19,10 @@ export class HealthController {
public constructor(private readonly healthService: HealthService) {}
@Get()
- public async getHealth() {}
+ @HttpCode(HttpStatus.OK)
+ public getHealth() {
+ return { status: getReasonPhrase(StatusCodes.OK) };
+ }
@Get('data-enhancer/:name')
public async getHealthOfDataEnhancer(@Param('name') name: string) {
diff --git a/apps/client/src/app/components/admin-market-data/admin-market-data.component.ts b/apps/client/src/app/components/admin-market-data/admin-market-data.component.ts
index d833ba7dd5..777a08d6ca 100644
--- a/apps/client/src/app/components/admin-market-data/admin-market-data.component.ts
+++ b/apps/client/src/app/components/admin-market-data/admin-market-data.component.ts
@@ -264,7 +264,7 @@ export class AdminMarketDataComponent
this.adminService
.gatherProfileData()
.pipe(takeUntil(this.unsubscribeSubject))
- .subscribe(() => {});
+ .subscribe();
}
public onGatherProfileDataBySymbol({
@@ -274,14 +274,14 @@ export class AdminMarketDataComponent
this.adminService
.gatherProfileDataBySymbol({ dataSource, symbol })
.pipe(takeUntil(this.unsubscribeSubject))
- .subscribe(() => {});
+ .subscribe();
}
public onGatherSymbol({ dataSource, symbol }: AssetProfileIdentifier) {
this.adminService
.gatherSymbol({ dataSource, symbol })
.pipe(takeUntil(this.unsubscribeSubject))
- .subscribe(() => {});
+ .subscribe();
}
public onOpenAssetProfileDialog({
diff --git a/apps/client/src/app/components/admin-market-data/admin-market-data.service.ts b/apps/client/src/app/components/admin-market-data/admin-market-data.service.ts
index 9695dc2a27..86965cd8ab 100644
--- a/apps/client/src/app/components/admin-market-data/admin-market-data.service.ts
+++ b/apps/client/src/app/components/admin-market-data/admin-market-data.service.ts
@@ -59,10 +59,9 @@ export class AdminMarketDataService {
}),
finalize(() => {
window.location.reload();
- setTimeout(() => {}, 300);
})
)
- .subscribe(() => {});
+ .subscribe();
},
confirmType: ConfirmationDialogType.Warn,
title: $localize`Do you really want to delete these profiles?`
diff --git a/apps/client/src/app/components/admin-market-data/asset-profile-dialog/asset-profile-dialog.component.ts b/apps/client/src/app/components/admin-market-data/asset-profile-dialog/asset-profile-dialog.component.ts
index 7cb3aac08e..aacf387e77 100644
--- a/apps/client/src/app/components/admin-market-data/asset-profile-dialog/asset-profile-dialog.component.ts
+++ b/apps/client/src/app/components/admin-market-data/asset-profile-dialog/asset-profile-dialog.component.ts
@@ -190,14 +190,14 @@ export class AssetProfileDialog implements OnDestroy, OnInit {
this.adminService
.gatherProfileDataBySymbol({ dataSource, symbol })
.pipe(takeUntil(this.unsubscribeSubject))
- .subscribe(() => {});
+ .subscribe();
}
public onGatherSymbol({ dataSource, symbol }: AssetProfileIdentifier) {
this.adminService
.gatherSymbol({ dataSource, symbol })
.pipe(takeUntil(this.unsubscribeSubject))
- .subscribe(() => {});
+ .subscribe();
}
public onImportHistoricalData() {
diff --git a/apps/client/src/app/services/user/user.service.ts b/apps/client/src/app/services/user/user.service.ts
index eef0b2f41d..a36f2a8507 100644
--- a/apps/client/src/app/services/user/user.service.ts
+++ b/apps/client/src/app/services/user/user.service.ts
@@ -114,7 +114,7 @@ export class UserService extends ObservableStore<UserStoreState> {
dialogRef
.afterClosed()
.pipe(takeUntil(this.unsubscribeSubject))
- .subscribe(() => {});
+ .subscribe();
}
return user;