Skip to content
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

fix: print deprecation warning only when plugin is used #1744

Merged
merged 3 commits into from May 18, 2022
Merged

Conversation

zardoy
Copy link
Contributor

@zardoy zardoy commented May 13, 2022

I use some CJS package and I import from its index.js the functionality I need, however it also exposes an old postcss plugin. I don't use it, so I think it makes more sense to print a warning only when the plugin is actually used. I also added a check to preserve behavior that the warning is being printed only once.

@ai
Copy link
Member

@ai ai commented May 13, 2022

Good idea but let’s fix tests first

test/postcss.test.ts Outdated Show resolved Hide resolved
ai
Copy link
Member

@ai ai commented on 2295e28 May 13, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let’s add check

equal(warn.callCount, 0)

@zardoy
Copy link
Contributor Author

@zardoy zardoy commented May 13, 2022

Should be good now

test/postcss.test.ts Show resolved Hide resolved
@ai
Copy link
Member

@ai ai commented May 13, 2022

LGTM. I will try to release it on next week.

@ai
Copy link
Member

@ai ai commented May 13, 2022

I fixed CI in main. I will look at PR on next week.

@ai ai merged commit 2a97ab8 into postcss:main May 18, 2022
3 of 6 checks passed
@ai
Copy link
Member

@ai ai commented May 18, 2022

Released in 8.4.14.

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.

None yet

2 participants