js-dxtools / webpack-validator

Validates your webpack config with Joi
MIT License
295 stars 29 forks source link

Support custom schema with CLI #106

Closed kentcdodds closed 6 years ago

kentcdodds commented 8 years ago

I envision something like:

webpack-validator webpack.config.js --schema-extension ./other/my-schema.js

Where ./other/my-schema.js is simply a module that exports the schema:

const validate = require('webpack-validator')
const Joi = require('webpack-validator').Joi
module.exports = Joi.object({
  eslint: Joi.any()
})

Thinking about it further, it would be nice to be able to configure all options via the CLI :+1:

jonathanglasmeyer commented 8 years ago

we probably need yet another rc-file. (webpack-validatorrc.js 🙈; needs to have Js for the schemaExtension). The thought of yet another meta file pains me but I see no better solution. 😐