Skip to content

Commit 6c867cd

Browse files
check fallback list in condition
1 parent cad4f17 commit 6c867cd

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

src/rules/no-invalid-properties.js

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -194,15 +194,11 @@ export default {
194194
} else {
195195
// If it has a fallback value, use that
196196
if (child.children[2].type === "Raw") {
197-
if (
198-
child.children[2].value
199-
.trim()
200-
.startsWith("var")
201-
) {
202-
const fallbackVarList =
203-
getVarFallbackList(
204-
child.children[2].value.trim(),
205-
);
197+
const fallbackVarList =
198+
getVarFallbackList(
199+
child.children[2].value.trim(),
200+
);
201+
if (fallbackVarList.length > 0) {
206202
let gotFallbackVarValue = false;
207203

208204
for (const fallbackVar of fallbackVarList) {

0 commit comments

Comments
 (0)