Closed jonathanglasmeyer closed 8 years ago
Looks good to me. I added a few comments inline.
@@ master #81 diff @@
===================================
Files 1 17 +16
Lines 14 107 +93
Methods 0 0
Messages 0 0
Branches 0 0
===================================
+ Hits 14 107 +93
Misses 0 0
Partials 0 0
Powered by Codecov. Last updated by f01b917...c8f1fa7
From my side this is ready to merge, i'll wait some days for more feedback though as this is a breaking change that'll shape the future of this tool.
No objections? I would love to see this go forward. 👍
Seems like it. :) I'm on holidays till next Thursday, no laptop with me. The branch would have to be rebased on master, if you want to do that, you can merge it into master after that. 👍🏻
Hey guys, here comes something. :) I tried out Joi 9's
.extend
feature which allows us to write custom validations and have them appear in the some formatted stdout that Joi provides + lets us use the succint, declarative style for more advanced features. This PR does multiple things (I know i know :) - i totally spike coded this):resolve.root
do not nameclash with node_module packagessrc/types/absolutePaths
now usingJoi.extend
and thereby having the power to do file system checks)Introduces a breaking change discussed in #73, so that we only have two arguments to validate(), first: the webpack config object, second: an options object for webpack-validator.
Comment on point 1: in order to implement "schema configurability" (toggling rules on and off), the schema is now wrapped in a function that takes a
schemaOptions
object; it will pass this to children. The bulk of changes pertains to a necessary internal interface change forallValid
: it is now more similar toallInvalid
, also taking the input like{ input: <the-test-config-slice> }
. This allows overwriting the sub-schema used in order to test different schemaOptions, i.e write tests for a config slice with a relevant rule disabled and enabled (example can be seen insrc/properties/resolve/index.test.js
, valid #12 -- we override the schema in order to test that disabling the rule "no-root-files-node-modules-nameclash" will allow thisresolve.root
configuration, even if the specified folders contain files/folders that match a node_modules dependency name.I'm pretty happy with this and look forward to your feedback! Edit: cc @bebraw @kentcdodds @nyrosmith :)