openfoodfacts / openfoodfacts-explorer

An alternative frontend for OpenFoodFacts, made with SvelteKit
https://openfoodfacts-explorer.vercel.app/
5 stars 1 forks source link

Svelte check output #90

Open teolemon opened 2 months ago

teolemon commented 2 months ago

/home/runner/work/openfoodfacts-explorer/openfoodfacts-explorer/src/routes/folksonomy/[key]/+page.ts:12:31 Error: 'tags' is possibly 'undefined'. const productsApi = new ProductsApi(fetch); const products = Promise.all(tags.map((tag) => productsApi.getProductName(tag.product)));

/home/runner/work/openfoodfacts-explorer/openfoodfacts-explorer/src/routes/products/[barcode]/+page.ts:35:56 Error: Argument of type 'string' is not assignable to parameter of type 'number'.

const questions = off.robotoff.questionsByProductCode(params.barcode).then(
    (res) => {

/home/runner/work/openfoodfacts-explorer/openfoodfacts-explorer/src/routes/folksonomy/[key]/+page.svelte:31:10 Error: Argument of type '{ product: string; k: string; v: string; owner?: string | undefined; version?: number | undefined; editor?: string | undefined; last_edit?: string | undefined; comment?: string | undefined; }[] | undefined' is not assignable to parameter of type 'ArrayLike | Iterable'. Type 'undefined' is not assignable to type 'ArrayLike | Iterable'. (ts)

{#each data.tags as tag, i} /home/runner/work/openfoodfacts-explorer/openfoodfacts-explorer/src/routes/folksonomy/[key]/+page.svelte:[37](https://github.com/openfoodfacts/openfoodfacts-explorer/actions/runs/9978560153/job/27575728209#step:6:38):40 Error: 'tag' is of type 'unknown'. (ts) {:then products} {productNameOrBarcode(products[i], tag)} /home/runner/work/openfoodfacts-explorer/openfoodfacts-explorer/src/routes/folksonomy/[key]/+page.svelte:[38](https://github.com/openfoodfacts/openfoodfacts-explorer/actions/runs/9978560153/job/27575728209#step:6:39):43 Error: Argument of type 'unknown' is not assignable to parameter of type '{ product: string; }'. (ts) {productNameOrBarcode(products[i], tag)} /home/runner/work/openfoodfacts-explorer/openfoodfacts-explorer/src/routes/folksonomy/[key]/+page.svelte:[43](https://github.com/openfoodfacts/openfoodfacts-explorer/actions/runs/9978560153/job/27575728209#step:6:44):7 Error: 'tag' is of type 'unknown'. (ts) {tag.product} /home/runner/work/openfoodfacts-explorer/openfoodfacts-explorer/src/routes/folksonomy/[key]/+page.svelte:[46](https://github.com/openfoodfacts/openfoodfacts-explorer/actions/runs/9978560153/job/27575728209#step:6:47):55 Error: 'tag' is of type 'unknown'. (ts) ==================================== svelte-check found 7 errors and 0 warnings in 3 files