anandthakker / doiuse

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

array of ignoring rules #21

Closed alexander-akait closed 9 years ago

alexander-akait commented 9 years ago

@anandthakker bump, project die?

anandthakker commented 9 years ago

@evilebottnawi Not dead, but I've been in a sort of passive mode -- I can respond to specific bugs, but I haven't quite had the bandwidth for real new development recently.

sebastienbarre commented 9 years ago

+1 would like to see that option as well, but fully understand your bandwidth issues... Great plugin nonetheless.

sebastienbarre commented 9 years ago

I can work on a PR if @anandthakker is open to the idea. Add an ignore option that would be an array of strings that could be compared to usageInfo.featureData.title?

Here is what I'm doing right now:

    require('doiuse')({
      browsers: browserList,
      onFeatureUsage: function(usageInfo) {
        var ignore = [
          'CSS Filter Effects',
          'CSS3 Box-shadow',
          'CSS3 Colors',
          'rem (root em) units'
        ];
        if (ignore.indexOf(usageInfo.featureData.title) !== -1) {
          return;
        }
        console.log(JSON.stringify([
          usageInfo.featureData.title,
          usageInfo.message
        ]));
      }
    }),

An ignore option would be cleaner. And instead of using onFeatureUsage I would love for doiuse to send its warnings using the PostCSS result.warn() API, so that they can be pretty printed by postcss-reporter (see issue #24). Thanks

anandthakker commented 9 years ago

@sebastienbarre Definitely open to a PR! Your approach sounds great, with one tweak: how about using usageInfo.feature (which just a key from the css feature list here rather than usageInfo.featureData.title?

sebastienbarre commented 9 years ago

Here you go, PR #25 added

anandthakker commented 9 years ago

Closed via #25