anandthakker / doiuse

:bomb: Lint CSS for browser support against caniuse database.
MIT License
1.23k stars 50 forks source link

Provide an option to simplify browser version ranges in `formatBrowserName` #184

Open edg2s opened 1 month ago

edg2s commented 1 month ago

Very long strings are difficult to read, and could be represented much more concisely when there is a run of consecutive major versions, e.g.

Unexpected browser feature "flexbox-gap" is not supported by Edge 79,80,81,83, Firefox 49,50,51,52,53,54,55,56,57,58,59,60,61,62, Chrome 49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,83

->

Unexpected browser feature "flexbox-gap" is not supported by Edge 79-81,83, Firefox 49-62, Chrome 49-83

..such as you see on caniuse.com: image

When minor versions are reported, such as reported by Safari, it is uncertain if there are intermediate minor releases that have been left out, so they would require comparison with a list of all known minor versions, but just fixing the cases above would be an improvement.

Safari 10,11,12,13,14,10.1,11.1,12.1,13.1, Safari on iOS 10.0-10.2,10.3,11.0-11.2,11.3-11.4,12.0-12.1,12.2-12.5,13.0-13.1,13.2,13.3,13.4-13.7,14.0-14.4