mirror of
https://github.com/snachodog/just-the-docs.git
synced 2025-09-13 21:33:32 -06:00
Initial commit
This commit is contained in:
41
node_modules/stylelint-scss/dist/rules/selector-no-redundant-nesting-selector/index.js
generated
vendored
Normal file
41
node_modules/stylelint-scss/dist/rules/selector-no-redundant-nesting-selector/index.js
generated
vendored
Normal file
@@ -0,0 +1,41 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.messages = exports.ruleName = undefined;
|
||||
|
||||
exports.default = function (actual) {
|
||||
return function (root, result) {
|
||||
var validOptions = _stylelint.utils.validateOptions(result, ruleName, { actual: actual });
|
||||
if (!validOptions) {
|
||||
return;
|
||||
}
|
||||
|
||||
root.walkRules(/&/, function (rule) {
|
||||
var selector = rule.selector;
|
||||
// "Ampersand followed by a combinator followed by non-combinator non-ampersand and not the selector end"
|
||||
|
||||
var regex = /^&\s*[>+~ ]\s*[^>+~ {&]+/;
|
||||
|
||||
if (selector === "&" || regex.test(selector)) {
|
||||
_stylelint.utils.report({
|
||||
ruleName: ruleName,
|
||||
result: result,
|
||||
node: rule,
|
||||
message: messages.rejected
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
};
|
||||
|
||||
var _stylelint = require("stylelint");
|
||||
|
||||
var _utils = require("../../utils");
|
||||
|
||||
var ruleName = exports.ruleName = (0, _utils.namespace)("selector-no-redundant-nesting-selector");
|
||||
|
||||
var messages = exports.messages = _stylelint.utils.ruleMessages(ruleName, {
|
||||
rejected: "Unnecessary nesting selector (&)"
|
||||
});
|
Reference in New Issue
Block a user