madskristensen / WebEssentials2015

A Visual Studio extension for web developers
Other
301 stars 94 forks source link

Incorrect "The selector [...]. is already specified earlier" errors #223

Open daiplusplus opened 7 years ago

daiplusplus commented 7 years ago

VS:

Microsoft Visual Studio Enterprise 2015 Version 14.0.25425.01 Update 3 Microsoft .NET Framework Version 4.6.01586

ASP.NET Tooling:

ASP.NET and Web Tools 2015.1 14.1.20810.0 ASP.NET Web Frameworks and Tools 2012.2 4.1.41102.0 ASP.NET Web Frameworks and Tools 2013 5.2.40314.0

WebEssentials:

Web Essentials 2015.3 3.0.235 Web Compiler 1.11.319

In my ASP.NET MVC 4 project, I have a .cshtml file with a <style type="text/css"> element with some style-rules. WebEssentials gives them all a purple squiggle underline with the message:

The selector [..] is already specified earlier. Consider combining the two rule-sets.

Selector specificity: 0, 1, 0

I can confirm the rules' selectors exist only once. WebEssentials is incorrectly flagging them.

daiplusplus commented 7 years ago

I'll add, this happens with .class selectors. It does not happen with #id selectors, weirdly.

daiplusplus commented 7 years ago

Hmm, after a short while the error message is now applied to #id selectors too, double-weird. I don't know what I did that made it start targeting #id selectors.