Commit Graph

10 Commits

Author SHA1 Message Date
Felipe Santos 392105b7c6 chore(oxlint): enable unicorn plugin and prefer-node-protocol (#43283)
chore(oxlint): enable unicorn plugin and prefer-node-protocol
2026-05-29 06:55:58 +00:00
Sergei Zharinov 9d857c1f68 refactor(lint): Organize imports with biome (#40966) 2026-02-06 13:40:01 +00:00
Sergei Zharinov 2b0e80b884 feat!: Switch to ESM modules (#40756) 2026-01-29 14:21:41 +00:00
Jamie Tanna 0b42055fbe fix(json-schema): add a separate schema for Inherit Config (#40683)
In shared preset repositories, some users will use a mix of Inherit
Config and Repo Config options with the existing JSON Schema.

As part of Renovate 43, we're removing the ability for any global
options to be usable in Repo Config, which would also mean that it's now
either a case of "ignoring warnings in my editor" and "using Global
Config JSON Schema", which isn't a great option.

We can instead create a third JSON Schema, one which is focussed on
shared presets that can include Inherit Config options.

This makes it clear that the repo config's JSON Schema should not be
used for anything Inherit Config.
2026-01-26 15:44:54 +00:00
renovate[bot] 1acfce2ee5 chore(deps): update dependency ajv to v8 (main) (#38744)
chore(deps): update dependency ajv to v8

| datasource | package | from   | to     |
| ---------- | ------- | ------ | ------ |
| npm        | ajv     | 6.12.6 | 8.17.1 |

As part of this upgrade we must:

- use `schemaId: $id`, as `auto` no longer exists
- update type imports
- import `format: uri` validation from `ajv-imports`
- remove now unnecessary `await`
- add `ajv-validation` before compiling the schema (in
  `check-fenced-code`)
- migrate to the new `error.instancePath` property

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-10-24 15:31:12 +00:00
Jamie Tanna 3b9489bf2e chore(schema): add JSON Schema for global configuration (#38800)
As noted in #38727, it would be convenient to distribute a separate JSON
Schema that is explicitly for "global" / "admin" / "self-hosted"
configuration, separate to the repository configuration in our current
`renovate-schema.json`.

This gets wired in as an additional JSON file, and will have a different
set of configuration options in the future, noted by the `isGlobal`.

Closes #38727.
2025-10-23 14:30:42 +00:00
Jamie Tanna 58a1f4cfbc chore(tools/schema): remove schema version from function names (#38768) 2025-10-21 14:32:34 +00:00
Jamie Tanna a36331e62a chore(tools/schema): upgrade internal schemas to JSON Schema draft-07 (#38752)
As noted in #38749, we need to upgrade to draft-07 of JSON Schema to
upgrade our dependency on AJV.

To do so, we "just" need to update the `$schema`, as we're not using
anything that's been deprecated/removed/changed as part of draft-07.

This doesn't impact anything user-facing (as these are schemas for
internal data files), and the schema doesn't change.

This appears to be supported by `vscode-json-languageservice`, which is
used by several IDEs (including VSCode) and editors to perform JSON
Schema validation in-editor.
2025-10-21 09:06:19 +00:00
Jamie Tanna e0ed4e8f23 ci(tools/json-schema): validate data files against their JSON schemas (#38740)
To ensure that our `lib/data` files match the JSON schemas that we have
defined, we can also introduce these into the `tools/validate-schema.ts`
file.

This loops through the known files and the JSON Schema that defines
them, then validates them with AJV.

Note that this also requires the following schema changes:

- using draft-04 everywhere (for ease, as we're not using draft-07
  functionality)
- using a consistent `$schema` identifier, to match the document `$id`
- make sure that the top-level `all` key doesn't get matched by
  `patternProperties`

The core of this - as little code as it is - was generated via GPT-4.1,
based on existing code in this file.

Co-authored-by: gpt-4.1 <jamie.tanna+github-copilot@mend.io>
2025-10-20 16:11:49 +00:00
Jamie Tanna f1e38a1f15 ci(tools/json-schema): validate JSON schemas are well-formed (#38643)
To ensure that our JSON Schema is always correctly formed, we can use
`ajv`'s inbuilt metaschema validation to perform.

We also wire this into the `test-schema` script, to make sure that we're
always validating it in CI.

This applies to both the core JSON Schema for configuration, and any of
our other JSON Schema files for internal configuration.

The core of this - as little code as it is - was generated via GPT-4.1.

Co-authored-by: gpt-4.1 <jamie.tanna+github-copilot@mend.io>
2025-10-20 15:14:44 +00:00