3

With Resharper 2016.3, the mechanism to identify unused CSS classes has been improved. This is great, but it comes with a downside:

We use CSS classes with a special prefix (js-) to mark elements that we need to find from javascript, e.g. from Selenium tests. These classes are now marked as "unknown", because there is no entry for them in the CSS file (obviously).

Is it possible to exclude CSS classes with a specific prefix from the "unknown CSS class" check in Resharper? If yes, how?

theDmi
  • 17,546
  • 6
  • 71
  • 138

1 Answers1

0

Does not seem to be possible. We ended up using data attributes instead of classes to be able to find elements from Selenium tests. So instead of doing

<div class="js-something"></div>

we use now

<div data-js-xref="something"></div>

As a consequence, we use only class names that really exist, solving the Resharper problem in the process.

theDmi
  • 17,546
  • 6
  • 71
  • 138