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

Add Using with Stylelint section #185

Closed
ai opened this issue Jul 26, 2017 · 15 comments · Fixed by #800
Closed

Add Using with Stylelint section #185

ai opened this issue Jul 26, 2017 · 15 comments · Fixed by #800

Comments

@ai
Copy link

ai commented Jul 26, 2017

  • emotion version: github

What you did:

Open github.com/tkh44/emotion

What happened:

I saw great docs, but without docs how to add linter for CSS

Suggested solution:

Something similar to styled-components docs

@tkh44
Copy link
Member

tkh44 commented Jul 26, 2017

I think we could potentially do this during compile and put it behind a lint flag. @ai we are using postcss-js internally to compile the styles, but we could lint the raw strings. I'm not sure there is a style lint for objects, although that would be a great feature.

@ai
Copy link
Author

ai commented Jul 26, 2017

It is even better 😄

Using standard PostCSS parser instead of postcss-scss will be better, because you will be able to lint spaces. Is it possible to change parser?

@ai
Copy link
Author

ai commented Jul 28, 2017

Maybe we can use styled-components stylelint plugin? I will check on next week.

@ai
Copy link
Author

ai commented Nov 29, 2017

I tried styled-components stylelint plugin and everything works (it is compatible with Emotion as well)

@severen
Copy link

severen commented Mar 8, 2018

Is it compatible with object styles though? Remember, Emotion doesn't only support string literal styles.

@vhlongon
Copy link

@ai can you please show me your config? I am trying to make stylelint works with emotion, but no luck yet :|

@jhwohlgemuth
Copy link

@vhlongon

This issue might shed some light on why you cannot get it to work. It lists the config:

{
  "processors": ["stylelint-processor-styled-components"],
  "extends": [
    "stylelint-config-standard",
    "stylelint-config-styled-components"
  ]
}

I can confirm that this config works as expected with stylelint v9.1.3 (but not v9.2.0)

I lost some time wrestling with linting css-in-js with stylelint, so I thought I would share 😅

@vhlongon
Copy link

@jhwohlgemuth dude, thanks a bunch! Works like a charm now!

@gucong3000
Copy link
Contributor

Related: #686

@stale
Copy link

stale bot commented Aug 7, 2018

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Aug 7, 2018
@gucong3000 gucong3000 mentioned this issue Aug 13, 2018
3 tasks
@stale stale bot closed this as completed Aug 14, 2018
@ilias-t
Copy link

ilias-t commented Jun 12, 2019

This issue issue should probably be reopened. There is currently no documentation on how to lint emotion.

@montezume
Copy link

With the latest version of stylelint it's pretty straightforward. What are you having trouble with?

I have a repo open with it setup. The .stylelintrc file is here

@nhooyr
Copy link

nhooyr commented Jul 2, 2019

@montezume how does your stylelintrc work? It doesn't use the styled-components processor.

@montezume
Copy link

montezume commented Jul 3, 2019

The styled-components processor isn't required anymore thanks to the native support for CSS in JS in stylelint.

I wrote a blog post about it if you want to check it out

What errors / problems are you having with stylelint and emotion? Are you running the latest version of stylelint?

@nhooyr
Copy link

nhooyr commented Jul 4, 2019

Its currently broken when u have a babel config for some reason. There's an issue on the stylelint repo.

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

Successfully merging a pull request may close this issue.

10 participants