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

Not CSS-in-JS was parsed #34

Closed
ai opened this issue Jul 30, 2018 · 4 comments
Closed

Not CSS-in-JS was parsed #34

ai opened this issue Jul 30, 2018 · 4 comments

Comments

@ai
Copy link

ai commented Jul 30, 2018

I started to use Stylelint in our project and got

popups/balance.js
 64:39  ✖  Expected a trailing semicolon

error on this code:

      h(Note, [
        h(TextFormat, {
          links: [`#card:${ projectId }`],
          text: t.note
        })
      ]),

Seems like parser try to parse any CSS in template strings

@gucong3000
Copy link
Owner

gucong3000 commented Jul 31, 2018

Seems like parser try to parse any CSS in template strings
Yes, it is.

This is a known issue, and using postcss-jsx instead of postcss-styled can solve this problem.

postcss-jsx use Babel@7 to parse javascript context.

@ai
Copy link
Author

ai commented Jul 31, 2018

Here is our Stylelint config:

{
  "plugins": [
    "stylelint-order"
  ],
  "extends": [
    "stylelint-config-standard",
    "stylelint-config-styled-components"
  ]
}

Should we ask Stylelint team to not use postcss-styled? Will template string work with postcss-jsx? (Example show only object notation).

@gucong3000
Copy link
Owner

Should we ask Stylelint team to not use postcss-styled?

stylelint/stylelint#3506
After merge this PR, postcss-syntax will switch to use postcss-jsx to extract template strings in js source.

@gucong3000
Copy link
Owner

postcss-jsx was add to stylelint

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

No branches or pull requests

2 participants