Skip to content

Commit c4a4d9c

Browse files
Adebesin-Cellclaude
andcommitted
fix: resolve lint errors and type check failures
- Remove unused `nextTick` import from Tab.spec.ts - Use camelCase `ariaLabel` prop in TabList template bindings to satisfy vue-tsc strict type checking - Move `extractHeadingAttrs` to module scope in readme.ts - Move `row` helper to outer scope in versions.spec.ts Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent cdec42f commit c4a4d9c

File tree

5 files changed

+18
-17
lines changed

5 files changed

+18
-17
lines changed

app/components/Package/TrendsChart.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1645,7 +1645,7 @@ const isSparklineLayout = computed({
16451645
id-prefix="chart-layout"
16461646
class="mt-4 mb-8"
16471647
>
1648-
<TabList :aria-label="$t('package.trends.chart_view_toggle')">
1648+
<TabList :ariaLabel="$t('package.trends.chart_view_toggle')">
16491649
<TabItem value="combined" tab-id="combined-chart-layout-tab" icon="i-lucide:chart-line">
16501650
{{ $t('package.trends.chart_view_combined') }}
16511651
</TabItem>

app/pages/compare.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ useSeoMeta({
280280
id-prefix="comparison"
281281
class="mt-4"
282282
>
283-
<TabList :aria-label="$t('compare.packages.section_comparison')">
283+
<TabList :ariaLabel="$t('compare.packages.section_comparison')">
284284
<TabItem value="table" tab-id="comparison-tab-table" icon="i-lucide:table">
285285
{{ $t('compare.packages.table_view') }}
286286
</TabItem>

server/utils/readme.ts

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -458,6 +458,17 @@ function renderFrontmatterTable(data: Record<string, unknown>): string {
458458
return `<table><thead><tr><th>Key</th><th>Value</th></tr></thead><tbody>\n${rows}\n</tbody></table>\n`
459459
}
460460

461+
// Extract and preserve allowed attributes from HTML heading tags
462+
function extractHeadingAttrs(attrsString: string): string {
463+
if (!attrsString) return ''
464+
const preserved: string[] = []
465+
const alignMatch = /\balign=(["']?)([^"'\s>]+)\1/i.exec(attrsString)
466+
if (alignMatch?.[2]) {
467+
preserved.push(`align="${alignMatch[2]}"`)
468+
}
469+
return preserved.length > 0 ? ` ${preserved.join(' ')}` : ''
470+
}
471+
461472
export async function renderReadmeHtml(
462473
content: string,
463474
packageName: string,
@@ -530,17 +541,6 @@ export async function renderReadmeHtml(
530541
return processHeading(depth, displayHtml, plainText, slugSource)
531542
}
532543

533-
// Extract and preserve allowed attributes from HTML heading tags
534-
function extractHeadingAttrs(attrsString: string): string {
535-
if (!attrsString) return ''
536-
const preserved: string[] = []
537-
const alignMatch = /\balign=(["']?)([^"'\s>]+)\1/i.exec(attrsString)
538-
if (alignMatch?.[2]) {
539-
preserved.push(`align="${alignMatch[2]}"`)
540-
}
541-
return preserved.length > 0 ? ` ${preserved.join(' ')}` : ''
542-
}
543-
544544
// Intercept HTML headings so they get id, TOC entry, and correct semantic level.
545545
// Also intercept raw HTML <a> tags so playground links are collected in the same pass.
546546
const htmlHeadingRe = /<h([1-6])(\s[^>]*)?>([\s\S]*?)<\/h\1>/gi

test/nuxt/components/Tab.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { describe, it, expect } from 'vitest'
22
import { mountSuspended } from '@nuxt/test-utils/runtime'
3-
import { defineComponent, h, nextTick } from 'vue'
3+
import { defineComponent, h } from 'vue'
44
import { TabRoot, TabList, TabItem, TabPanel } from '#components'
55

66
function createTabsWrapper(props: { modelValue: string; idPrefix?: string }) {

test/unit/app/utils/versions.spec.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -425,10 +425,11 @@ describe('isSameVersionGroup', () => {
425425
})
426426
})
427427

428+
function row(version: string, tags: string[]) {
429+
return { id: `version:${version}`, primaryTag: tags[0]!, tags, version }
430+
}
431+
428432
describe('compareTagRows', () => {
429-
function row(version: string, tags: string[]) {
430-
return { id: `version:${version}`, primaryTag: tags[0]!, tags, version }
431-
}
432433

433434
it('sorts by tag priority ascending (rc before beta)', () => {
434435
const rc = row('2.0.0-rc.1', ['rc'])

0 commit comments

Comments
 (0)