Warn about invalid globs in content
#6449
Merged
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.
This PR will try and fix bogus globs
When using globs, there is this option called "brace expansion", this means that you can simplify some globs instead of repeating the same thing over and over again. For example:
Can be simplified as:
This is also what we explain in our docs: https://tailwindcss.com/docs/installation
However, it seems like some people are changing that glob to better match their project which is totally fine. However, a lot of people end up with invalid globs.
This is an invalid glob, notice that there is only 1 item inside the
{
&}
.This is the same behaviour as brace expansion in your terminal.
Here is an example from my terminal output inside the tailwindcss repo:
This PR will try and detect those bogus cases and
rewriteshow a warning with a fix for the glob.Should become:
Example warning output:
Fixes: #6394