Skip to content

Commit

Permalink
fix: shorthand should only reject once
Browse files Browse the repository at this point in the history
  • Loading branch information
AndyOGo committed May 19, 2020
1 parent 9e4fd98 commit ce46c63
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,12 +143,13 @@ const ruleFunction = (properties, options, context = {}) => (root, result) => {
lintDeclStrictValue(node)
} else if (isShortHand) {
const expandedProps = shortCSS.expand(prop, value, recurseLonghand)
let failedFlag = false

Object.keys(expandedProps).forEach((longhandProp) => {
const longhandValue = expandedProps[longhandProp]

if (longhandProp === propFilter || (propFilter instanceof RegExp && propFilter.test(longhandProp))) {
lintDeclStrictValue(node, longhandProp, longhandValue)
if (!failedFlag && (longhandProp === propFilter || (propFilter instanceof RegExp && propFilter.test(longhandProp)))) {
failedFlag = lintDeclStrictValue(node, longhandProp, longhandValue)
}
})
}
Expand Down Expand Up @@ -252,6 +253,8 @@ const ruleFunction = (properties, options, context = {}) => (root, result) => {
message: messages.expected(types, value, nodeProp, message),
})
}

return true
}
}
})
Expand Down

0 comments on commit ce46c63

Please sign in to comment.