Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Passing any options to sassdoc will not load .sassdocrc #544

Open
joneff opened this issue Jan 14, 2020 · 3 comments
Open

Passing any options to sassdoc will not load .sassdocrc #544

joneff opened this issue Jan 14, 2020 · 3 comments

Comments

@joneff
Copy link

joneff commented Jan 14, 2020

Passing any options, including empty object to sass doc i.e. sassdoc({}) will not load .sassdocrc. Reason being that if the option is object, it will not load default config, but instead assume it has been loaded.

loadObject (config) {
if (this.file) {
this.file = path.resolve(this.file)
this.dir = path.dirname(this.file)
}
Object.keys(config)
.filter(key => ['verbose', 'strict'].indexOf(key) === -1)
.forEach(k => {
if (k in this) {
return this.emit('error', new Error(
`Reserved configuration key \`${k}\`.`
))
}
this[k] = config[k]
})
}

Tested with 2.7.1.

@pascalduez
Copy link
Member

Hi,

how is this an issue? Seems like a wanted behaviour.

@joneff
Copy link
Author

joneff commented Jan 30, 2020

If it's wanted behaviour, then consider this not a bug report, but rather a feature request. To me, it makes perfect sense to be able to pass both configuration file and options.

I would imagine that the scenario I stumbled upon, having multiple directories with sass files that need to be documented with some common and specific settings, isn't unique. Those are the cases where the common settings could be passed as object and the speccific setings as config file.

@pascalduez
Copy link
Member

I understand, if you're willing to rephrase the issue under a "feature request", and detail the needs and expectations, it can maybe be considered for the next major (whenever that be...). Changing that sort of behaviour on the current major would probably bring too much troubles.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants