All files / plugins selector-no-utility.js

88.89% Statements 8/9
50% Branches 1/2
100% Functions 2/2
88.89% Lines 8/9

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 202x 2x   2x 1x 1x 1x     1x             1x      
const stylelint = require('stylelint')
const {rule, ruleName} = require('stylelint-selector-no-utility')
 
module.exports = stylelint.createPlugin(ruleName, (enabled, ...args) => {
  const deprecatedPlugin = rule(enabled, ...args)
  return (root, result) => {
    Iif (enabled === false) {
      return
    }
    result.warn(
      `'${ruleName}' has been deprecated and will be removed in stylelint-config-primer@7.0.0. Please update your rules to use 'primer/no-override'.`,
      {
        stylelintType: 'deprecation',
        stylelintReference: 'https://github.com/primer/stylelint-config-primer#deprecations'
      }
    )
    return deprecatedPlugin(root, result)
  }
})