feat(tooling): add lint-staged with Prettier + ESLint on pre-commit

- Install prettier, lint-staged, eslint-config-prettier
- Configure lint-staged in package.json: Prettier write on staged files, ESLint check on .ts/.html
- Add eslint-config-prettier to .eslintrc.json extends to disable formatting rules that conflict with Prettier
- Configure no-unused-vars to allow _ prefix (intentional destructuring pattern)
- Replace manual prettier/git update-index lines in pre-commit hook with npx lint-staged
- Fix pre-existing ESLint errors: remove unused imports in herowars-guildraid, fix useless escapes in middleware.ts, fix eslint-disable comment in utilityTypes.ts
This commit is contained in:
2026-04-26 06:07:07 +02:00
parent b645f28daf
commit b8eb8a9393
7 changed files with 15376 additions and 15117 deletions
@@ -14,9 +14,7 @@ import { MatStepperIntl, MatStepperModule } from '@angular/material/stepper';
import { ListErrorsComponent } from '@components/shared';
import { Errors } from '@models';
import { HWGuildRaid, HWGuildRaidAttacker, HWGuildRaidAttackers, HWGuildRaidStage, HWMember } from '@models/herowars';
import guildRaids from 'src/files-data/hw-guild-raids.json'; // page Asgard -> Guild Raid -> Log
import { HWGuildRaid, HWGuildRaidStage, HWMember } from '@models/herowars';
@Injectable()
export class GuildRaidStepperIntl extends MatStepperIntl {
@@ -33,25 +31,26 @@ export class GuildRaidStepperIntl extends MatStepperIntl {
},
],
imports: [
DatePipe, FormsModule, ListErrorsComponent,
MatButtonModule, MatCardModule, MatDividerModule, MatFormFieldModule,
MatIconModule, MatInputModule, MatStepperModule
DatePipe,
FormsModule,
ListErrorsComponent,
MatButtonModule,
MatCardModule,
MatDividerModule,
MatFormFieldModule,
MatIconModule,
MatInputModule,
MatStepperModule,
],
templateUrl: './herowars-guildraid.component.html',
styleUrl: './herowars-guildraid.component.scss',
animations: [
trigger('flyInOut', [
state('in', style({ transform: 'translateY(0)' })),
transition('void => *', [
style({ transform: 'translateY(-100%)' }),
animate(200)
]),
transition('* => void', [
style({ transform: 'translateY(100%)' }),
animate(200)
])
])
]
transition('void => *', [style({ transform: 'translateY(-100%)' }), animate(200)]),
transition('* => void', [style({ transform: 'translateY(100%)' }), animate(200)]),
]),
],
})
export class HerowarsGuildraidComponent implements OnInit {
public title = 'Guild Raids';
@@ -68,12 +67,10 @@ export class HerowarsGuildraidComponent implements OnInit {
private _raidStages: HWGuildRaidStage[] = [
{ num: 1, name: 'Stage 1', maxPower: 320000, duration: 8, startTime: 0, endTime: 0 },
{ num: 2, name: 'Stage 2', maxPower: 500000, duration: 8, startTime: 0, endTime: 0 },
{ num: 3, name: 'Stage 3', maxPower: 0, duration: 0, startTime: 0, endTime: 0 }
{ num: 3, name: 'Stage 3', maxPower: 0, duration: 0, startTime: 0, endTime: 0 },
];
constructor(
private _titleService: Title
) { }
constructor(private _titleService: Title) {}
ngOnInit() {
this._titleService.setTitle(this.title);
@@ -81,7 +78,7 @@ export class HerowarsGuildraidComponent implements OnInit {
data.raids = [];
data.raidsInfo = {
variationAvg: 0,
variationSum: 0
variationSum: 0,
};
return data;
});
@@ -90,5 +87,4 @@ export class HerowarsGuildraidComponent implements OnInit {
getMembers(): HWMember[] {
return this._guildMembers;
}
}