Skip to content

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

Bugfix/fix eslint configuration (#3852)

dw-0dd28f38e60b8
diff --git a/.eslintrc.json b/.eslintrc.json
index 1b7628ebf1..fc591aab6f 100644
--- a/.eslintrc.json
+++ b/.eslintrc.json
@@ -7,7 +7,7 @@
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
"rules": {
"@nx/enforce-module-boundaries": [
- "error",
+ "warn",
{
"enforceBuildableLibDependency": true,
"allow": [],
@@ -18,30 +18,24 @@
}
]
}
- ]
+ ],
+ "@typescript-eslint/no-extra-semi": "error",
+ "no-extra-semi": "off"
}
},
{
"files": ["*.ts", "*.tsx"],
- "extends": ["plugin:@nx/typescript"],
- "rules": {
- "@typescript-eslint/no-extra-semi": "error",
- "no-extra-semi": "off"
- }
+ "extends": ["plugin:@nx/typescript"]
},
{
"files": ["*.js", "*.jsx"],
- "extends": ["plugin:@nx/javascript"],
- "rules": {
- "@typescript-eslint/no-extra-semi": "error",
- "no-extra-semi": "off"
- }
+ "extends": ["plugin:@nx/javascript"]
},
{
"files": ["*.ts"],
"plugins": ["eslint-plugin-import", "@typescript-eslint"],
"rules": {
- "@typescript-eslint/consistent-type-definitions": "error",
+ "@typescript-eslint/consistent-type-definitions": "warn",
"@typescript-eslint/dot-notation": "off",
"@typescript-eslint/explicit-member-accessibility": [
"off",
@@ -49,76 +43,62 @@
"accessibility": "explicit"
}
],
- "@typescript-eslint/member-ordering": "error",
+ "@typescript-eslint/member-ordering": "warn",
"@typescript-eslint/naming-convention": "off",
"@typescript-eslint/no-empty-function": "off",
- "@typescript-eslint/no-empty-interface": "error",
+ "@typescript-eslint/no-empty-interface": "warn",
"@typescript-eslint/no-inferrable-types": [
- "error",
+ "warn",
{
"ignoreParameters": true
}
],
"@typescript-eslint/no-misused-new": "error",
- "@typescript-eslint/no-non-null-assertion": "error",
+ "@typescript-eslint/no-non-null-assertion": "warn",
"@typescript-eslint/no-shadow": [
- "error",
+ "warn",
{
"hoist": "all"
}
],
- "@typescript-eslint/no-unused-expressions": "error",
- "@typescript-eslint/prefer-function-type": "error",
+ "@typescript-eslint/no-unused-expressions": "warn",
+ "@typescript-eslint/prefer-function-type": "warn",
"@typescript-eslint/unified-signatures": "error",
+ "@typescript-eslint/no-loss-of-precision": "warn",
+ "@typescript-eslint/no-var-requires": "warn",
+ "@typescript-eslint/ban-ts-comment": "warn",
+ "@typescript-eslint/ban-types": "warn",
"arrow-body-style": "off",
"constructor-super": "error",
"eqeqeq": ["error", "smart"],
- "guard-for-in": "error",
+ "guard-for-in": "warn",
"id-blacklist": "off",
"id-match": "off",
"import/no-deprecated": "warn",
"no-bitwise": "error",
"no-caller": "error",
- "no-console": [
- "error",
- {
- "allow": [
- "log",
- "warn",
- "dir",
- "timeLog",
- "assert",
- "clear",
- "count",
- "countReset",
- "group",
- "groupEnd",
- "table",
- "dirxml",
- "error",
- "groupCollapsed",
- "Console",
- "profile",
- "profileEnd",
- "timeStamp",
- "context"
- ]
- }
- ],
"no-debugger": "error",
"no-empty": "off",
"no-eval": "error",
"no-fallthrough": "error",
"no-new-wrappers": "error",
"no-restricted-imports": ["error", "rxjs/Rx"],
- "no-throw-literal": "error",
+ "no-throw-literal": "warn",
"no-undef-init": "error",
"no-underscore-dangle": "off",
"no-var": "error",
- "prefer-const": "error",
- "radix": "error"
+ "prefer-const": "warn",
+ "radix": "error",
+ "no-unsafe-optional-chaining": "warn",
+ "no-extra-boolean-cast": "warn",
+ "no-empty-pattern": "warn",
+ "no-useless-catch": "warn",
+ "no-unsafe-finally": "warn",
+ "no-prototype-builtins": "warn",
+ "no-async-promise-executor": "warn",
+ "no-constant-condition": "warn"
}
}
],
- "extends": [null, "plugin:storybook/recommended"]
+ "extends": ["plugin:storybook/recommended"]
}
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 9ba9ee7a19..3f943048a0 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -20,6 +20,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixed
- Fixed an issue in the calculation of allocations by market (_Unknown_)
+- Fixed the `eslint` configuration
## 2.111.0 - 2024-09-28
diff --git a/apps/client/src/app/pages/landing/landing-page.html b/apps/client/src/app/pages/landing/landing-page.html
index f726a6020d..7ce9382277 100644
--- a/apps/client/src/app/pages/landing/landing-page.html
+++ b/apps/client/src/app/pages/landing/landing-page.html
@@ -331,7 +331,7 @@
<div class="col-md-8 offset-md-2">
<gf-carousel [aria-label]="'Testimonials'">
@for (testimonial of testimonials; track testimonial) {
- <div #carouselItem gf-carousel-item>
+ <div #carouselItem gfCarouselItem>
<div class="d-flex px-4">
<gf-logo
class="mr-3 mt-2 pt-1"
diff --git a/libs/ui/src/lib/carousel/carousel-item.directive.ts b/libs/ui/src/lib/carousel/carousel-item.directive.ts
index 690c718840..38c3ab2127 100644
--- a/libs/ui/src/lib/carousel/carousel-item.directive.ts
+++ b/libs/ui/src/lib/carousel/carousel-item.directive.ts
@@ -1,8 +1,8 @@
import { Directive, ElementRef } from '@angular/core';
@Directive({
- selector: '[gf-carousel-item]'
+ selector: '[gfCarouselItem]'
})
-export class CarouselItem {
+export class CarouselItemDirective {
public constructor(readonly element: ElementRef<HTMLElement>) {}
}
diff --git a/libs/ui/src/lib/fire-calculator/fire-calculator.service.ts b/libs/ui/src/lib/fire-calculator/fire-calculator.service.ts
index 20247ef904..8a5e3afb95 100644
--- a/libs/ui/src/lib/fire-calculator/fire-calculator.service.ts
+++ b/libs/ui/src/lib/fire-calculator/fire-calculator.service.ts
@@ -52,7 +52,7 @@ export class FireCalculatorService {
r: number;
totalAmount: number;
}) {
- if (r == 0) {
+ if (r === 0) {
// No compound interest
return (totalAmount - P) / PMT;
} else if (totalAmount <= P) {
diff --git a/libs/ui/src/lib/holdings-table/holdings-table.component.ts b/libs/ui/src/lib/holdings-table/holdings-table.component.ts
index 53e17e5b76..1f44cf4055 100644
--- a/libs/ui/src/lib/holdings-table/holdings-table.component.ts
+++ b/libs/ui/src/lib/holdings-table/holdings-table.component.ts
@@ -53,7 +53,7 @@ import { Subject, Subscription } from 'rxjs';
styleUrls: ['./holdings-table.component.scss'],
templateUrl: './holdings-table.component.html'
})
-export class GfHoldingsTableComponent implements OnChanges, OnDestroy, OnInit {
+export class GfHoldingsTableComponent implements OnChanges, OnDestroy {
@Input() baseCurrency: string;
@Input() deviceType: string;
@Input() hasPermissionToCreateActivity: boolean;
@@ -79,8 +79,6 @@ export class GfHoldingsTableComponent implements OnChanges, OnDestroy, OnInit {
public constructor() {}
- public ngOnInit() {}
-
public ngOnChanges() {
this.displayedColumns = ['icon', 'nameWithSymbol', 'dateOfFirstActivity'];
diff --git a/libs/ui/src/lib/shared/abstract-mat-form-field.ts b/libs/ui/src/lib/shared/abstract-mat-form-field.ts
index 460b6969dc..05491b8ab8 100644
--- a/libs/ui/src/lib/shared/abstract-mat-form-field.ts
+++ b/libs/ui/src/lib/shared/abstract-mat-form-field.ts
@@ -16,6 +16,7 @@ import { Subject } from 'rxjs';
@Component({
template: ''
})
+// eslint-disable-next-line @angular-eslint/component-class-suffix
export abstract class AbstractMatFormField<T>
implements ControlValueAccessor, DoCheck, MatFormFieldControl<T>, OnDestroy
{
diff --git a/libs/ui/src/lib/top-holdings/top-holdings.component.ts b/libs/ui/src/lib/top-holdings/top-holdings.component.ts
index 6f76956870..38ef3524d0 100644
--- a/libs/ui/src/lib/top-holdings/top-holdings.component.ts
+++ b/libs/ui/src/lib/top-holdings/top-holdings.component.ts
@@ -38,7 +38,7 @@ import { Subject } from 'rxjs';
styleUrls: ['./top-holdings.component.scss'],
templateUrl: './top-holdings.component.html'
})
-export class GfTopHoldingsComponent implements OnChanges, OnDestroy, OnInit {
+export class GfTopHoldingsComponent implements OnChanges, OnDestroy {
@Input() baseCurrency: string;
@Input() locale = getLocale();
@Input() pageSize = Number.MAX_SAFE_INTEGER;
@@ -57,10 +57,6 @@ export class GfTopHoldingsComponent implements OnChanges, OnDestroy, OnInit {
private unsubscribeSubject = new Subject<void>();
- public constructor() {}
-
- public ngOnInit() {}
-
public ngOnChanges() {
this.isLoading = true;