jycouet / kitql

A set of standalone tools to SpeedRun WebApps!
https://kitql.dev
MIT License
409 stars 37 forks source link

Updating to 6.4.0 causes `svelte-check` to fail due to `@ts-expect-error` #686

Closed Dan1ve closed 4 months ago

Dan1ve commented 4 months ago

Describe the bug

I updated from v6.2.0 to v6.4.0, which re-generated the ROUTES.ts file.

Running svelte-check now produces a TypeScript error for the generated file at the StringOrUndefined helper function that wasn't being raised before:

Error: Unused '@ts-expect-error' directive. 

// @ts-expect-error can break noUnusedLocals ts rule
function StringOrUndefined(val: any) {

It's also visible in VS Code:

image

As this file is generated, I cannot fix this myself.

I'm not an expert on TypeScript error suppression, but maybe @ts-ignore would work instead?

Severity

blocking an upgrade

Steps to Reproduce the Bug

  1. Setup a simple SvelteKit project with at least one route
  2. Run the generating step. If relevant, I use
kitRoutes({
    generated_file_path: 'src/lib/generated/ROUTES.ts'
}) 
  1. Run svelte-check --threshold error
  2. You'll see the error above

Reproduction

No response

jycouet commented 4 months ago

Hummm... It depend on another ticket (https://github.com/jycouet/kitql/issues/681) My fix was probably not the best...

I'll look later.