1
1
mirror of https://github.com/primer/css.git synced 2024-12-21 05:01:45 +03:00

percautions in case path is wrong

This commit is contained in:
Jon Rohan 2016-05-28 21:49:20 -04:00
parent f9934496f6
commit 091e2e75ae

View File

@ -31,7 +31,20 @@ function buildUtilityClasses(options) {
module.exports = stylelint.createPlugin(ruleName, function(enabled, options) {
return function(root, result) {
var utilityClasses = buildUtilityClasses(options)
var validOptions = stylelint.utils.validateOptions(result, ruleName, {
actual: enabled,
possible: [true, false]
})
if (!validOptions) { return }
var utilityClasses = []
try {
utilityClasses = buildUtilityClasses(options)
} catch (e) {
// Editor plugin won't work, needs correct path
}
if (utilityClasses.length == 0) {
return