node_modules/postcss-custom-properties/index.d.ts:23:19 - error TS7031: Binding element 'any' implicitly has an 'any' type.
This is because prepare({ root: any }) means to destructure root and then assign it to the variable any. (An easy mistake to make; I remember doing the same thing a while ago!) It should be prepare( { root }: Type ), which translates to prepare( { root }: { root: any } ). We could also split the latter part out into its own type definition, but this gets the job done.
To test this, I copied original file to the TS playground, and it has an error (link to playground). The new version does not have an error (link to playground).
Thanks for taking a look! cc @jonathantneal, any chance this could make a quick patch release?
Hi! I found that
postcss-custom-properties
v12 was showing an error in my Typescript project recently (https://github.com/Automattic/wp-calypso/pull/56600)This is because
prepare({ root: any })
means to destructureroot
and then assign it to the variableany
. (An easy mistake to make; I remember doing the same thing a while ago!) It should beprepare( { root }: Type )
, which translates toprepare( { root }: { root: any } )
. We could also split the latter part out into its own type definition, but this gets the job done.To test this, I copied original file to the TS playground, and it has an error (link to playground). The new version does not have an error (link to playground).
Thanks for taking a look! cc @jonathantneal, any chance this could make a quick patch release?