UNPKG

473 BJavaScriptView Raw
1'use strict';
2
3var format = require('util').format;
4
5function rule(analyzer) {
6 analyzer.setMetric('importants');
7
8 analyzer.on('declaration', function(rule, property, value) {
9 if (value.indexOf('!important') > -1) {
10 analyzer.incrMetric('importants');
11 analyzer.addOffender('importants', format('%s {%s: %s}', rule.selectors.join(', '), property, value));
12 }
13 });
14}
15
16rule.description = 'Number of properties with value forced by !important';
17module.exports = rule;