-
Notifications
You must be signed in to change notification settings - Fork 532
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
Handle multiline properties & update css list #1106
Conversation
ec7e238
to
ecc7d1b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great move to use the maintained list of prop names 👍
} | ||
else { | ||
propList.push({ | ||
name: currentProperty.name + PROP_DIVIDER + prop.first('ident').content, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could abstract this string generation instead of repeating it.
name: currentProperty.name + PROP_DIVIDER + prop.first('ident').content, | ||
line: prop.first().start.line, | ||
col: prop.first().start.column, | ||
propsEncountered: propsEncountered |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wish we were using ES2015 😅
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah... would be good. We can move up soon.
} | ||
// If we have multiline properties | ||
if (fullProperties.length) { | ||
fullProperties.forEach(function (constrProp) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does constrProp
mean?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
constructed property... I think 😄
// If we have multiline properties | ||
if (fullProperties.length) { | ||
fullProperties.forEach(function (constrProp) { | ||
// Add the number of propertiy declarations we've already checked here so we can skip them |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo - ...number of property...
}); | ||
} | ||
else { | ||
if (curProperty && curProperty.length > 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could combine the else if and just run with ...curProperty.length)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
curProperty 'could' technically be undefined here. Would rather leave the check just in case as we don't wanna get length of undefined. Can remove the > 0
though as that's unnecessary
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Aye, sorry the > 0
is what I was talking about 👍
ecc7d1b
to
8a7f07e
Compare
8a7f07e
to
d157eb8
Compare
Fixes issues with the
no-misspelled-properties
rule. It currently doesn't work very well with multiline properties and only does partial string matches without trying to understand the context which in turn means it would let spelling errors through.e.g.
I've also moved away from our own maintained list of properties to a more coherent, full and more importantly maintained list known-css-properties. Any properties that aren't featured there can either be requested to be added there OR added to the extra properties setting of this rule. This will lead to a lot less frustration with our poorly maintained list.
fixes #1101
fixes #1024
fixes #1045
fixes #951
fixes #805
fixes #720
closes #1062
closes #767
I'll update the vendor prefixes rule on top of this too and then we can removed our properties file.
<DCO 1.1 Signed-off-by: Dan Purdy dan@dpurdy.me>