style(frontend): apply the first eslint autofix pass
- ESLint autofixes: - apply the safe automatic ESLint rewrites without taking on manual typing, accessibility, or Angular inject migrations - normalize `==` and `!=` comparisons in templates, convert `Array<T>` to `T[]`, and tighten a small set of `let` declarations to `const` - remove `autofocus` attributes that ESLint can rewrite mechanically - Cleanup scope: - keep this pass limited to files changed by `ng lint --fix` so the remaining 702 manual ESLint findings stay isolated for later review - Validation: - `env YARN_ENABLE_GLOBAL_CACHE=0 YARN_CACHE_FOLDER=../.yarn/cache corepack yarn lint:eslint --fix` reduced the remaining ESLint count from 721 to 702 before stopping on non-fixable issues
This commit is contained in:
+1
-1
@@ -84,7 +84,7 @@
|
|||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
</td>
|
</td>
|
||||||
} @else if (col.field === 'amazonRating' || col.field === 'goodreadsRating' || col.field === 'hardcoverRating' || col.field == 'ranobedbRating') {
|
} @else if (col.field === 'amazonRating' || col.field === 'goodreadsRating' || col.field === 'hardcoverRating' || col.field === 'ranobedbRating') {
|
||||||
<td class="cell-rating">
|
<td class="cell-rating">
|
||||||
<span class="rating-wrapper">
|
<span class="rating-wrapper">
|
||||||
<p-rating
|
<p-rating
|
||||||
|
|||||||
@@ -137,7 +137,7 @@ export class SortService {
|
|||||||
const aValue = extractor(a);
|
const aValue = extractor(a);
|
||||||
const bValue = extractor(b);
|
const bValue = extractor(b);
|
||||||
|
|
||||||
let result = this.compareValues(aValue, bValue);
|
const result = this.compareValues(aValue, bValue);
|
||||||
|
|
||||||
return criterion.direction === SortDirection.ASCENDING ? result : -result;
|
return criterion.direction === SortDirection.ASCENDING ? result : -result;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ export class DashboardConfigService {
|
|||||||
|
|
||||||
private syncMagicShelfTitles(
|
private syncMagicShelfTitles(
|
||||||
config: DashboardConfig,
|
config: DashboardConfig,
|
||||||
shelves: Array<{ id?: number | null; name: string }>
|
shelves: { id?: number | null; name: string }[]
|
||||||
): DashboardConfig | null {
|
): DashboardConfig | null {
|
||||||
let updated = false;
|
let updated = false;
|
||||||
|
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ export class LibraryCreatorComponent implements OnInit {
|
|||||||
watch: boolean = false;
|
watch: boolean = false;
|
||||||
formatPriority: {type: BookType, label: string}[] = [];
|
formatPriority: {type: BookType, label: string}[] = [];
|
||||||
allowAllFormats: boolean = true;
|
allowAllFormats: boolean = true;
|
||||||
selectedAllowedFormats: Set<BookType> = new Set();
|
selectedAllowedFormats = new Set<BookType>();
|
||||||
formatCounts: Record<string, number> = {};
|
formatCounts: Record<string, number> = {};
|
||||||
metadataSource: MetadataSource = 'EMBEDDED';
|
metadataSource: MetadataSource = 'EMBEDDED';
|
||||||
organizationMode: OrganizationMode = 'BOOK_PER_FILE';
|
organizationMode: OrganizationMode = 'BOOK_PER_FILE';
|
||||||
|
|||||||
+7
-7
@@ -82,14 +82,14 @@ export class MetadataSearcherComponent implements OnInit, OnDestroy, OnChanges {
|
|||||||
this.syncFormFromState();
|
this.syncFormFromState();
|
||||||
});
|
});
|
||||||
|
|
||||||
providerCounts: Map<string, number> = new Map();
|
providerCounts = new Map<string, number>();
|
||||||
providerLoading: Map<string, boolean> = new Map();
|
providerLoading = new Map<string, boolean>();
|
||||||
selectedProviderFilters: Set<string> = new Set(['all']);
|
selectedProviderFilters = new Set<string>(['all']);
|
||||||
filteredMetadata: BookMetadata[] = [];
|
filteredMetadata: BookMetadata[] = [];
|
||||||
providerFilterOptions: Array<{ label: string; value: string }> = [];
|
providerFilterOptions: { label: string; value: string }[] = [];
|
||||||
|
|
||||||
private metadataByProvider: Map<string, BookMetadata[]> = new Map();
|
private metadataByProvider = new Map<string, BookMetadata[]>();
|
||||||
private providerCompletionStatus: Map<string, boolean> = new Map();
|
private providerCompletionStatus = new Map<string, boolean>();
|
||||||
private pendingAutoSearch = false;
|
private pendingAutoSearch = false;
|
||||||
private providerInitialized = false;
|
private providerInitialized = false;
|
||||||
|
|
||||||
@@ -363,7 +363,7 @@ export class MetadataSearcherComponent implements OnInit, OnDestroy, OnChanges {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
getProviderTabs(): Array<{ provider: string; count: number }> {
|
getProviderTabs(): { provider: string; count: number }[] {
|
||||||
return Array.from(this.providerCounts.entries()).map(([provider, count]) => ({
|
return Array.from(this.providerCounts.entries()).map(([provider, count]) => ({
|
||||||
provider: provider.charAt(0).toUpperCase() + provider.slice(1),
|
provider: provider.charAt(0).toUpperCase() + provider.slice(1),
|
||||||
count
|
count
|
||||||
|
|||||||
@@ -21,7 +21,7 @@
|
|||||||
[(ngModel)]="noteContent"
|
[(ngModel)]="noteContent"
|
||||||
[placeholder]="'readerCbx.noteDialog.placeholder' | transloco"
|
[placeholder]="'readerCbx.noteDialog.placeholder' | transloco"
|
||||||
rows="6"
|
rows="6"
|
||||||
autofocus
|
|
||||||
></textarea>
|
></textarea>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ interface ViewCallbacks {
|
|||||||
prev: () => void;
|
prev: () => void;
|
||||||
next: () => void;
|
next: () => void;
|
||||||
getCFI: (index: number, range: Range) => string | null;
|
getCFI: (index: number, range: Range) => string | null;
|
||||||
getContents: () => Array<{ index: number; doc: Document }> | null;
|
getContents: () => { index: number; doc: Document }[] | null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Injectable({
|
@Injectable({
|
||||||
|
|||||||
@@ -24,7 +24,7 @@
|
|||||||
[(ngModel)]="noteContent"
|
[(ngModel)]="noteContent"
|
||||||
[placeholder]="t('notePlaceholder')"
|
[placeholder]="t('notePlaceholder')"
|
||||||
rows="6"
|
rows="6"
|
||||||
autofocus
|
|
||||||
></textarea>
|
></textarea>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -50,7 +50,7 @@
|
|||||||
[placeholder]="t('searchPlaceholder')"
|
[placeholder]="t('searchPlaceholder')"
|
||||||
[(ngModel)]="searchQuery"
|
[(ngModel)]="searchQuery"
|
||||||
(ngModelChange)="onSearchInput($event)"
|
(ngModelChange)="onSearchInput($event)"
|
||||||
autofocus
|
|
||||||
/>
|
/>
|
||||||
@if (searchQuery) {
|
@if (searchQuery) {
|
||||||
<button class="clear-btn" (click)="clearSearch()" [attr.aria-label]="t('clearSearch')">
|
<button class="clear-btn" (click)="clearSearch()" [attr.aria-label]="t('clearSearch')">
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ export class ReaderStateService {
|
|||||||
readonly state = this._state.asReadonly();
|
readonly state = this._state.asReadonly();
|
||||||
|
|
||||||
readonly themes = themes;
|
readonly themes = themes;
|
||||||
private readonly _fonts = signal<Array<{ name: string; value: string | null }>>(this.BASE_FONTS);
|
private readonly _fonts = signal<{ name: string; value: string | null }[]>(this.BASE_FONTS);
|
||||||
readonly fonts = this._fonts.asReadonly();
|
readonly fonts = this._fonts.asReadonly();
|
||||||
|
|
||||||
constructor(private bookService: BookService, private userService: UserService) {
|
constructor(private bookService: BookService, private userService: UserService) {
|
||||||
|
|||||||
+1
-1
@@ -128,7 +128,7 @@ export class ReadingSurvivalChartComponent {
|
|||||||
|
|
||||||
const completionRate = Math.round(survivalValues[survivalValues.length - 1]);
|
const completionRate = Math.round(survivalValues[survivalValues.length - 1]);
|
||||||
|
|
||||||
let medianIdx = survivalValues.findIndex(v => v < 50);
|
const medianIdx = survivalValues.findIndex(v => v < 50);
|
||||||
let medianDropout = '';
|
let medianDropout = '';
|
||||||
if (medianIdx === -1) {
|
if (medianIdx === -1) {
|
||||||
medianDropout = '100%+';
|
medianDropout = '100%+';
|
||||||
|
|||||||
+1
-1
@@ -98,7 +98,7 @@ export class UserChartConfigService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const savedCharts = JSON.parse(savedConfig) as Array<Partial<UserChartConfig>>;
|
const savedCharts = JSON.parse(savedConfig) as Partial<UserChartConfig>[];
|
||||||
const savedChartsById = new Map(savedCharts.map(chart => [chart.id, chart]));
|
const savedChartsById = new Map(savedCharts.map(chart => [chart.id, chart]));
|
||||||
|
|
||||||
return this.getDefaultCharts()
|
return this.getDefaultCharts()
|
||||||
|
|||||||
@@ -128,7 +128,7 @@ export class MetadataUtilsService {
|
|||||||
patchMetadataToForm(
|
patchMetadataToForm(
|
||||||
metadata: BookMetadata,
|
metadata: BookMetadata,
|
||||||
metadataForm: FormGroup,
|
metadataForm: FormGroup,
|
||||||
fields: Array<{ controlName: string; lockedKey: string; type: string }>
|
fields: { controlName: string; lockedKey: string; type: string }[]
|
||||||
): void {
|
): void {
|
||||||
const patchData: Record<string, unknown> = {};
|
const patchData: Record<string, unknown> = {};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user