Skip to content

Commit

Permalink
style: add eslint rule for ng decorator array sorting (#135)
Browse files Browse the repository at this point in the history
  • Loading branch information
MaSch0212 authored Jul 7, 2024
1 parent 24be04b commit be73baf
Show file tree
Hide file tree
Showing 15 changed files with 48 additions and 25 deletions.
4 changes: 3 additions & 1 deletion src/client/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@
"parserOptions": {
"project": "./tsconfig.json"
},
"plugins": ["ng-module-sort"],
"rules": {
"@angular-eslint/prefer-on-push-component-change-detection": "error",
"no-console": "error"
"no-console": "error",
"ng-module-sort/decorator-array-items": "error"
}
}
1 change: 1 addition & 0 deletions src/client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@
"eslint": "^8.57.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-ng-module-sort": "^1.3.1",
"eslint-plugin-unused-imports": "^3.0.0",
"http-server": "^14.1.1",
"jest": "^29.7.0",
Expand Down
20 changes: 20 additions & 0 deletions src/client/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/client/src/app/components/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ import { WebPushService } from '../../services/web-push.service';
selector: 'app-root',
standalone: true,
imports: [
ConfirmDialogModule,
CommonModule,
ConfirmDialogModule,
FooterComponent,
RouterOutlet,
MenuComponent,
NotificationPromptDialogComponent,
RouterOutlet,
ToastModule,
],
providers: [ConfirmationService, MessageService],
Expand Down
4 changes: 2 additions & 2 deletions src/client/src/app/components/app/menu/menu.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ import { chainSignals } from '../../../utils/signal.utils';
imports: [
ButtonModule,
CommonModule,
MenubarModule,
MenuModule,
TooltipModule,
MenubarModule,
OverlayPanelModule,
TooltipModule,
],
templateUrl: './menu.component.html',
changeDetection: ChangeDetectionStrategy.OnPush,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ import { EventTimeslotDialogComponent } from '../event-timeslot-dialog/event-tim
ButtonModule,
CardModule,
CommonModule,
EventTimeslotDialogComponent,
EventFormComponent,
EventTimeslotDialogComponent,
InterpolatePipe,
MessagesModule,
ProgressSpinnerModule,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,14 @@ import { hasTouchScreen } from '../../../utils/user-agent.utils';
selector: 'app-event-timeslot-dialog',
standalone: true,
imports: [
DialogModule,
CalendarModule,
ButtonModule,
CalendarModule,
DialogModule,
DropdownModule,
ErrorTextDirective,
InputSwitchModule,
MessagesModule,
ReactiveFormsModule,
ErrorTextDirective,
],
templateUrl: './event-timeslot-dialog.component.html',
styleUrl: './event-timeslot-dialog.component.scss',
Expand Down
2 changes: 1 addition & 1 deletion src/client/src/app/components/events/events.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ import { selectSignal } from '../../utils/ngrx.utils';
MenuModule,
MessagesModule,
ProgressSpinnerModule,
RouterLink,
RippleModule,
RouterLink,
TooltipModule,
],
templateUrl: './events.component.html',
Expand Down
6 changes: 3 additions & 3 deletions src/client/src/app/components/login/login.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@ import { TranslateService } from '../../services/translate.service';
CardModule,
CommonModule,
ErrorTextDirective,
OnEnterDirective,
ReactiveFormsModule,
ProgressSpinnerModule,
InputTextModule,
InterpolatePipe,
OnEnterDirective,
PasswordModule,
ProgressSpinnerModule,
ReactiveFormsModule,
TooltipModule,
],
templateUrl: './login.component.html',
Expand Down
2 changes: 1 addition & 1 deletion src/client/src/app/components/maps/maps.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ function mapMatchesFilter(
CommonModule,
FormsModule,
InputTextModule,
MessagesModule,
MapDialogComponent,
MapItemComponent,
MessagesModule,
ProgressSpinnerModule,
],
templateUrl: './maps.component.html',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,19 +49,19 @@ const gameDuration = 90 * 60 * 1000;
selector: 'app-player-event-details',
standalone: true,
imports: [
CommonModule,
ButtonModule,
CardModule,
CommonModule,
DropdownModule,
FadingMessageComponent,
FormsModule,
ProgressSpinnerModule,
InputSwitchModule,
MessagesModule,
OverlayPanelModule,
ProgressSpinnerModule,
ResetNgModelDirective,
RouterLink,
TooltipModule,
MessagesModule,
InputSwitchModule,
ResetNgModelDirective,
],
templateUrl: './player-event-details.component.html',
styleUrl: './player-event-details.component.scss',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const dayMillis = 24 * 60 * 60 * 1000;
@Component({
selector: 'app-player-events',
standalone: true,
imports: [CommonModule, ProgressSpinnerModule, RouterLink, InterpolatePipe, MessagesModule],
imports: [CommonModule, InterpolatePipe, MessagesModule, ProgressSpinnerModule, RouterLink],
templateUrl: './player-events.component.html',
styleUrl: './player-events.component.scss',
changeDetection: ChangeDetectionStrategy.OnPush,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ type NotifyTimeslotStartOption = {
CardModule,
CommonModule,
DropdownModule,
FormsModule,
FloatLabelModule,
FormsModule,
InputSwitchModule,
MessagesModule,
ProgressSpinnerModule,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,10 @@ import { UserItemComponent } from '../user-item/user-item.component';
InputTextModule,
InterpolatePipe,
ListboxModule,
OverlayPanelModule,
MessagesModule,
UserItemComponent,
OverlayPanelModule,
ReactiveFormsModule,
UserItemComponent,
],
templateUrl: './user-dialog.component.html',
changeDetection: ChangeDetectionStrategy.OnPush,
Expand Down
4 changes: 2 additions & 2 deletions src/client/src/app/components/users/users.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ function userMatchesFilter(map: User | undefined, lowerCaseFilter: string): map
FormsModule,
InputTextModule,
MessagesModule,
ProgressSpinnerModule,
UserDialogComponent,
UserPushDialogComponent,
UserItemComponent,
ProgressSpinnerModule,
UserPushDialogComponent,
],
templateUrl: './users.component.html',
styleUrl: './users.component.scss',
Expand Down

0 comments on commit be73baf

Please sign in to comment.