Skip to content

OptionInterface doesn't match generated templates.json #617

Description

@AntoineGautier

template.ts:78 casts templates.json to OptionInterface[]. The JSON doesn't actually match the type (treeList and modifiers are often absent; Modifiers.expression is usually a string or missing, not the declared Expression object).

On the full production templates.json tsc skips this check (type too complex) and passes. On a smaller regenerated file the check runs and npm run build fails at template.ts:78 — so any PR that shrinks templates.json breaks the build with an unrelated-looking error.

Fix

Make the types match the data:

  • template.ts: treeList?, modifiers?, choiceModifiers?: { [key: string]: Modifiers | undefined }
  • modifier-helpers.ts:16: expression?: Expression | string
  • fix the fallout at interpreter.ts:810 (treeList guard) and ~853 (second Modifiers type still requires expression)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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