1 | ;
|
2 |
|
3 | var format = require("util").format;
|
4 |
|
5 | /**
|
6 | * @param { import("../lib/css-analyzer") } analyzer
|
7 | */
|
8 | function rule(analyzer) {
|
9 | analyzer.setMetric("mediaQueries");
|
10 |
|
11 | analyzer.on("media", function (query, rules) {
|
12 | analyzer.incrMetric("mediaQueries");
|
13 | analyzer.addOffender(
|
14 | "mediaQueries",
|
15 | format("@media %s (%d rules)", query, rules.length)
|
16 | );
|
17 | });
|
18 | }
|
19 |
|
20 | rule.description = "Reports media queries";
|
21 | module.exports = rule;
|