1 | ;
|
2 |
|
3 | var format = require('util').format;
|
4 |
|
5 | function 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 |
|
16 | rule.description = 'Number of properties with value forced by !important';
|
17 | module.exports = rule;
|