Skip to content

Type assertions in tsx result in silently bad extractions #133

@joshkel

Description

@joshkel

🐛 Bug Report

Type assertions such as these aren't properly handled by i18next-cli extract.

See i18next/i18next-parser#603 for a similar issue in i18next-parser.

To Reproduce

<b>{{count} as any}</b> items

i18next-cli extract output: {{value}} items

(Concerningly, i18next-cli silently gives incorrect output. With i18next/i18next-parser#603, i18next-parser threw an error when it encountered the unsupported syntax.)

Expected behavior

Correct output: {{count}} items

Your Environment

  • runtime version: Node 22
  • i18next version: 24.2.3, i18next-cli 1.28.0
  • os: Mac

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions