Skip to content

Commit

Permalink
fix: check shorthand if configured
Browse files Browse the repository at this point in the history
  • Loading branch information
AndyOGo committed May 19, 2020
1 parent 225e76f commit 05255fb
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,11 @@ const ruleFunction = (properties, options, context = {}) => (root, result) => {
// skip variable declarations
if (reSkipProp.test(prop)) return

if (prop === propFilter || (propFilter instanceof RegExp && propFilter.test(prop))) {
const isShortHand = expandShorthand && shortCSS.isShorthand(prop)

if (prop === propFilter || (!isShortHand && propFilter instanceof RegExp && propFilter.test(prop))) {
lintDeclStrictValue(node)
} else if (expandShorthand && shortCSS.isShorthand(prop)) {
} else if (isShortHand) {
const expandedProps = shortCSS.expand(prop, value, recurseLonghand)

Object.keys(expandedProps).forEach((longhandProp) => {
Expand Down

0 comments on commit 05255fb

Please sign in to comment.