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
Add autofix to font-weight-notation #3159
Add autofix to font-weight-notation #3159
Conversation
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.
Good work! Thanks! Need update docs, look how we do this for other rules
2977230
to
045da2d
Compare
updated docs;) |
if (optionName === "numeric") { | ||
return input | ||
.replace(/normal/g, WEIGHTS_WITH_KEYWORD_EQUIVALENTS[0]) | ||
.replace(/bold/g, WEIGHTS_WITH_KEYWORD_EQUIVALENTS[1]); |
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.
This line is not good... I'll fix.(e.g. font: var(--bold-x) italic 20px;
)
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.
@abouthiroppy Can you add tests and fix this?
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.
Sure. BTW, Should we also support auto fix other than CSS?(maybe sass, cssnext, etc..)
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.
@abouthiroppy where only standard syntax
77c8cca
to
a88eee6
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.
Thank you for starting your work on autofixing.
When autofixing is added to a rule all testRule()
should have fix: true
. Not only new tests.
Please, add fix: true
to every testRule()
for this rule.
@hiroppy Friendly ping to see if you're still working on this PR? |
@hudochenkov Sorry for the late reply. I will update this PR soon;) |
a88eee6
to
91372ca
Compare
Sorry, I found some bugs so I'll fix it. |
@@ -6,6 +6,7 @@ const { messages, ruleName } = rule; | |||
testRule(rule, { | |||
ruleName, | |||
config: ["numeric"], | |||
fixed: true, |
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.
It should be fix: true
. And all four testRule
should have it.
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.
yep, I fixed.
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.
It's not fixed. I see fixed: true
in ever testRule
. It should be fix: true
. Otherwise tests for autofixing don't executed.
It looks like all outstanding issues have been resolved. Wondering if a note should be added to rule readme noting that only |
Any update to this? |
/cc @hiroppy can you rebase? |
Also, this is not resolved yet. |
Closing due inactivity. We can reopen if requested changes were made. |
Was leafing through old issues / PRs and saw this - I'm more than happy to branch off of @hiroppy's changes (while still crediting them) and then implementing the requested changes - any thoughts @hudochenkov? |
@mattxwang We probably need to use another solution, because we don't want to use |
@mattxwang yep, as @hudochenkov said, we'll want to avoid using |
Related Issue
#3158
Description
we enable fix option for font-weight-notation.
numeric
named-where-possible