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

stylint-order not working with CSS-in-JS #76

Closed
taylon opened this issue Nov 27, 2018 · 4 comments
Closed

stylint-order not working with CSS-in-JS #76

taylon opened this issue Nov 27, 2018 · 4 comments

Comments

@taylon
Copy link

taylon commented Nov 27, 2018

Hi, I'm not sure if it is a problem with postcss-jsx, stylelint itself or stylelint-order but I thought I would mention anyway and maybe we can at least get some idea about where the problem is coming from.

Example:

Using Stylelint out of the box (meaning postcss-jsx):

$ stylelint --print-config > https://pastebin.com/zJZfxK2W

import styled from 'styled-components';

const Component = styled.h2`
  margin: 0px;
  font-size: 14px;
`;
$ stylelint Component.tsx

Component.tsx
 35:12  ✖  Unexpected unit   length-zero-no-unit

Using Stylelint with stylelint-processor-styled-components (which is bad since no --fix):

stylelint --print-config > https://pastebin.com/0dzyRrDG (same thing, except that processor enabled)

import styled from 'styled-components';

const Component = styled.h2`
  margin: 0px;
  font-size: 14px;
`;
$ stylelint Component.tsx

Component.tsx
 34:12  ✖  Unexpected unit                                length-zero-no-unit
 35:3   ✖  Expected "font-weight" to come before          order/properties-order
           "margin"
@hudochenkov
Copy link
Owner

Sorry for a late response. I recently started using Styled Components myself. I'll try to add support for it.

@ianvieira
Copy link

@hudochenkov I saw you added the help wanted label. I can help you with it, as this is a blocker for one of my projects.

@hudochenkov
Copy link
Owner

@ianvieira It would be great! Thank you!

@hudochenkov
Copy link
Owner

Released in 2.1.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants