Skip to content

Typescript error in functions-discount-js #275

@david-hollenbeck-shopify

Description

Describe the bug
Initial operations array is typed as never[], resulting in ts errors when operations are pushed into the array.

To Reproduce

  1. From an app directory, run shopify app generate extension
  2. Select Discount - Function
  3. After naming the discount, select Typescript

In src/cart_lines_discounts_generate_run.ts lines 37-84 are highlighted with a typescript error

Expected behavior
Starter templates should use valid typescript

This issue can be resolved by typing operations as follows:
const operations: CartLinesDiscountsGenerateRunResult['operations'] = [];

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