The Wayback Machine - https://web.archive.org/web/20201224130359/https://github.com/babel/minify/issues/436
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

Options validation for preset #436

Open
boopathi opened this issue Feb 20, 2017 · 1 comment
Open

Options validation for preset #436

boopathi opened this issue Feb 20, 2017 · 1 comment

Comments

@boopathi
Copy link
Member

@boopathi boopathi commented Feb 20, 2017

Validate the entire tree of options passed to preset.

Maybe, each plugin can export a list of options that only babili preset understands and we can validate them only when using the preset and not when using the plugin separately.

module.exports = function plugin() {};
module.exports.options = PropTypes.object({
  n: PropTypes.number
});

Or, this can be implemented in babel - where validator is built into babel for plugins and presets.

function plugin({ PropTypes }) {
  return {
    visitor: {...}
    options: PropTypes.object({
      n: PropTypes.number
    })
  };
}
@code4cake
Copy link

@code4cake code4cake commented Aug 16, 2017

I can tackle this one

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.