parentSelectorLinter.js 387 B

123456789101112
  1. import { lintWarning } from "./utils";
  2. var linter = function linter(key, value, info) {
  3. if (info.parentSelectors.some(function (selector) {
  4. var selectors = selector.split(',');
  5. return selectors.some(function (item) {
  6. return item.split('&').length > 2;
  7. });
  8. })) {
  9. lintWarning('Should not use more than one `&` in a selector.', info);
  10. }
  11. };
  12. export default linter;