1.0.0 • Published 7 years ago
get-processor-ids-from-stylelint-options v1.0.0
get-processor-ids-from-stylelint-options
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
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.