SassDoc / sassdoc

Release the docs!
http://sassdoc.com
MIT License
1.41k stars 56 forks source link

Calling sassdoc({verbose: true}) causes error #490

Closed timcosgrove closed 7 years ago

timcosgrove commented 7 years ago

https://github.com/SassDoc/sassdoc/pull/489 changes the behavior of verbose. Unfortunately this seems to run afoul of reserved key checks.

sassdoc.ensureEnvironment() instantiates the env (checking for config.verbose) and then invokes env.load(config)

Given the case where config is a plain object, env.load() invokes env.loadObject(): https://github.com/SassDoc/sassdoc/blob/c575fc5dea32aed590825531dc21d252573f92de/src/environment.js#L59

env.loadObject() checks for reserved configuration keys: https://github.com/SassDoc/sassdoc/blob/c575fc5dea32aed590825531dc21d252573f92de/src/environment.js#L79

verbose was added as a key in https://github.com/SassDoc/sassdoc/pull/489: https://github.com/SassDoc/sassdoc/blob/c575fc5dea32aed590825531dc21d252573f92de/src/environment.js#L19

Given all this, it seems like there would be no way to call sassdoc(configObject) where the configObject has a key of verbose, despite sassdoc making use of the verbose key elsewhere.

Will create a basic POC gist.

timcosgrove commented 7 years ago

https://gist.github.com/timcosgrove/3864a0d7ff7b95e4b5324b3499635426

pascalduez commented 7 years ago

Thanks for reporting, we will try to fix this ASAP. In the meantime you could downgrade to 2.2.0.

timcosgrove commented 7 years ago

Appreciate the attention!

We'll shrinkwrap if we have to. Thank you~!

pascalduez commented 7 years ago

Should be fixed as of sassdoc@2.2.2.