Skip to content

Fix ProcessOptions interface#1902

Merged
ai merged 1 commit intopostcss:mainfrom
ferreira-tb:main
Dec 2, 2023
Merged

Fix ProcessOptions interface#1902
ai merged 1 commit intopostcss:mainfrom
ferreira-tb:main

Conversation

@ferreira-tb
Copy link
Contributor

If I do something like:

const result = await postcss([plugin1, plugin2]).process(css)

This would correctly log the warning below:

Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.

As explained, changing to process(css, { from: undefined }) prevent the warning. However, when exactOptionalPropertyTypes is set to true in the tsconfig.json it's not possible to do that at all, as undefined wouldn't be an allowed type.

TSConfig Reference: exactOptionalPropertyTypes

This PR only adds undefined to the type.

@ai
Copy link
Member

ai commented Dec 1, 2023

LGTM. I will release it tomorrow.

@ai ai merged commit 1918533 into postcss:main Dec 2, 2023
@ai
Copy link
Member

ai commented Dec 2, 2023

Thanks. Released at 8.4.32.

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

Successfully merging this pull request may close these issues.

2 participants