1 | ;
|
2 |
|
3 | var format = require("util").format;
|
4 |
|
5 | /**
|
6 | * @param { import("../lib/css-analyzer") } analyzer
|
7 | */
|
8 | function rule(analyzer) {
|
9 | var re = /^expression/i;
|
10 |
|
11 | analyzer.setMetric("expressions");
|
12 |
|
13 | analyzer.on("declaration", function (rule, property, value) {
|
14 | if (re.test(value)) {
|
15 | analyzer.incrMetric("expressions");
|
16 | analyzer.addOffender(
|
17 | "expressions",
|
18 | format("%s {%s: %s}", rule.selectors.join(", "), property, value)
|
19 | );
|
20 | }
|
21 | });
|
22 | }
|
23 |
|
24 | rule.description = "Reports CSS expressions";
|
25 | module.exports = rule;
|