nuxt-modules / turnstile

๐Ÿ”ฅ Cloudflare Turnstile integration for Nuxt

Home Page:https://cloudflare.com/products/turnstile

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Typecheck token implicitly has 'any' type

dnlsndr opened this issue ยท comments

๐Ÿ› The bug

Nuxi 3.0.0                                                                                                                                                                                                                                                                                      08:26:48
โ„น Using default Tailwind CSS file from runtime/tailwind.css                                                                                                                                                                                                                    nuxt:tailwindcss 08:26:49
node_modules/@nuxtjs/turnstile/dist/runtime/components/Turnstile.vue:45:15 - error TS7006: Parameter 'token' implicitly has an 'any' type.

45     callback: token => emit('update:modelValue', token),
                 ~~~~~


Found 1 error in node_modules/@nuxtjs/turnstile/dist/runtime/components/Turnstile.vue:45


 ERROR  Command failed with exit code 2: npx -p vue-tsc -p typescript vue-tsc --noEmit                                                                                                                                                                                                          08:26:56

  at makeError (node_modules/nuxi/dist/shared/nuxi.6b390535.mjs:619:11)
  at handlePromise (node_modules/nuxi/dist/shared/nuxi.6b390535.mjs:1026:26)
  at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
  at async Object.invoke (node_modules/nuxi/dist/chunks/typecheck.mjs:46:7)
  at async _main (node_modules/nuxi/dist/cli.mjs:50:20)

The token within the component seems to not be typed correctly, which throws an error when you want to typecheck a nuxt3 project. The eslint configuration is the default configuration generated in the .nuxt folder, which in terms also includes all used libraries in the typecheck.

๐Ÿ› ๏ธ To reproduce

https://stackblitz.com/edit/github-7yqadg-vsed7m?file=package.json

๐ŸŒˆ Expected behaviour

A typecheck should not fail upon analyzing the Turnstile.vue file.

โ„น๏ธ Additional context

Run npm run typecheck in the provided repro.

I'll add a PR soon.

@danielroe just a friendly ping :)