Giter VIP home page Giter VIP logo

Comments (5)

leoyli avatar leoyli commented on May 27, 2024

Yes, I have also received this selector-type-no-unknown error...

Here is my work around:

  "rules": {
    "selector-type-no-unknown": [true, {
      "ignoreTypes": ["/^-styled-mixin/"]
    }]
  },

from stylelint-processor-styled-components.

chinesedfan avatar chinesedfan commented on May 27, 2024

My suggestion would be to wrap -styled-mixin0: dummyValue; in a CSS comment or prefix it with one more dash to turn it into a custom property e.g. --styled-mixin0: dummyValue;

@jroebu14 Thanks for your suggestions. Sorry we didn't find a perfect solution. Comments may also introduce comment-related false-positive errors. Adding one more dash can't solve the problem from the root, either. And it can also break something like @leoyli's workaround.

Currently, @leoyli's workaround is one of the best ideas.

from stylelint-processor-styled-components.

leoyli avatar leoyli commented on May 27, 2024

@chinesedfan, can be considered to add my workaround into the recommended setup? I mean people using it expect it can also take care about all valid use case.

from stylelint-processor-styled-components.

jroebu14 avatar jroebu14 commented on May 27, 2024

@leoyli @chinesedfan thanks for responding to my issue. Leoyli's is a good solution but unfortunately it won't work in our specific case where we're also using the csstree/stylelint-validator plugin. This plugin has it's own ignore option which doesn't support regular expressions. I have suggested this functionality in csstree/stylelint-validator.

For now my workaround looks like this which is a custom stylelint processor we use in the processor pipeline after stylelint-processor-styled-components. As you can see it's not ideal but it works for us in the short term.

from stylelint-processor-styled-components.

PierreGUI avatar PierreGUI commented on May 27, 2024

Hi, I'm running into the same issue with stylelint-order.
Related issue: hudochenkov/stylelint-order#63

Suggestion:

What about adding a configuration to give a custom name for mixins. Default would still be -styled-mixin${id}, but in some cases we could make it whatever we want (such as --styled-mixin or zz-styled-mixin in my case to solve sorting ;) )

Thanks

from stylelint-processor-styled-components.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.