fix(gatsby-transformer-sharp): Add checkSupportedExtensions
option
#22565
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Initially the idea was to traverse the GraphQL AST and check whether
publicURL
is used alongsidechildImageSharp
or not. However, this task would have been really cumbersome and the end result would be brittle as multiple cases (file
,allFile
, fragments and more) would need to be handled.We can revisit this idea once we can return components from GraphQL - I added a
TODO
for that.In the meantime we expose an option to turn of the warning. The warning is still valuable but if people are sure that they handle all cases, they can turn it off.
Documentation
The option was documented in the README.
Related Issues
Follow-up of #20782
Fixes #21823