chore(ui): clear eslint mechanical style bucket

Replace loose template null checks with strict null and undefined comparisons and convert the remaining simple index loops to for-of iteration.

Keep behavior intact while clearing the low-risk mechanical lint backlog in templates and chart helpers.

Validation: just ui lint
This commit is contained in:
James Cox
2026-04-22 17:26:48 -04:00
committed by Zach Yale
parent 18784fd12d
commit ea15719b6c
7 changed files with 20 additions and 21 deletions
@@ -22,7 +22,7 @@
{{ displayFormat }}
</div>
}
@if (!book.seriesCount && book.metadata?.seriesNumber != null) {
@if (!book.seriesCount && book.metadata?.seriesNumber !== null && book.metadata?.seriesNumber !== undefined) {
<div class="series-number-overlay">
#{{ book.metadata?.seriesNumber }}
</div>
@@ -93,7 +93,7 @@
stars="5"
[style.--p-rating-icon-active-color]="getStarColor(metadata[col.field])"
></p-rating>
@if (metadata[col.field] != null) {
@if (metadata[col.field] !== null && metadata[col.field] !== undefined) {
<span>({{ metadata[col.field]?.toFixed(1) }})</span>
}
</span>
@@ -5,7 +5,7 @@
alt="Cover of {{ book.metadata?.title }}"
loading="lazy"/>
@if (showSeriesNumber && !book.seriesCount && book.metadata?.seriesNumber != null) {
@if (showSeriesNumber && !book.seriesCount && book.metadata?.seriesNumber !== null && book.metadata?.seriesNumber !== undefined) {
<div class="series-number-overlay">
#{{ book.metadata?.seriesNumber }}
</div>
@@ -143,30 +143,30 @@
<!-- Ratings -->
@if (seriesStats(); as stats) {
@if (stats.avgPersonalRating != null || stats.avgGoodreads != null || stats.avgAmazon != null || stats.avgHardcover != null) {
@if ((stats.avgPersonalRating !== null && stats.avgPersonalRating !== undefined) || (stats.avgGoodreads !== null && stats.avgGoodreads !== undefined) || (stats.avgAmazon !== null && stats.avgAmazon !== undefined) || (stats.avgHardcover !== null && stats.avgHardcover !== undefined)) {
<div class="ratings-row">
@if (stats.avgPersonalRating != null) {
@if (stats.avgPersonalRating !== null && stats.avgPersonalRating !== undefined) {
<div class="rating-chip">
<i class="pi pi-star-fill rating-icon personal"></i>
<span class="rating-value">{{ stats.avgPersonalRating | number:'1.1-1' }}/10</span>
<span class="rating-label">{{ t('stats.avgPersonalRating') }}</span>
</div>
}
@if (stats.avgGoodreads != null) {
@if (stats.avgGoodreads !== null && stats.avgGoodreads !== undefined) {
<div class="rating-chip">
<i class="pi pi-star-fill rating-icon goodreads"></i>
<span class="rating-value">{{ getRatingPercent(stats.avgGoodreads) }}%</span>
<span class="rating-label">{{ t('stats.avgGoodreads') }}</span>
</div>
}
@if (stats.avgAmazon != null) {
@if (stats.avgAmazon !== null && stats.avgAmazon !== undefined) {
<div class="rating-chip">
<i class="pi pi-star-fill rating-icon amazon"></i>
<span class="rating-value">{{ getRatingPercent(stats.avgAmazon) }}%</span>
<span class="rating-label">{{ t('stats.avgAmazon') }}</span>
</div>
}
@if (stats.avgHardcover != null) {
@if (stats.avgHardcover !== null && stats.avgHardcover !== undefined) {
<div class="rating-chip">
<i class="pi pi-star-fill rating-icon hardcover"></i>
<span class="rating-value">{{ getRatingPercent(stats.avgHardcover) }}%</span>
@@ -196,7 +196,7 @@
{{ nextUp.isReading ? t('continueReading') : t('nextUp') }}
</span>
<span class="next-up-title">{{ nextUp.book.metadata?.title || '' }}</span>
@if (nextUp.isReading && nextUp.progressPercent != null) {
@if (nextUp.isReading && nextUp.progressPercent !== null && nextUp.progressPercent !== undefined) {
<div class="next-up-progress-row">
<p-progressBar
[value]="nextUp.progressPercent"
@@ -307,7 +307,7 @@
<div class="book-list-card">
<div class="list-number-col">
<span class="list-series-number">
{{ book.metadata?.seriesNumber != null ? '#' + book.metadata?.seriesNumber : '-' }}
{{ book.metadata?.seriesNumber !== null && book.metadata?.seriesNumber !== undefined ? '#' + book.metadata?.seriesNumber : '-' }}
</span>
</div>
<img [src]="getBookThumbnailUrl(book)"