Skip to content
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

Support autofix for font-family-name-quotes rule #5805

Closed
MrBrN197 opened this issue Dec 28, 2021 · 2 comments · Fixed by #5806
Closed

Support autofix for font-family-name-quotes rule #5805

MrBrN197 opened this issue Dec 28, 2021 · 2 comments · Fixed by #5806
Labels
status: wip is being worked on by someone type: new autofix a new autofix for an existing rule

Comments

@MrBrN197
Copy link
Contributor

What steps are needed to reproduce the bug?

create a css file with

body {
  margin: 0;
  font-family: "Roboto", sans-serif;
}

enable rule 'font-family-name-quotes': 'always-where-recommended'

What Stylelint configuration is needed to reproduce the bug?

{
  "rules": {
    "font-family-name-quotes": "always-where-recommended"
  }
}

How did you run Stylelint?

stylelint index.css --fix

Which version of Stylelint are you using?

14.2.0

What did you expect to happen?

"Roboto" should be converted to Roboto after --fix flag.

What actually happened?

--fix does not automatically fix the problem.

Does the bug relate to non-standard syntax?

No response

Proposal to fix the bug

I have a hunch that this was working in stylelint@13 but I'm not sure. either way shouldn't this be an automatically fixable problem by removing the quotes on font family names that don't have spaces or misc symbols.

@ybiquitous
Copy link
Member

@MrBrN197 Thanks for using the template and reporting the issue!
Currenty, the font-family-name-quotes rule doesn't have an autofix option.

I've labeled the issue as ready to implement. Please consider contributing if you have time.

There are steps on how to add an autofix option in the Developer guide.

Also, we're discussing freezing all stylistic rules (including font-family-name-quotes) with #5674, but I think it's acceptable to add an autofix option to an existing rule for now.

@ybiquitous ybiquitous added status: ready to implement is ready to be worked on by someone type: new autofix a new autofix for an existing rule labels Dec 29, 2021
@ybiquitous ybiquitous changed the title stylelint --fix flag doesn't fix font-family-name-quotes Support autofix for font-family-name-quotes rule Dec 29, 2021
@MrBrN197
Copy link
Contributor Author

@ybiquitous Hi, I took some time to look at the code and see what I could figure out. I've created a PR for it. There is some information on the PR description that I'd like clarification on if you can.

@jeddy3 jeddy3 added status: wip is being worked on by someone and removed status: ready to implement is ready to be worked on by someone labels Jan 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: wip is being worked on by someone type: new autofix a new autofix for an existing rule
Development

Successfully merging a pull request may close this issue.

3 participants