Skip to content

Commit 7d8283e

Browse files
committed
fixed eslint errors
1 parent a8e4a62 commit 7d8283e

File tree

23 files changed

+41
-170
lines changed

23 files changed

+41
-170
lines changed

src/Client/Logistics.OfficeApp/.eslintignore

-2
This file was deleted.

src/Client/Logistics.OfficeApp/.eslintrc.json

-50
This file was deleted.

src/Client/Logistics.OfficeApp/.prettierrc.mjs

-16
This file was deleted.

src/Client/Logistics.OfficeApp/.vscode/settings.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"editor.tabSize": 2,
33
"editor.defaultFormatter": "esbenp.prettier-vscode",
4-
"prettier.configPath": "./.prettierrc.mjs",
4+
"prettier.configPath": "./.prettierrc.js",
55
"files.exclude": {
66
"**/node_modules": true,
77
"**/.angular": true,
862 Bytes
Binary file not shown.

src/Client/Logistics.OfficeApp/eslint.config.mjs

-56
This file was deleted.

src/Client/Logistics.OfficeApp/package.json

+5-9
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
{
22
"name": "logistics.office-app",
33
"version": "0.0.0",
4+
"private": true,
5+
"type": "module",
46
"scripts": {
57
"ng": "ng",
68
"start": "ng serve --port 7003",
@@ -11,7 +13,6 @@
1113
"lint": "ng lint",
1214
"prettier": "prettier --write ./src"
1315
},
14-
"private": true,
1516
"dependencies": {
1617
"@angular/animations": "^18.2.7",
1718
"@angular/common": "^18.2.7",
@@ -37,24 +38,19 @@
3738
},
3839
"devDependencies": {
3940
"@angular-devkit/build-angular": "^18.2.7",
40-
"@angular-eslint/builder": "^18.3.1",
41-
"@angular-eslint/eslint-plugin": "^18.3.1",
42-
"@angular-eslint/eslint-plugin-template": "^18.3.1",
43-
"@angular-eslint/schematics": "^18.3.1",
44-
"@angular-eslint/template-parser": "^18.3.1",
4541
"@angular/cli": "^18.2.7",
4642
"@angular/compiler-cli": "^18.2.7",
4743
"@types/jasmine": "^5.1.4",
4844
"@types/mapbox-gl": "^3.4.0",
49-
"@typescript-eslint/eslint-plugin": "^8.8.0",
50-
"@typescript-eslint/parser": "^8.8.0",
45+
"angular-eslint": "^18.3.1",
5146
"eslint": "^9.12.0",
5247
"jasmine-core": "^5.3.0",
5348
"karma": "^6.4.4",
5449
"karma-chrome-launcher": "^3.2.0",
5550
"karma-coverage": "^2.2.1",
5651
"karma-jasmine": "^5.1.0",
5752
"karma-jasmine-html-reporter": "^2.1.0",
58-
"typescript": "^5.4.5"
53+
"typescript": "^5.4.5",
54+
"typescript-eslint": "^8.8.0"
5955
}
6056
}

src/Client/Logistics.OfficeApp/src/app/components/address-form/address-form.component.ts

+6-1
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,12 @@ export class AddressFormComponent implements ControlValueAccessor {
9090
}
9191

9292
setDisabledState(isDisabled: boolean): void {
93-
isDisabled ? this.form.disable() : this.form.enable();
93+
if (isDisabled) {
94+
this.form.disable();
95+
}
96+
else {
97+
this.form.enable();
98+
}
9499
}
95100
}
96101

src/Client/Logistics.OfficeApp/src/app/components/directions-map/directions-map.component.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -62,15 +62,15 @@ export class DirectionsMapComponent implements OnChanges {
6262
return;
6363
}
6464

65-
(this.route = {
65+
this.route = {
6666
type: "geojson",
6767
data: {
6868
type: "Feature",
6969
geometry: data.routes[0].geometry,
7070
properties: {},
7171
},
72-
}),
73-
(this.bounds = [this.start as LngLatLike, this.end as LngLatLike]);
72+
},
73+
this.bounds = [this.start as LngLatLike, this.end as LngLatLike];
7474
this.routeChanged.emit({
7575
origin: this.start!,
7676
destination: this.end!,

src/Client/Logistics.OfficeApp/src/app/components/grosses-barchart/grosses-barchart.component.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,8 @@ export class GrossesBarchartComponent implements OnInit {
7373
}
7474

7575
private drawChart(grosses: MonthlyGrossesDto) {
76-
const labels: Array<string> = [];
77-
const data: Array<number> = [];
76+
const labels: string[] = [];
77+
const data: number[] = [];
7878

7979
grosses.data.forEach((i) => {
8080
labels.push(DateUtils.monthNameWithYear(i.date));

src/Client/Logistics.OfficeApp/src/app/components/range-calendar/range-calendar.component.html

+3-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
<button
55
pButton
66
class="p-button-raised ms-2"
7-
label="Apply"
87
[disabled]="!areDatesValid()"
98
(click)="onClickButton()"
10-
></button>
9+
>
10+
Apply
11+
</button>

src/Client/Logistics.OfficeApp/src/app/components/trucks-map/trucks-map.component.ts

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
/* eslint-disable @typescript-eslint/no-non-null-assertion */
21
import {Component, Input, OnDestroy, OnInit} from "@angular/core";
32
import {CommonModule} from "@angular/common";
43
import {GeolocationMapComponent} from "@/components";

src/Client/Logistics.OfficeApp/src/app/core/auth/auth.service.ts

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
/* eslint-disable indent */
21
import {Injectable} from "@angular/core";
32
import {EventTypes, OidcSecurityService, PublicEventsService} from "angular-auth-oidc-client";
43
import {Observable, filter, map} from "rxjs";

src/Client/Logistics.OfficeApp/src/app/core/services/cookie.service.ts

+6-7
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,13 @@ import {Injectable} from "@angular/core";
33
@Injectable()
44
export class CookieService {
55
getCookie(name: string): string {
6-
const cookies: Array<string> = document.cookie.split(";");
6+
const cookies = document.cookie.split(";");
77
const cookieName = `${name}=`;
8-
let cookie: string;
98

10-
for (let i = 0; i < cookies.length; i += 1) {
11-
cookie = cookies[i].replace(/^\s+/g, "");
12-
if (cookie.indexOf(cookieName) == 0) {
13-
return cookie.substring(cookieName.length, cookie.length);
9+
for (const cookie of cookies) {
10+
const cookieValue = cookie.replace(/^\s+/g, "");
11+
if (cookieValue.indexOf(cookieName) == 0) {
12+
return cookieValue.substring(cookieName.length, cookieValue.length);
1413
}
1514
}
1615
return "";
@@ -31,7 +30,7 @@ export class CookieService {
3130
* {service instance}.setCookie({name:'niceCar', value:'red', expireDays:10 }); <- For all this examples if path is not provided default will be root
3231
*/
3332
setCookie(cookie: Cookie) {
34-
const date: Date = new Date();
33+
const date = new Date();
3534
date.setTime(date.getTime() + (cookie.expireDays ? cookie.expireDays : 1) * 24 * 60 * 60 * 1000);
3635
const path = cookie.path && cookie.path.length > 0 ? cookie.path : "/";
3736
const expires = cookie.session && cookie.session == true ? "" : `expires=${date.toUTCString()};`;

src/Client/Logistics.OfficeApp/src/app/core/services/storage.service.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@ export class StorageService {
55
get<T = unknown>(name: string): T | null {
66
try {
77
return JSON.parse(localStorage.getItem(name) as string) as T;
8-
} catch (error) {
8+
}
9+
catch (error) {
10+
console.error("Error while parsing data from local storage", error);
911
return null;
1012
}
1113
}

src/Client/Logistics.OfficeApp/src/app/pages/accounting/edit-payment/edit-payment.component.ts

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
/* eslint-disable @typescript-eslint/no-non-null-assertion */
21
import {Component, OnInit} from "@angular/core";
32
import {CommonModule} from "@angular/common";
43
import {FormControl, FormGroup, ReactiveFormsModule, Validators} from "@angular/forms";

src/Client/Logistics.OfficeApp/src/app/pages/accounting/edit-payroll/edit-payroll.component.ts

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
/* eslint-disable @typescript-eslint/no-non-null-assertion */
21
import {Component, OnInit} from "@angular/core";
32
import {CommonModule} from "@angular/common";
43
import {FormGroup, FormControl, Validators, ReactiveFormsModule} from "@angular/forms";

src/Client/Logistics.OfficeApp/src/app/pages/customer/edit-customer/edit-customer.component.ts

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
/* eslint-disable @typescript-eslint/no-non-null-assertion */
21
import {Component, OnInit} from "@angular/core";
32
import {CommonModule} from "@angular/common";
43
import {FormControl, FormGroup, ReactiveFormsModule, Validators} from "@angular/forms";

src/Client/Logistics.OfficeApp/src/app/pages/employee/services/user.service.ts

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
/* eslint-disable indent */
21
import {Injectable} from "@angular/core";
32
import {map, Observable} from "rxjs";
43
import {RoleDto, UserDto} from "@/core/models";

src/Client/Logistics.OfficeApp/src/app/pages/home/home.component.ts

+10-10
Original file line numberDiff line numberDiff line change
@@ -51,22 +51,22 @@ export class HomeComponent implements OnInit {
5151
public chartOptions: unknown;
5252

5353
constructor(private readonly apiService: ApiService) {
54-
(this.chartData = {
54+
this.chartData = {
5555
labels: [],
5656
datasets: [
5757
{
5858
label: "Daily Gross",
5959
data: [],
6060
},
6161
],
62-
}),
63-
(this.chartOptions = {
64-
plugins: {
65-
legend: {
66-
display: false,
67-
},
62+
},
63+
this.chartOptions = {
64+
plugins: {
65+
legend: {
66+
display: false,
6867
},
69-
});
68+
},
69+
};
7070
}
7171

7272
ngOnInit() {
@@ -106,8 +106,8 @@ export class HomeComponent implements OnInit {
106106
}
107107

108108
private drawChart(grosses: DailyGrossesDto) {
109-
const labels: Array<string> = [];
110-
const data: Array<number> = [];
109+
const labels: string[] = [];
110+
const data: number[] = [];
111111

112112
grosses.data.forEach((i) => {
113113
labels.push(DateUtils.toLocaleDate(i.date));

src/Client/Logistics.OfficeApp/src/app/pages/load/add-load/add-load.component.ts

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
/* eslint-disable @typescript-eslint/no-non-null-assertion */
21
import {Component, OnInit} from "@angular/core";
32
import {NgIf} from "@angular/common";
43
import {FormControl, FormGroup, Validators, FormsModule, ReactiveFormsModule} from "@angular/forms";

src/Client/Logistics.OfficeApp/src/app/pages/load/edit-load/edit-load.component.ts

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
/* eslint-disable @typescript-eslint/no-non-null-assertion */
21
import {Component, OnInit} from "@angular/core";
32
import {CommonModule} from "@angular/common";
43
import {FormControl, FormGroup, Validators, FormsModule, ReactiveFormsModule} from "@angular/forms";

src/Client/Logistics.OfficeApp/src/app/pages/truck/components/truck-grosses-linechart/truck-grosses-linechart.component.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,8 @@ export class TruckGrossesLinechartComponent implements OnInit {
7171
}
7272

7373
private drawChart(grosses: DailyGrossesDto) {
74-
const labels: Array<string> = [];
75-
const data: Array<number> = [];
74+
const labels: string[] = [];
75+
const data: string[] = [];
7676

7777
grosses.data.forEach((i) => {
7878
labels.push(DateUtils.toLocaleDate(i.date));

0 commit comments

Comments
 (0)