Skip to content

Conversation

@muodov
Copy link
Member

@muodov muodov commented Jan 29, 2025

I borrowed some code from the remote config repo to validate JSON files against the existing TS types

@muodov muodov requested a review from sammacbeth January 29, 2025 13:48
@muodov muodov added the tests Add or improve existing tests label Jan 29, 2025
@muodov muodov requested a review from noisysocks January 29, 2025 13:50
@noisysocks
Copy link
Contributor

Very nice! Love it.

I think we could go a even further and split this script into two scripts:

  1. one that generates a JSON schema file, which we commit to the repo, and;
  2. one that validates our rules against the JSON schema.

This way we can reference the committed JSON schema using $schema at the top of each rule and developers get autocompletion and hints in their IDE when editing rules.

I’ve done exactly this over in #615 which has your PR set as the base. What do you think?

@muodov muodov merged commit f812e39 into main Jan 31, 2025
9 checks passed
@muodov muodov deleted the validate-json-rules branch January 31, 2025 10:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

tests Add or improve existing tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants