get-processor-ids-from-stylelint-options

    1.0.0 • Public • Published

    get-processor-ids-from-stylelint-options

    NPM version Build Status Coverage Status

    Get stylelint processor identifiers from a stylelint option object

    const getProcessorIdsFromStylelintOptions = require('get-processor-ids-from-stylelint-options');
     
    getProcessorIdsFromStylelintOptions({
      config: {
        processors: [
          '@mapbox/stylelint-processor-markdown',
          ['./custom-proessor.js', {
            optionOne: true,
            optionTwo: false
          }]
        ]
      }
    }); //=> Set {'@mapbox/stylelint-processor-markdown', './custom-processor.js'}

    Installation

    Use npm.

    npm install get-processor-ids-from-stylelint-options
    

    API

    const getProcessorIdsFromStylelintOptions = require('get-processor-ids-from-stylelint-options');

    getProcessorIdsFromStylelintOptions([options])

    options: Object (stylelint API options)
    Return: Set<string>

    getProcessorIdsFromStylelintOptions({
      config: {
        processors: [
          './processor0.js',
          './processor1.js'
        ]
      }
    }); //=> Set {'./processor0.js', ./processor1.js'}
     
    getProcessorIdsFromStylelintOptions({
      configOverrides: {
        processors: '/processor/can/be/a/string/instead/of/an/array.js'
      }
    }); //=> Set {'/processor/can/be/a/string/instead/of/an/array.js'}
     
    getProcessorIdsFromStylelintOptions({
      config: {},
      configOverrides: {
        processors: 'configOverrides/will/be/ignored/when/both/config/and/configOverrides/are/provided'
      }
    }); //=> Set {}
     
    getProcessorIdsFromStylelintOptions(); //=> Set {}

    License

    Copyright (c) 2017 Shinnosuke Watanabe

    Licensed under the MIT License.

    Install

    npm i get-processor-ids-from-stylelint-options

    DownloadsWeekly Downloads

    9

    Version

    1.0.0

    License

    MIT

    Last publish

    Collaborators

    • shinnn