Browse Source

Feature/Switch consistent-generic-constructors eslint rule from warn to error (#3985)

* Switch consistent-generic-constructors eslint rule from warn to error

* Update changelog

---------

Signed-off-by: Dominik Willner <th33xitus@gmail.com>
pull/3986/head
dw-0 3 months ago
committed by GitHub
parent
commit
e05f481344
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 3
      .eslintrc.json
  2. 1
      CHANGELOG.md
  3. 3
      apps/client/src/app/components/accounts-table/accounts-table.component.ts
  4. 4
      apps/client/src/app/components/admin-jobs/admin-jobs.component.ts
  5. 2
      apps/client/src/app/components/admin-platform/admin-platform.component.ts
  6. 2
      apps/client/src/app/components/admin-tag/admin-tag.component.ts
  7. 3
      apps/client/src/app/components/admin-users/admin-users.component.ts
  8. 4
      libs/ui/src/lib/account-balances/account-balances.component.ts
  9. 3
      libs/ui/src/lib/holdings-table/holdings-table.component.ts
  10. 2
      libs/ui/src/lib/top-holdings/top-holdings.component.ts

3
.eslintrc.json

@ -143,8 +143,7 @@
// The following rules are part of @typescript-eslint/stylistic-type-checked
// and can be remove once solved
"@typescript-eslint/prefer-nullish-coalescing": "warn", // TODO: Requires strictNullChecks: true
"@typescript-eslint/consistent-indexed-object-style": "warn",
"@typescript-eslint/consistent-generic-constructors": "warn"
"@typescript-eslint/consistent-indexed-object-style": "warn"
}
}
],

1
CHANGELOG.md

@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed
- Switched the `consistent-generic-constructors` rule from `warn` to `error` in the `eslint` configuration
- Switched the `consistent-type-assertions` rule from `warn` to `error` in the `eslint` configuration
- Switched the `prefer-optional-chain` rule from `warn` to `error` in the `eslint` configuration

3
apps/client/src/app/components/accounts-table/accounts-table.component.ts

@ -47,8 +47,7 @@ export class AccountsTableComponent implements OnChanges, OnDestroy {
@ViewChild(MatSort) sort: MatSort;
public dataSource: MatTableDataSource<AccountModel> =
new MatTableDataSource();
public dataSource = new MatTableDataSource<AccountModel>();
public displayedColumns = [];
public isLoading = true;
public routeQueryParams: Subscription;

4
apps/client/src/app/components/admin-jobs/admin-jobs.component.ts

@ -35,10 +35,10 @@ export class AdminJobsComponent implements OnDestroy, OnInit {
DATA_GATHERING_QUEUE_PRIORITY_HIGH;
public DATA_GATHERING_QUEUE_PRIORITY_MEDIUM =
DATA_GATHERING_QUEUE_PRIORITY_MEDIUM;
public dataSource = new MatTableDataSource<AdminJobs['jobs'][0]>();
public defaultDateTimeFormat: string;
public filterForm: FormGroup;
public dataSource: MatTableDataSource<AdminJobs['jobs'][0]> =
new MatTableDataSource();
public displayedColumns = [
'index',
'type',

2
apps/client/src/app/components/admin-platform/admin-platform.component.ts

@ -34,7 +34,7 @@ import { CreateOrUpdatePlatformDialog } from './create-or-update-platform-dialog
export class AdminPlatformComponent implements OnInit, OnDestroy {
@ViewChild(MatSort) sort: MatSort;
public dataSource: MatTableDataSource<Platform> = new MatTableDataSource();
public dataSource = new MatTableDataSource<Platform>();
public deviceType: string;
public displayedColumns = ['name', 'url', 'accounts', 'actions'];
public platforms: Platform[];

2
apps/client/src/app/components/admin-tag/admin-tag.component.ts

@ -34,7 +34,7 @@ import { CreateOrUpdateTagDialog } from './create-or-update-tag-dialog/create-or
export class AdminTagComponent implements OnInit, OnDestroy {
@ViewChild(MatSort) sort: MatSort;
public dataSource: MatTableDataSource<Tag> = new MatTableDataSource();
public dataSource = new MatTableDataSource<Tag>();
public deviceType: string;
public displayedColumns = ['name', 'userId', 'activities', 'actions'];
public tags: Tag[];

3
apps/client/src/app/components/admin-users/admin-users.component.ts

@ -24,8 +24,7 @@ import { takeUntil } from 'rxjs/operators';
templateUrl: './admin-users.html'
})
export class AdminUsersComponent implements OnDestroy, OnInit {
public dataSource: MatTableDataSource<AdminUsers['users'][0]> =
new MatTableDataSource();
public dataSource = new MatTableDataSource<AdminUsers['users'][0]>();
public defaultDateFormat: string;
public displayedColumns: string[] = [];
public getEmojiFlag = getEmojiFlag;

4
libs/ui/src/lib/account-balances/account-balances.component.ts

@ -74,9 +74,9 @@ export class GfAccountBalancesComponent
date: new FormControl(new Date(), Validators.required)
});
public dataSource: MatTableDataSource<
public dataSource = new MatTableDataSource<
AccountBalancesResponse['balances'][0]
> = new MatTableDataSource();
>();
public displayedColumns: string[] = ['date', 'value', 'actions'];
public Validators = Validators;

3
libs/ui/src/lib/holdings-table/holdings-table.component.ts

@ -67,8 +67,7 @@ export class GfHoldingsTableComponent implements OnChanges, OnDestroy {
@ViewChild(MatPaginator) paginator: MatPaginator;
@ViewChild(MatSort) sort: MatSort;
public dataSource: MatTableDataSource<PortfolioPosition> =
new MatTableDataSource();
public dataSource = new MatTableDataSource<PortfolioPosition>();
public displayedColumns = [];
public ignoreAssetSubClasses = [AssetSubClass.CASH];
public isLoading = true;

2
libs/ui/src/lib/top-holdings/top-holdings.component.ts

@ -46,7 +46,7 @@ export class GfTopHoldingsComponent implements OnChanges, OnDestroy {
@ViewChild(MatPaginator) paginator: MatPaginator;
@ViewChild(MatSort) sort: MatSort;
public dataSource: MatTableDataSource<Holding> = new MatTableDataSource();
public dataSource = new MatTableDataSource<Holding>();
public displayedColumns: string[] = [
'name',
'valueInBaseCurrency',

Loading…
Cancel
Save