anandthakker / doiuse

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

Combine report output of prefixed properties to a single line #28

Closed groovecoder closed 1 year ago

groovecoder commented 8 years ago

CSS:

-webkit-hyphens: none;
-moz-hyphens: none;
-ms-hyphens: none;
hyphens: none;

doiuse 2.0.2 reports the same incompatibilities for each line:

test.css:1:1: CSS Hyphenation not supported by: IE (8,9), Chrome (42,43), Opera (29,30,12.1), Opera Mini (5.0-8.0), Android Browser (4.2-4.3,4.4,4.4.3-4.4.4), Chrome for Android (42), IE Mobile (10,11), UC Browser for Android (9.9)
test.css:2:1: CSS Hyphenation not supported by: IE (8,9), Chrome (42,43), Opera (29,30,12.1), Opera Mini (5.0-8.0), Android Browser (4.2-4.3,4.4,4.4.3-4.4.4), Chrome for Android (42), IE Mobile (10,11), UC Browser for Android (9.9)
test.css:3:1: CSS Hyphenation not supported by: IE (8,9), Chrome (42,43), Opera (29,30,12.1), Opera Mini (5.0-8.0), Android Browser (4.2-4.3,4.4,4.4.3-4.4.4), Chrome for Android (42), IE Mobile (10,11), UC Browser for Android (9.9)
test.css:4:1: CSS Hyphenation not supported by: IE (8,9), Chrome (42,43), Opera (29,30,12.1), Opera Mini (5.0-8.0), Android Browser (4.2-4.3,4.4,4.4.3-4.4.4), Chrome for Android (42), IE Mobile (10,11), UC Browser for Android (9.9)

It would be much better to batch the identical report output to a single line that prints once after the block of prefix properties. So it looks more like this:

test.css:1-4:1: CSS Hyphenation not supported by: IE (8,9), Chrome (42,43), Opera (29,30,12.1), Opera Mini (5.0-8.0), Android Browser (4.2-4.3,4.4,4.4.3-4.4.4), Chrome for Android (42), IE Mobile (10,11), UC Browser for Android (9.9)
anandthakker commented 8 years ago

Yeah, good point @groovecoder. Collapsing them wouldn't be too hard, but is it possible that it would allow inaccurate results? (Possibly related: #15)

There's a broader question here of how prefixed properties like this should be reported in general. Maybe a vendor-prefixed property should only produce a warning for that vendor's browser: e.g., a -moz- property would only produce a warning if Firefox is one of the browsers being tested.

ncoden commented 7 years ago

@anandthakker Any updates on this issue and feature ?

anandthakker commented 7 years ago

@ncoden I haven't made progress on it myself, but would gladly accept/support a PR!

dumblob commented 4 years ago

Duplicate of https://github.com/anandthakker/doiuse/issues/91 ?

clshortfuse commented 1 year ago
echo "body{-webkit-hyphens: none;
-moz-hyphens: none;
-ms-hyphens: none;
hyphens: none;
}" | npx doiuse --browsers "ie >= 8, firefox >= 2"

Now yields

<streaming css input>:4:1: CSS Hyphenation not supported by: IE (8,9), Firefox (2,3,4,5,3.5,3.6) (css-hyphens)