This repository has been archived by the owner on Jul 15, 2023. It is now read-only.
new rule: no-unsupported-browser-code #171
Labels
Microsoft Internal
Issues related to closed source Microsoft code.
Milestone
It's easy to accumulate lots of browser specific code when adding workarounds for browser bugs. This new rule would use the tslint.json to specify which browser versions you care about supporting, then specifically formatted comments to annotate all browser hacks. As you drop support for older browsers and change the tslint.json configuration, tslint would flag the comments so you can remove the code.
Some examples from our code base, annotated with new "Browser Specific" comments:
If we dropped support for IE 10, the event listener would be flagged and we could remove that code from our code base.
Some additional thinking is needed to come up with a decent grammar for designating the browser versions.
@browserspecific <string>
(for JSdoc usages) orBrowser Specific: <string>
seem like good tags around the string itself.A grammar something like
[Mobile] (Safari|Chrome|Firefox|FF|Internet Explorer|IE|Edge) [[>|<]<number>]
would lead to comments likeMobile Safari < 8
orChrome > 45
orIE
, which seems ok.The text was updated successfully, but these errors were encountered: