Skip to content

Commit ddb5394

Browse files
committed
refactor: update prettier to latest version
1 parent b5c0002 commit ddb5394

16 files changed

+143
-356
lines changed

.prettierrc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,7 @@
44
"useTabs": false,
55
"tabWidth": 2,
66
"semi": true,
7-
"bracketSpacing": true
7+
"bracketSpacing": true,
8+
"arrowParens": "avoid",
9+
"trailingComma": "none"
810
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@
101101
"lint-staged": "^8.1.0",
102102
"markdown-it": "^12.2.0",
103103
"nodemon": "^1.18.7",
104-
"prettier": "^1.15.2",
104+
"prettier": "^3.3.1",
105105
"shorthash": "^0.0.2",
106106
"ts-loader": "^5.3.1",
107107
"ts-node": "~8.3.0",

src/app/checklist/checklist.component.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -140,9 +140,7 @@ export class ChecklistComponent {
140140
}
141141
});
142142

143-
return dialogRef.afterClosed().pipe(
144-
tap<boolean>(result => this.processDialogResult(result, favorites))
145-
);
143+
return dialogRef.afterClosed().pipe(tap<boolean>(result => this.processDialogResult(result, favorites)));
146144
}
147145

148146
private processDialogResult(result: boolean, favorites: Array<ChecklistItem>) {

src/app/checklist/project-exists.guard.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Injectable } from '@angular/core';
1+
import { Injectable, inject } from '@angular/core';
22
import { ActivatedRouteSnapshot, Router } from '@angular/router';
33
import { select, Store } from '@ngrx/store';
44
import { of } from 'rxjs';
@@ -11,7 +11,8 @@ import { ApplicationState } from '../state/app.state';
1111
providedIn: 'root'
1212
})
1313
export class ProjectExistsGuard {
14-
constructor(private store: Store<ApplicationState>, private router: Router) {}
14+
private store = inject<Store<ApplicationState>>(Store);
15+
private router = inject(Router);
1516

1617
canActivate(snapshot: ActivatedRouteSnapshot) {
1718
const projectId = snapshot.params.project;

src/app/checklist/search/search.service.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Injectable } from '@angular/core';
1+
import { inject, Injectable } from '@angular/core';
22
import { ActionsSubject, select, Store } from '@ngrx/store';
33
import * as fuzzysort from 'fuzzysort';
44
import { merge, of, zip } from 'rxjs';
@@ -13,6 +13,8 @@ import { IndexEntry } from './search.models';
1313

1414
@Injectable()
1515
export class SearchService {
16+
private store = inject<Store<ApplicationState>>(Store);
17+
private actions = inject(ActionsSubject);
1618
private index: Array<IndexEntry<ChecklistItem | CategoryEntity>>;
1719

1820
private options: Fuzzysort.KeyOptions = {
@@ -22,7 +24,7 @@ export class SearchService {
2224
threshold: -10000
2325
};
2426

25-
constructor(private store: Store<ApplicationState>, private actions: ActionsSubject) {
27+
constructor() {
2628
const actions$ = this.actions.pipe(filter(action => action.type === ProjectsActionTypes.TOGGLE_CATEGORY));
2729

2830
merge(actions$, of('INIT INDEX'))

src/app/checklist/state/checklist.selectors.ts

Lines changed: 14 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -47,28 +47,23 @@ export namespace ChecklistSelectors {
4747
ProjectsSelectors.getDisabledCategories,
4848
getScores,
4949
(categories, items, disabledCategories, scores): Array<Category> => {
50-
return Object.keys(categories).map(
51-
(categoryId): Category => {
52-
const category = categories[categoryId];
53-
const categoryItems = category.items.map(itemId => items[itemId]);
54-
55-
return {
56-
...category,
57-
score: scores[categoryId],
58-
enabled: !disabledCategories[category.slug],
59-
items: categoryItems
60-
};
61-
}
62-
);
50+
return Object.keys(categories).map((categoryId): Category => {
51+
const category = categories[categoryId];
52+
const categoryItems = category.items.map(itemId => items[itemId]);
53+
54+
return {
55+
...category,
56+
score: scores[categoryId],
57+
enabled: !disabledCategories[category.slug],
58+
items: categoryItems
59+
};
60+
});
6361
}
6462
);
6563

66-
export const getActiveCategories = createSelector(
67-
getAllCategories,
68-
(categories): Array<Category> => {
69-
return categories.filter(category => category.enabled);
70-
}
71-
);
64+
export const getActiveCategories = createSelector(getAllCategories, (categories): Array<Category> => {
65+
return categories.filter(category => category.enabled);
66+
});
7267

7368
export const getSelectedCategory = createSelector(
7469
AppSelectors.getRouterState,

src/app/shared/dropdown/dropdown-static-options.component.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,15 @@ import { Component } from '@angular/core';
33
@Component({
44
standalone: true,
55
selector: 'ac-dropdown-static-options',
6-
template: `
7-
<ng-content></ng-content>
8-
`,
6+
template: ` <ng-content></ng-content> `,
97
styleUrls: ['./dropdown-static-options.component.scss']
108
})
119
export class DropdownStaticOptionsComponent {}
1210

1311
@Component({
1412
standalone: true,
1513
selector: 'ac-dropdown-static-option',
16-
template: `
17-
<ng-content></ng-content>
18-
`,
14+
template: ` <ng-content></ng-content> `,
1915
styleUrls: ['./dropdown-static-option.component.scss']
2016
})
2117
export class DropdownStaticOptionComponent {}

src/app/shared/dropdown/dropdown.component.scss

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@
1515
border-radius: 8px;
1616
margin: 5px 0 0 0;
1717
max-height: 268px !important;
18-
box-shadow: 0 1px 2px 0 rgba(60, 64, 67, 0.3), 0 2px 6px 2px rgba(60, 64, 67, 0.15) !important;
18+
box-shadow:
19+
0 1px 2px 0 rgba(60, 64, 67, 0.3),
20+
0 2px 6px 2px rgba(60, 64, 67, 0.15) !important;
1921

2022
.mat-mdc-selected:not(.mat-mdc-option-multiple) {
2123
background: mat.get-color-from-palette(theme.$app-primary, lighter, 0.3) !important;

src/app/shared/score-chart/score-chart.component.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ import {
77
OnChanges,
88
SimpleChanges,
99
HostBinding,
10-
Inject,
11-
PLATFORM_ID
10+
PLATFORM_ID,
11+
inject
1212
} from '@angular/core';
1313

1414
@Component({
@@ -19,14 +19,15 @@ import {
1919
changeDetection: ChangeDetectionStrategy.OnPush
2020
})
2121
export class ScoreChartComponent implements OnChanges {
22+
private elementRef = inject(ElementRef);
2223
@Input() score: number;
2324

2425
@HostBinding('class.done') done = false;
2526

2627
isBrowser = true;
2728

28-
constructor(private elementRef: ElementRef, @Inject(PLATFORM_ID) platformId: string) {
29-
this.isBrowser = isPlatformBrowser(platformId);
29+
constructor() {
30+
this.isBrowser = isPlatformBrowser(inject(PLATFORM_ID));
3031
}
3132

3233
ngOnChanges(changes: SimpleChanges) {

src/app/shared/utils.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,5 @@ export const hasEntities = (entityState: EntityState<any>) => {
99
};
1010

1111
export const convertToProjectId = (projectName: string) => {
12-
return projectName
13-
.toLowerCase()
14-
.replace(/\s+/g, '-')
15-
.trim();
12+
return projectName.toLowerCase().replace(/\s+/g, '-').trim();
1613
};

0 commit comments

Comments
 (0)