Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deno check: Parameter 'r' implicitly has an 'any' type. #27718

Closed
kuchta opened this issue Jan 18, 2025 · 1 comment
Closed

deno check: Parameter 'r' implicitly has an 'any' type. #27718

kuchta opened this issue Jan 18, 2025 · 1 comment

Comments

@kuchta
Copy link

kuchta commented Jan 18, 2025

Version: Deno 2.1.6

deno check errors where TS is totally fine:

	function getRadixesLS(): Radix[] | undefined {}
	function createRadixes(chars = defaultChars): Radix[] {}

	const [ radixes, setRadixes ] = useState(getRadixesLS() ?? createRadixes(getCharsLS()))                                              
                ^^^^^^^ any - should be Radix[]
	const [ enabledRadixes, setEnabledRadixes ] = useState(radixes.filter(r => r.enabled))

I would guess that the problem would be in ??

https://github.com/kuchta/radixverse/blob/3bda8826a84cfc6622ae856e20e0d6aa4a6de031/src/components/App.tsx#L56

@marvinhagemeister
Copy link
Contributor

Duplicate of #27569

The issue occurs because the types from @types/react are not being picked up automatically. At the time of this writing Deno needs an additional comment on every react import to link the types:

+ // @ts-types="@types/react"
  import { useEffect, useState } from 'react'

This issue is tracked in #27569

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants