Closed AviVahl closed 4 years ago
New in-project .d.ts declares an export default of a function that returns a plugin, which does not match the actual library.
Yeap, this is what postcss.plugin
generates. You will use it as postcss([ nested() ])
.
Odd. Up until now we just passed nested
in and it worked. We didn't have to call it as a function. New types disallow using the exported value as a plugin itself.
I'll just call it obviously, but this is a breaking type change for those who used @types/postcss-nested
.
Odd. Up until now we just passed nested in and it worked.
Yeap, PostCSS can call this function for you
New types disallow using the exported value as a plugin itself.
Let’s fix @types/postcss-nested
. But I do not use TS and not familiar how to fix it.
Actually, @types/postcss-nested
can be removed, now that you include an inline .d.ts
.
I'll make a PR to update the types in postcss-nested
.
btw, the postcss.Plugin
type is exactly that function that can be passed or called. I've checked postcss's .d.ts
.
New in-project .d.ts declares an export default of a function that returns a plugin, which does not match the actual library.
@types/postcss-nested
got it right: https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/postcss-nested/index.d.tsAbove
.d.ts
declares a commonjs module that exports a plugin.FYI @ai