Closed catrope closed 2 years ago
Hi @catrope,
This is due to how the types are exported in the d.ts
files at the moment. I‘m refactoring the package to provide a commonjs
and a esm
version of it. When this is ready, you will not have this issue anymore, for now you can juts ignore the line with @ts-ignore
. I‘ll let you know when it is ready, I‘ll let this issue open.
Regards
@catrope, about this part:
For
autoprefixer
everything does work correctly. It looks like the critical difference is that postcss-rtlcss usesexport default blah;
but autoprefixer usesexport = blah;
.
I think that you are looking at the type definition file of autoprefixer instead of the real module.
Hi @catrope,
I‘ve released a new version of the package. Now, two bundles are generated using Rollup
, one for esm
and one for CommonJs
, the type definitions should be fixed for CommonJs
in this version. Please, check the version 3.5.4 and let me know if your issue gets solved.
Regards.
Hi @catrope, It seems that the issue is already resolved. Closing this issue. Regards
Yes, this new version works great, thanks! Sorry for forgetting to leave a comment here on Friday
@catrope, no worries. Glad to hear that the issue is solved. Regards
If I enable
"allowJs": true
and"checkJs": true
in mytsconfig.json
, TypeScript will do type checking in JavaScript files likepostcss.confg.js
. However, postcss-rtlcss's type definitions break in this case:This results in the following TypeScript error:
If I use
require( 'postcss-rtlcss').default
, then TypeScript is happy, but of course I get a runtime error because that property doesn't exist in reality.For
autoprefixer
everything does work correctly. It looks like the critical difference is that postcss-rtlcss usesexport default blah;
but autoprefixer usesexport = blah;
.