styled-components / styled-components

Visual primitives for the component age. Use the best bits of ES6 and CSS to style your apps without stress 💅
https://styled-components.com
MIT License
40.11k stars 2.48k forks source link

[Docs] Lint for pseudo selectors - Styled Components update from v5 to v6 #4286

Closed ArkadiK94 closed 1 month ago

ArkadiK94 commented 1 month ago

In styled components v6 - A pseudo selectors that was written before without ampersand(&) now act differently without any errors or warnings so it makes the update to this version problematic because the bugs are "silent".

We need to implement new lint rule with the usage of Stylelint and other packages to check for pseudo selectors without ampersand (&). Then we will report an error, and fix it by adding it.

Is this issue for here? Did someone already do it? (I didn't see in the styled components docs) What do you think?

If it is legitimate, I would like to work on it and update the docs accordingly with a solution.

ArkadiK94 commented 1 month ago

I am closing this issue because it is not a bug it is a breaking change. I am trying to find an easier way for developers to add ampersand in the beginning of all pseudo classes with Stylelint when I will find one I will open an issue to update the docs with a solution.