how to validate / lint styled-jsx in NextJS?

余生长醉 提交于 2020-03-05 06:07:31

问题


I am using nextJS for development, for stylelint to validate my .scss and .css files. I'm also using styled-jsx or css-in-js for component level styling (it's kind of requirement) and want to know if there's some library to validate styled-jsx below is the code sample of my css code.

<style jsx>{`
          .HeadText {
              color: ${myColors['color-primary']};
          }
`}
</style>

I've tried using this library but it work's for only static styles like below :

<style jsx>{`
          .HeadText {
              color: red;
              bad-property: something; // gives error
          }
`}
</style>

来源:https://stackoverflow.com/questions/59998892/how-to-validate-lint-styled-jsx-in-nextjs

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!