Fix diagnostic false-positive when no CSS properties are present (#793)

master
Brad Cornes 2023-05-30 09:58:24 +01:00 committed by GitHub
parent 53b81ca460
commit 22209f09c7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 0 deletions

View File

@ -82,9 +82,14 @@ export async function getCssConflictDiagnostics(
return false return false
} }
let propertiesAreComparable = false
for (let i = 0; i < otherRules.length; i++) { for (let i = 0; i < otherRules.length; i++) {
let otherRule = otherRules[i] let otherRule = otherRules[i]
let properties = getRuleProperties(otherRule) let properties = getRuleProperties(otherRule)
if (info[i].properties.length > 0 && properties.length > 0) {
propertiesAreComparable = true
}
if (!equal(info[i].properties, properties)) { if (!equal(info[i].properties, properties)) {
return false return false
} }
@ -94,6 +99,10 @@ export async function getCssConflictDiagnostics(
} }
} }
if (!propertiesAreComparable) {
return false
}
return true return true
}) })