-
Notifications
You must be signed in to change notification settings - Fork 40
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
Disallow use of implicit any type on variable declarations. #2943
Conversation
|
Storybook demo5aa6a77ad | 81 komponenter | 182 stories |
@@ -28,7 +28,7 @@ export const SearchNavigationProvider = ({ | |||
|
|||
/* Add a small delay to get a precieved smoother navigation */ | |||
useEffect(() => { | |||
let timeout: NodeJS.Timeout; | |||
let timeout: ReturnType<typeof setTimeout>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why change this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since setTimeout
is implemented by the js runtime (engine implements it, but runtime exposes the function), it could in theory differ between nodejs, deno, hermes etc. So ReturnType<typeof setTimeout>
will be more correct in this scenario (was my assumption atleast).
Found this since let timeout;
caused errors elsewhere and thus lead me to this instance.
var i = 0, dpi: { updateZIndex: (arg0: number, arg1: number) => void }; | ||
(dpi = this.pendingDialogStack[i]); | ||
++i | ||
) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Selv liker jeg "plain for loops" (helst liker jeg vel ikke for loops heller, foretrekker for of/in 😅 ) og ikke gjøre for mye i selve for expression-loop-condition blocken (feks definere og sette flere variabler), all type "videre logikk" liker jeg da å ha i body til loopen i steden, og heller ta opp flere linjer 🤔
Sier ikke at vi trenger refaktorere noe her (eller senere), bare merker jeg må tenke ekstra her 😅 (spesielt med ekstra type info!)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Helt enig. Hele dialog-polyfillen er bare copy-paste fra en annen pakke, så tør ikke gjøre for mye endringer der. Hadde det vært opp til meg hadde jeg bare tatt en "biome-ignore" og latt det være 😅
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hadde selv også lyst til å sette biome-ignore
først, så hvis dere tenker det samme gjør vi det 🚀
Co-authored-by: Halvor Haugan <[email protected]>
Description
Fixes https://biomejs.dev/linter/rules/no-implicit-any-let/