Skip to content

Commit 8885aa0

Browse files
author
Serhii Hultiaieev
committed
Fix eslint errors
1 parent 7cad2aa commit 8885aa0

File tree

3 files changed

+57
-23
lines changed

3 files changed

+57
-23
lines changed

.eslintrc.json

Lines changed: 39 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,19 @@
11
{
22
"root": true,
3-
"ignorePatterns": ["projects/**/*", "dist/**/*"],
3+
"ignorePatterns": [
4+
"projects/**/*",
5+
"dist/**/*"
6+
],
47
"overrides": [
58
{
6-
"files": ["*.ts"],
9+
"files": [
10+
"*.ts"
11+
],
712
"parserOptions": {
8-
"project": ["tsconfig.json", "e2e/tsconfig.json"],
13+
"project": [
14+
"tsconfig.json",
15+
"e2e/tsconfig.json"
16+
],
917
"createDefaultProgram": true
1018
},
1119
"extends": [
@@ -32,21 +40,42 @@
3240
"style": "camelCase"
3341
}
3442
],
35-
"rxjs/no-subject-value": [0]
43+
"rxjs/no-subject-value": [
44+
0
45+
]
3646
}
3747
},
3848
{
39-
"files": ["*.html"],
40-
"extends": ["plugin:@angular-eslint/template/recommended", "prettier"],
49+
"files": [
50+
"*.html"
51+
],
52+
"extends": [
53+
"plugin:@angular-eslint/template/recommended",
54+
"prettier"
55+
],
4156
"rules": {}
4257
},
4358
{
44-
"files": ["*.spec.ts"],
45-
"plugins": ["jasmine"],
46-
"extends": ["plugin:jasmine/recommended"],
59+
"files": [
60+
"*.spec.ts"
61+
],
62+
"plugins": [
63+
"jasmine"
64+
],
65+
"extends": [
66+
"plugin:jasmine/recommended"
67+
],
4768
"env": {
4869
"jasmine": true
4970
}
71+
},
72+
{
73+
"files": [
74+
"*.js"
75+
],
76+
"env": {
77+
"es6": true
78+
}
5079
}
5180
]
52-
}
81+
}

src/app/admin/edit-product/edit-product.component.ts

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -32,19 +32,6 @@ export class EditProductComponent implements OnInit, OnDestroy {
3232

3333
loaded$ = new BehaviorSubject(false);
3434

35-
get countCtrl(): AbstractControl {
36-
return this.form.get('count') as AbstractControl;
37-
}
38-
get descriptionCtrl(): AbstractControl {
39-
return this.form.get('description') as AbstractControl;
40-
}
41-
get priceCtrl(): AbstractControl {
42-
return this.form.get('price') as AbstractControl;
43-
}
44-
get titleCtrl(): AbstractControl {
45-
return this.form.get('title') as AbstractControl;
46-
}
47-
4835
private readonly onDestroy$: Subject<void> = new Subject();
4936

5037
constructor(
@@ -62,6 +49,22 @@ export class EditProductComponent implements OnInit, OnDestroy {
6249
});
6350
}
6451

52+
get countCtrl(): AbstractControl {
53+
return this.form.get('count') as AbstractControl;
54+
}
55+
56+
get descriptionCtrl(): AbstractControl {
57+
return this.form.get('description') as AbstractControl;
58+
}
59+
60+
get priceCtrl(): AbstractControl {
61+
return this.form.get('price') as AbstractControl;
62+
}
63+
64+
get titleCtrl(): AbstractControl {
65+
return this.form.get('title') as AbstractControl;
66+
}
67+
6568
ngOnInit(): void {
6669
const productId = this.activatedRoute.snapshot.paramMap.get('productId');
6770

src/app/cart/cart.service.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,10 @@ export class CartService {
99
/** Key - item id, value - ordered amount */
1010
#cartSource = new BehaviorSubject<Record<string, number>>({});
1111

12+
// eslint-disable-next-line @typescript-eslint/member-ordering
1213
cart$ = this.#cartSource.asObservable();
1314

15+
// eslint-disable-next-line @typescript-eslint/member-ordering
1416
totalInCart$: Observable<number> = this.cart$.pipe(
1517
map((cart) => {
1618
const values = Object.values(cart);

0 commit comments

Comments
 (0)