Skip to content
This repository was archived by the owner on Nov 10, 2022. It is now read-only.
This repository was archived by the owner on Nov 10, 2022. It is now read-only.

Demo: add ability to configure rules #653

Open
@kaicataldo

Description

@kaicataldo

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:

  1. 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).
  2. 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.
  3. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    demoRelates to the ESLint demo page (https://eslint.org/demo)enhancementThis change enhances an existing feature of the website

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions