postcss-selector-parser
postcss-selector-parser copied to clipboard
Add a selector equality check
One thing I would find very useful is the ability to check if two selectors are semantically equal. I'm currently comparing the string representations of selectors, but that doesn't capture the fact that (for example) :is(a, b) means the same thing as :is(b, a) or that [a=\-1] means the same thing as [a="-1"]. postcss-selector-parser notionally has enough information in its AST to make these comparisons, so it would be awesome if that logic was implemented and made available as an API.
For prior art, it may be useful to look at Dart Sass's AST and in particular implementations of the operator == and hash methods.