Sha256: b900476551ec437e45773b43cc0caffa2a63c83b7dc19b4d39d386a8f668f7e5

Contents?: true

Size: 753 Bytes

Versions: 23

Compression:

Stored size: 753 Bytes

Contents

'use strict';

const isStandardSyntaxAtRule = require('../utils/isStandardSyntaxAtRule');
const report = require('../utils/report');

module.exports = function (options) {
	options.root.walkAtRules((atRule) => {
		if (!isStandardSyntaxAtRule(atRule)) {
			return;
		}

		checkColon(
			`@${atRule.name}${atRule.raws.afterName || ''}${atRule.params}`,
			atRule.name.length,
			atRule,
		);
	});

	function checkColon(source, index, node) {
		options.locationChecker({
			source,
			index,
			err: (m) => {
				if (options.fix) {
					options.fix(node);

					return;
				}

				report({
					message: m,
					node,
					index,
					result: options.result,
					ruleName: options.checkedRuleName,
				});
			},
			errTarget: `@${node.name}`,
		});
	}
};

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
trusty-cms-5.0.7 node_modules/stylelint/lib/rules/atRuleNameSpaceChecker.js
trusty-cms-5.0.6 node_modules/stylelint/lib/rules/atRuleNameSpaceChecker.js
trusty-cms-5.0.5 node_modules/stylelint/lib/rules/atRuleNameSpaceChecker.js
trusty-cms-5.0.4 node_modules/stylelint/lib/rules/atRuleNameSpaceChecker.js
trusty-cms-5.0.3 node_modules/stylelint/lib/rules/atRuleNameSpaceChecker.js
trusty-cms-5.0.2 node_modules/stylelint/lib/rules/atRuleNameSpaceChecker.js
trusty-cms-5.0.1 node_modules/stylelint/lib/rules/atRuleNameSpaceChecker.js
trusty-cms-4.3.5 node_modules/stylelint/lib/rules/atRuleNameSpaceChecker.js
trusty-cms-5.0.0 node_modules/stylelint/lib/rules/atRuleNameSpaceChecker.js
trusty-cms-4.3.4 node_modules/stylelint/lib/rules/atRuleNameSpaceChecker.js
trusty-cms-4.3.3 node_modules/stylelint/lib/rules/atRuleNameSpaceChecker.js
trusty-cms-4.3.2 node_modules/stylelint/lib/rules/atRuleNameSpaceChecker.js
trusty-cms-4.3.1 node_modules/stylelint/lib/rules/atRuleNameSpaceChecker.js
trusty-cms-4.3 node_modules/stylelint/lib/rules/atRuleNameSpaceChecker.js
trusty-cms-4.2.3 node_modules/stylelint/lib/rules/atRuleNameSpaceChecker.js
trusty-cms-4.2.2 node_modules/stylelint/lib/rules/atRuleNameSpaceChecker.js
trusty-cms-4.2.1 node_modules/stylelint/lib/rules/atRuleNameSpaceChecker.js
trusty-cms-4.2 node_modules/stylelint/lib/rules/atRuleNameSpaceChecker.js
trusty-cms-4.1.9 node_modules/stylelint/lib/rules/atRuleNameSpaceChecker.js
trusty-cms-4.1.8 node_modules/stylelint/lib/rules/atRuleNameSpaceChecker.js