parentSelectorLinter.js 343 B

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