Sha256: b337d3a942410da0ab718ffa57dfd21da27df84f692fe51cd5ae96330801f674

Contents?: true

Size: 982 Bytes

Versions: 24

Compression:

Stored size: 982 Bytes

Contents

"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports["default"] = _default;

var _hasInterpolation = _interopRequireDefault(require("./hasInterpolation"));

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }

/**
 * Check whether a selector is standard
 *
 * @param {string} selector
 * @returns {boolean}
 */
function _default(selector) {
  // SCSS or Less interpolation
  if ((0, _hasInterpolation["default"])(selector)) {
    return false;
  } // SCSS placeholder selectors


  if (selector.startsWith("%")) {
    return false;
  } // Less :extend()


  if (/:extend(\(.*?\))?/.test(selector)) {
    return false;
  } // Less mixin with resolved nested selectors (e.g. .foo().bar or .foo(@a, @b)[bar])


  if (/\.[a-z0-9-_]+\(.*\).+/i.test(selector)) {
    return false;
  } // ERB template tags


  if (selector.includes("<%") || selector.includes("%>")) {
    return false;
  }

  return true;
}

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
trusty-cms-6.3.1 node_modules/stylelint-scss/dist/utils/isStandardSyntaxSelector.js
trusty-cms-5.0.7 node_modules/stylelint-scss/dist/utils/isStandardSyntaxSelector.js
trusty-cms-5.0.6 node_modules/stylelint-scss/dist/utils/isStandardSyntaxSelector.js
trusty-cms-5.0.5 node_modules/stylelint-scss/dist/utils/isStandardSyntaxSelector.js
trusty-cms-5.0.4 node_modules/stylelint-scss/dist/utils/isStandardSyntaxSelector.js
trusty-cms-5.0.3 node_modules/stylelint-scss/dist/utils/isStandardSyntaxSelector.js
trusty-cms-5.0.2 node_modules/stylelint-scss/dist/utils/isStandardSyntaxSelector.js
trusty-cms-5.0.1 node_modules/stylelint-scss/dist/utils/isStandardSyntaxSelector.js
trusty-cms-4.3.5 node_modules/stylelint-scss/dist/utils/isStandardSyntaxSelector.js
trusty-cms-5.0.0 node_modules/stylelint-scss/dist/utils/isStandardSyntaxSelector.js
trusty-cms-4.3.4 node_modules/stylelint-scss/dist/utils/isStandardSyntaxSelector.js
trusty-cms-4.3.3 node_modules/stylelint-scss/dist/utils/isStandardSyntaxSelector.js
trusty-cms-4.3.2 node_modules/stylelint-scss/dist/utils/isStandardSyntaxSelector.js
trusty-cms-4.3.1 node_modules/stylelint-scss/dist/utils/isStandardSyntaxSelector.js
trusty-cms-4.3 node_modules/stylelint-scss/dist/utils/isStandardSyntaxSelector.js
trusty-cms-4.2.3 node_modules/stylelint-scss/dist/utils/isStandardSyntaxSelector.js
trusty-cms-4.2.2 node_modules/stylelint-scss/dist/utils/isStandardSyntaxSelector.js
trusty-cms-4.2.1 node_modules/stylelint-scss/dist/utils/isStandardSyntaxSelector.js
trusty-cms-4.2 node_modules/stylelint-scss/dist/utils/isStandardSyntaxSelector.js
trusty-cms-4.1.9 node_modules/stylelint-scss/dist/utils/isStandardSyntaxSelector.js