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

Improve DEBUG parsing: only take care of tailwindcss and not tailwind #6804

Merged
merged 2 commits into from
Dec 30, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
only take care of tailwindcss and not tailwind
  • Loading branch information
RobinMalfait committed Dec 30, 2021
commit fe0090849c6968df644ed37aeb39ab38e91acc2f
8 changes: 4 additions & 4 deletions src/lib/sharedState.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,13 @@ export function resolveDebug(debug) {

let debuggers = debug.split(',').map((d) => d.split(':')[0])

// Ignoring tailwind / tailwindcss
if (debuggers.includes('-tailwindcss') || debuggers.includes('-tailwind')) {
// Ignoring tailwindcss
if (debuggers.includes('-tailwindcss')) {
return false
}

// Definitely including tailwind / tailwindcss
if (debuggers.includes('tailwindcss') || debuggers.includes('tailwind')) {
// Including tailwindcss
if (debuggers.includes('tailwindcss')) {
return true
}

Expand Down
8 changes: 0 additions & 8 deletions tests/shared-state.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,12 @@ it.each`
${'false'} | ${false}
${'0'} | ${false}
${'*'} | ${true}
${'tailwind'} | ${true}
${'tailwind:*'} | ${true}
${'tailwindcss'} | ${true}
${'tailwindcss:*'} | ${true}
${'other,tailwind'} | ${true}
${'other,tailwind:*'} | ${true}
${'other,tailwindcss'} | ${true}
${'other,tailwindcss:*'} | ${true}
${'other,-tailwind'} | ${false}
${'other,-tailwind:*'} | ${false}
${'other,-tailwindcss'} | ${false}
${'other,-tailwindcss:*'} | ${false}
${'-tailwind'} | ${false}
${'-tailwind:*'} | ${false}
${'-tailwindcss'} | ${false}
${'-tailwindcss:*'} | ${false}
`('should resolve the debug ($value) flag correctly ($expected)', ({ value, expected }) => {
Expand Down