tools icon indicating copy to clipboard operation
tools copied to clipboard

📎 JSON Schema

Open rawnly opened this issue 3 years ago • 5 comments

Description

Create a JSON schema (following json-schema standard) would be a nice improvement to the configuration file.

I would be happy to help into this. It can be uploaded on the website then (like turbo does.) or on SchemaStore

rawnly avatar Nov 08 '22 23:11 rawnly

I use this in moon and it works great https://crates.io/crates/schemars

As an example, these are the schemas it creates: https://github.com/moonrepo/moon/tree/master/website/static/schemas

milesj avatar Nov 08 '22 23:11 milesj

@milesj

I just created a PR (#3602) for the schema and it seems to work pretty well. Anyway maybe the crate you mentioned is a better way to keep it updated (I generated mine running a script on the docs page)

CleanShot 2022-11-09 at 01 29 57@2x

rawnly avatar Nov 09 '22 00:11 rawnly

Unrelated tangent: @Rawnly

What editor and theme is that in your screenshot? It looks quite nice.

spartanatreyu avatar Nov 10 '22 05:11 spartanatreyu

Unrelated tangent:

@Rawnly

What editor and theme is that in your screenshot? It looks quite nice.

Hey is neovim with catppuccin theme

rawnly avatar Nov 10 '22 05:11 rawnly

For now, while writing the configuration file you can reference https://raw.githubusercontent.com/rome/tools/main/editors/vscode/configuration_schema.json like so:

{
  "$schema": "https://raw.githubusercontent.com/rome/tools/main/editors/vscode/configuration_schema.json",
  "formatter": {
    "indentStyle": "space"
  },
  "javascript": {
    "formatter": {
      "trailingComma": "none"
    }
  }
}

However $schema cannot be used when running rome, see #3690.

simon04 avatar Nov 12 '22 19:11 simon04

Duplicate of https://github.com/rome/tools/issues/3690

I want to keep only one issue around.

ematipico avatar Nov 15 '22 13:11 ematipico