Skip to content

Conversation

@gsnedders
Copy link
Member

Partly motivated by #55864, this adds a lint in an attempt to discourage people from adding needless UA-sniffing branches to their tests.

This also in the first commit slightly refactors lint.rules.Regexp to make it a subclass of lint.rules.Rule so we can use the generic lint.rules.Rule.error, and then using that passes in the subpattern matches as the context to allow them to be used in the description, allowing us to give users better error messages.

As a start, lightly change lint.rules.Regexp, making it a subclass of
lint.rules.Rule, thus allowing it to use the generic
lint.rules.Rule.error.

With that done, we now pass the subpattern matches as the context to
the error factor, allowing them to be used in the description, thus
letting us give users better error descriptions.
We have a number of places where tests use UA sniffing when they have
no reasonable reason to; we really shouldn't do this, as it just leads
to more problems down the road when we're trying to get
interoperability.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants