Skip to content

Fix pre-existing lint warnings and test failures in preprocessors #3

Description

@RickCogley

Overview

Before the v1.3.0 release (Vento TOC processors), we identified pre-existing lint warnings and test failures that should be addressed in a future patch release.

These issues are not blockers for v1.3.0 since they exist in older code unrelated to the new features.

Lint Warnings (4 issues)

Missing explicit return types in public API functions:

  1. plugins/css_banner.ts:39 - cssBanner() function
  2. plugins/shuffle.ts:57 - shuffle() function
  3. processors/defer_pagefind.ts:34 - deferPagefind() function
  4. processors/external_links_icon.ts:28 - externalLinksIcon() function

Fix: Add explicit return types to all four functions (should be Lume plugin/processor return types).

Test Failures (7 failures)

language_alternates_schema.test.ts (4 failures)

  1. addLanguageAlternate - adds translation as original

    • Expected: "https://example.com/ja/page"
    • Actual: [{ "@id": "https://example.com/ja/page" }]
  2. addLanguageAlternate - adds translation as alternate

    • Expected: "https://example.com/en/page"
    • Actual: { "@id": "https://example.com/en/page" }
  3. languageAlternatesSchema - links pages by ID

    • Expected: "https://example.com/ja/about/"
    • Actual: undefined
  4. languageAlternatesSchema - handles multiple schema fields

    • Expected: true
    • Actual: false

markdown_metadata.test.ts (3 failures)

  1. markdownMetadata - extracts excerpt from content

    • Expected: "First paragraph."
    • Actual: undefined
  2. markdownMetadata - calculates elapsed days

    • Expected: number
    • Actual: undefined
  3. markdownMetadata - respects custom excerpt marker

    • Expected: "Custom marker test."
    • Actual: undefined

Recommended Fix Priority

High Priority

  • markdown_metadata.test.ts failures - Core functionality (excerpt extraction) isn't working
  • language_alternates_schema.test.ts failures - Schema linking may be broken

Medium Priority

  • Lint warnings - Should be fixed for better type safety and JSR compatibility

Suggested Approach

  1. Investigate why markdownMetadata preprocessor isn't extracting excerpts
  2. Fix addLanguageAlternate function to return correct format
  3. Add explicit return types to the 4 plugin/processor functions
  4. Run full test suite to verify fixes
  5. Create patch release (v1.3.1 or v1.2.2 depending on timing)

Context

Discovered during v1.3.0 release preparation on 2025-11-23 while running preflight checks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions