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

styled-components cannot be formatted with stylelint #337

Closed
1 task done
CGSimplePeople opened this issue Nov 19, 2021 · 3 comments
Closed
1 task done

styled-components cannot be formatted with stylelint #337

CGSimplePeople opened this issue Nov 19, 2021 · 3 comments
Projects

Comments

@CGSimplePeople
Copy link

How did you encounter this bug?

I try to use stylelint and stylelint-order to format styled-components and sort the attributes, but I can't always succeed. I hope to get some help.

Code Snippet

No response

Stylelint Configuration

{
"extends": ["stylelint-config-standard", "stylelint-config-rational-order", "stylelint-config-prettier"],
"plugins": ["stylelint-order"],
"rules": {
"font-family-no-missing-generic-family-keyword": null,
"value-keyword-case": null,
"no-descending-specificity": null,
"no-empty-source": null,
"declaration-bang-space-before": null,
"declaration-block-trailing-semicolon": null,
"declaration-block-semicolon-newline-after": "always",
"block-opening-brace-newline-after": "always"
}
}

Extension Configuration

No response

Actual Behaviour

unable to sort attributes

Expected Behaviour

ability to format and sort attributes

Logs

No response

Stylelint Version

v14.0.1

vscode-stylelint Version

1.2.1

Node.js Version

v14.16.0

Operating System

w10

Windows Subsystem for Linux

No response

Code of Conduct

  • I agree to follow vscode-stylelint's Code of Conduct
@CGSimplePeople CGSimplePeople added the type: bug a problem with a feature or rule label Nov 19, 2021
@CGSimplePeople CGSimplePeople changed the title styled-componentscannot be formatted with stylelint styled-components cannot be formatted with stylelint Nov 19, 2021
@adalinesimonian
Copy link
Member

To confirm, you're using the format document option? If you are, currently it will not enforce any rules from your configuration due to #328 (comment).

@adalinesimonian adalinesimonian added the status: needs clarification triage needs clarification from author label Nov 19, 2021
@adalinesimonian adalinesimonian added this to Needs triage in Bugs via automation Nov 19, 2021
@CGSimplePeople
Copy link
Author

To confirm, you're using the format document option? If you are, currently it will not enforce any rules from your configuration due to #328 (comment).

I'm sure that the formatted document is used. My .less file can be formatted. I set save and auto format

@adalinesimonian
Copy link
Member

Sounds like this might be a duplicate of #328 then. I'll close this issue in favour of that one. Once stylelint/stylelint#5723 is resolved, we'll be able to fix formatting here in the extension, but it'll depend on the version of Stylelint with the functionality. If you feel I'm mistaken or I've misunderstood, feel free to reopen the issue with more details. Thanks!

Bugs automation moved this from Needs triage to Closed Nov 22, 2021
@adalinesimonian adalinesimonian added Duplicate and removed type: bug a problem with a feature or rule status: needs clarification triage needs clarification from author labels Nov 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Bugs
Closed
Development

No branches or pull requests

2 participants