Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Add options for imports and plugins #6
base: master
Are you sure you want to change the base?
Add options for imports and plugins #6
Changes from 3 commits
b522899
d328c9c
ddd607f
b85c473
436ddaf
5c48d83
cf929db
87ef342
3b59a49
2337801
8e766e7
eee358f
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using default params and spread operator means this is no longer compatible with ES5, so reminder that the new minimum of ES6 (ES2015) should be called out in the release notes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like
opts
is intended to be a base set of options to be passed directly to the Stylus compiler?If that's the case, I'd prefer them to be passed as an
stylusOptions
property for clarity, instead of intermingled with the Derby plugin options.Can also name the local var to emphasize that it's a base set of Stylus options, since it can be overridden later by individual
loadStylesSync
calls (also see comment further below)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would be better to use path.dirname() here for Windows compatibility
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
More of a stylistic thing, I think
forEach
makes for easier to read code thanreduce
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
options
argument here was passed in a specificloadStylesSync
call:https://github.com/derbyjs/derby/blob/bcdbeaccb0a0fc0293022ce3574d3f414bcf4f42/src/files.ts#L59-L76
So the more specific call's options should take precedence over the base options provided to the plugin as a whole.