anandthakker / doiuse

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

Do not look for browserslist manually #67

Closed ai closed 7 years ago

ai commented 7 years ago

Hi. I am author of PostCSS and Browserslist. Thanks for you project, it is really important for PostCSS.

It is great that you use Browserslist — common configs make our ecosystem stronger.

But I found that you use Browserslist with wrong API. You pass only browsers query and didn’t pass path option with input file. As result Browserslist doesn’t look for it config. You try to solve it by looking for browserslist config manually. But you parse it in wrong way, forget about comments.

As result, I have issue reports like this: https://github.com/ai/browserslist/issues/135

But all this problems is very easy to solve — just pass path option to Browserslist and remove own code to find config. Less code is always better for maintenance. As result you will support many new features from Browserslist (config in package.json for instance).

@anandthakker say if you need PR for it

/cc @ch2ch3

ai commented 7 years ago

@anandthakker any updates? What do you think about this issue. Do you need something?

I really care about it, because it is critical for PostCSS ecosystem and could be fixed very easy.

wrumsby commented 7 years ago

@ai I'll try to look at it in the next week or so.

ismay commented 7 years ago

People using stylelint-no-unsupported-browser-features are running into this too. Apparently atom has trouble parsing the browsersupport because of this and, as @ai mentioned, comments in the config break doiuse as well.

ismay commented 7 years ago

@wrumsby Any news on this? I just had another issue about the non-standard parsing of the browserslist by doiuse.

ai commented 7 years ago

@wrumsby hi, it is still very critical for PostCSS ecosystem :)

anandthakker commented 7 years ago

Hey all -- apologies for the delay in responding here: I have been entirely away from GitHub for several weeks now, for family reasons.

Totally on board with a PR to fix this -- I'm going to be very swamped getting caught up at my day job, though. @ai I will add you as a member to this repo, though, in case you're able to help get a PR merged.

ai commented 7 years ago

@anandthakker thanks. I finished most of changes (I also updated PostCSS and moved from caniuse-db to caniuse-lite as we did in Autoprefixer and Browserslist). RIght now I am waiting for next caniuse-lite release (we added some missed data for your project) and I will send PR.

ai commented 7 years ago

@anandthakker done https://github.com/anandthakker/doiuse/pull/69