1 |
|
2 |
|
3 | 'use strict';
|
4 |
|
5 | const isStandardSyntaxAtRule = require('../utils/isStandardSyntaxAtRule');
|
6 | const report = require('../utils/report');
|
7 |
|
8 | module.exports = function (options) {
|
9 | options.root.walkAtRules((atRule) => {
|
10 | if (!isStandardSyntaxAtRule(atRule)) {
|
11 | return;
|
12 | }
|
13 |
|
14 | checkColon(
|
15 | `@${atRule.name}${atRule.raws.afterName || ''}${atRule.params}`,
|
16 | atRule.name.length,
|
17 | atRule,
|
18 | );
|
19 | });
|
20 |
|
21 | function checkColon(source, index, node) {
|
22 | options.locationChecker({
|
23 | source,
|
24 | index,
|
25 | err: (m) => {
|
26 | if (options.fix) {
|
27 | options.fix(node);
|
28 |
|
29 | return;
|
30 | }
|
31 |
|
32 | report({
|
33 | message: m,
|
34 | node,
|
35 | index,
|
36 | result: options.result,
|
37 | ruleName: options.checkedRuleName,
|
38 | });
|
39 | },
|
40 | errTarget: `@${node.name}`,
|
41 | });
|
42 | }
|
43 | };
|