Demo: add ability to configure rules #653
Description
Our demo is increasingly being used in the issue triage process, and I think it would be beneficial to treat it more as a “Playground” or “REPL” than just as a demo.
I believe a big win would be to add the ability to configure rules (instead of just being able to turn them on or off with their default configuration). It would allow users to create their configs interactively in the browser as well as improve sharing examples and testing bugs while triaging issues. It’s currently possible to configure them using inline comments, but this isn’t a great user experience.
I have a few ideas of how this could be achieved:
- We could generate inputs dynamically based on each rule’s JSON schema. I would like to take a crack at this, but the one open question I have is how to handle cases where the structure of the configuration can vary greatly (
oneOf
, for example). - Add a text box input that allows visitors to paste in their configuration. What’s tricky about this is that we’ll have to ignore any plugins that are configured and warn on cases of malformed JSON.
- We could potentially do both, adding the ability to switch between them. The configuration could be stored as an object and represented in both views.
Regardless, we could then allow for exporting your configuration so that you can create the configuration in the demo and export/copy it for use in your project.