# renovate.json5: Names, Presets and Validation | JSON5.dev


Source: https://json5.dev/config/renovate/

---

# JSON5 Config for Renovate

Everything about `renovate.json5`: the 14 file names Renovate reads, the order it tries them, and what its own docs say about JSONC.

Renovate accepts JSON5 in repository config and in shareable presets, but its documentation recommends an explicit `.jsonc` file, not `.json5` or a commented `.json`, when you want comments. One documented reason: a config migration keeps comments in JSONC and drops them in JSON5.

We ran the validator against real files to show the output, including the migration that eats a comment. Below you will find the file lookup order, preset naming, validation and the mistakes that cost the most time.

![A Renovate configuration file in JSON5 on a monitor beside a checklist of config file names in lookup order](https://json5.dev/img/hero/config-renovate.png)

**TL;DR:** `renovate.json5` works, in the repository root, in `.github/` or in `.gitlab/`. Renovate stops at the first file it finds, so keep exactly one. Its docs recommend `.jsonc` over `.json5` or `.json` when you want comments, and its migrations keep comments in JSONC but lose them in JSON5. Check every change with `renovate-config-validator`. More on the [JSON5 versus JSONC](https://json5.dev/compare/jsonc/) trade-off.

[File Names](#file-names) [Example](#example) [JSONC or JSON5](#jsonc) [Presets](#presets) [Validation](#validation) [Migrating](#migrating) [Mistakes](#mistakes) [FAQ](#faq)

![Renovate logo](https://json5.dev/images/tech/renovate.png)

## Which File Names Renovate Reads

Renovate is a dependency-update bot. In each repository it looks for one configuration file, and the lookup list is longer than most people expect. The list below comes from the [configuration options page](https://docs.renovatebot.com/configuration-options/); we cross-checked the order against the pattern list in Renovate's source, `lib/config/app-strings.ts`.

Order

Path

Format

1

`renovate.json`

JSON, read as JSONC

2

`renovate.jsonc`

JSONC

3

`renovate.json5`

JSON5

4 to 6

`.github/renovate.json`, `.jsonc`, `.json5`

Same three formats

7 to 9

`.gitlab/renovate.json`, `.jsonc`, `.json5`

Same three formats

10

`.renovaterc`

No extension, read as JSONC

11 to 13

`.renovaterc.json`, `.jsonc`, `.json5`

Same three formats

14

`package.json` with a `"renovate"` key

Deprecated

Three rules from the docs matter more than the list itself. Renovate "tries to find the configuration files in the order listed", it "stops the search after it finds the first match", and it checks any custom names in the `configFileNames` array before the built-in list. A second config file in the same repository is not merged in; it is ignored. The source also filters out the other platforms' folders, so a `.gitlab/` file is not looked for on GitHub.

Storing configuration in `package.json` is marked deprecated in the docs, which say support "may be removed in the future". It is not removed today. The onboarding pull request that Renovate opens creates a plain `renovate.json` in the root, so every repository starts in JSON; moving to JSON5 is a rename you do yourself (see [Migrating](#migrating)).

![Code file icon](https://json5.dev/images/icons/code-file.png)

## A Working renovate.json5

This file uses the features people reach for JSON5 to get: comments that explain a rule, unquoted keys, single-quoted strings and a [trailing comma](https://json5.dev/glossary/#trailing-comma) after the last item. We validated it with Renovate 45.4.0 and it passed.

`// renovate.json5 - dependency update policy { $schema: 'https://docs.renovatebot.com/renovate-schema.json', extends: ['config:recommended'], // one weekly pull request for all minor and patch updates packageRules: [ { matchUpdateTypes: ['minor', 'patch'], groupName: 'non-major', }, ], }`

`$schema` is a valid unquoted key, because JSON5 allows `$` in an identifier name. The schema URL is the one Renovate's docs use for editor completion. For the full list of what JSON5 lets you drop, see the [syntax cheatsheet](https://json5.dev/cheatsheet/) and the [syntax reference](https://json5.dev/spec/syntax/).

![Comment icon](https://json5.dev/images/icons/comment.png)

## Why the Docs Prefer JSONC

Renovate's documentation says it "supports `JSONC` for `.json` files and any config files without file extension", and adds: "We also recommend you prefer using a `.jsonc` file if you want to add comments to your configuration, instead of a `.json5` file." It also says that "using an explicit `.jsonc` file is preferred over using a `.json` file with comments, as it can cause issues with editors and syntax highlighting". That is a recommendation, not a ban on JSON5: `renovate.json5` is in the lookup list and works.

So the docs give an editor reason for avoiding comments in `.json`, and give no stated reason for preferring JSONC over JSON5. Two documented behaviors point the same way, though. The validator page says its migration "keeps comments in JSON and JSONC files, but loses comments in JSON5 files", and the options page warns that Renovate "may downgrade JSON5 content to plain JSON" during migration. In our reading, a format whose comments survive an automated rewrite is the safer default for a file that a bot may edit.

Need

`.jsonc`

`.json5`

Comments

![Yes](https://json5.dev/images/icons/yes.png)

![Yes](https://json5.dev/images/icons/yes.png)

Unquoted keys and single quotes

![No](https://json5.dev/images/icons/no.png)

![Yes](https://json5.dev/images/icons/yes.png)

Comments kept by `--migrate`

![Yes](https://json5.dev/images/icons/yes.png)

![No](https://json5.dev/images/icons/no.png)

Valid shareable preset

![Yes](https://json5.dev/images/icons/yes.png)

![Yes](https://json5.dev/images/icons/yes.png)

So choose by who edits the file. If people write it and the bot rarely touches it, JSON5's unquoted keys and single quotes are a pleasant bonus. If you run `--migrate` often, or want the plainest tooling support, `renovate.jsonc` is the lower-risk choice. The wider comparison is on the [JSON5 versus JSONC page](https://json5.dev/compare/jsonc/).

![Link icon](https://json5.dev/images/icons/link.png)

## Presets Written in JSON5

A shareable preset is a config file in a repository that other repositories pull in through `extends`. The presets page states the rule plainly: they "must use the JSON, JSONC or JSON5 formats, other formats are not supported." Your preset repository can therefore use JSON5 even if consumers do not.

You write in `extends`

Renovate loads

`github>acme/renovate-config`

`default.json` in that repository

`github>acme/renovate-config:ci.json5`

`ci.json5` in that repository

`gitlab>acme/renovate-config`

Same lookup on GitLab

`local>acme/renovate-config`

Same lookup on the current platform

Two details trip people up. A bare repository reference looks for `default.json`, and the page does not list `default.json5` or `default.jsonc` as default names, so put JSON5 in a named preset (`:ci.json5` above) when you want it. The docs also show an alternative-file form with a double slash, `github>abc/foo//alternative-name.json5`. Also, using `renovate.json` as the default preset file is deprecated; rename it to `default.json`. The same page notes that Renovate supports JSONC syntax in preset files and recommends filling in the `description` field so people can see what a preset does.

`// ci.json5 - the named preset github>acme/renovate-config:ci.json5 { description: 'Pin GitHub Actions to digests and group them', packageRules: [ { matchManagers: ['github-actions'], pinDigests: true, groupName: 'github actions', }, ], }`

Writing a preset that other teams will read? The [comments best practices](https://json5.dev/tutorials/comments-best-practices/) tutorial covers what a good comment says, and the [VS Code guide](https://json5.dev/tools/vscode/) covers editor setup for JSON5 files.

![Test icon](https://json5.dev/images/icons/test.png)

## Validating with renovate-config-validator

The validator ships inside the `renovate` npm package. The docs give this invocation:

`npx --yes --package renovate -- renovate-config-validator`

With no arguments it checks every default location that exists, plus the file named by `RENOVATE_CONFIG_FILE`. Run against the example above, it prints:

`INFO: Validating renovate.json5 INFO: Config validated successfully against 1 file(s)`

### Flags that matter

Flag

Effect

_(none)_

Exits non-zero on any validation warning or error

`--strict`

Also fails when the config needs migration

`--migrate`

Writes the needed migrations back into the file

`--no-global`

Treats a file you name as repository config, not global config

The last flag is the one to remember. When you pass a filename, the validator treats it as global self-hosted configuration unless you add `--no-global`; the output says so (`Validating bad.json5 as global config`). Repository settings such as `packageRules` are still checked, but a preset or a repo file should be validated as what it is. A deliberately wrong file shows the error format:

`// bad.json5 - groupName is spelled groupname { extends: ['config:recommended'], packageRules: [{ matchUpdateTypes: ['minor'], groupname: 'x' }], } $ renovate-config-validator --no-global bad.json5 ERROR: Found errors in configuration "message": "Invalid configuration option: packageRules[0].groupname"`

The error exits non-zero, so the same command works as a pull-request check. A JSON5 syntax mistake, such as a missing comma between two properties, is reported by the parser instead; for those, the [parse errors guide](https://json5.dev/troubleshooting/parse-errors/) explains the messages, and the [online validator](https://json5.dev/tools/online-validator/) checks a snippet without installing anything.

![Refresh icon](https://json5.dev/images/icons/refresh.png)

## Migrating renovate.json to renovate.json5

The move is three steps, and the order matters because of the first-match rule.

1.  Rename the file: `git mv renovate.json renovate.json5`. Do not leave both behind, because `renovate.json` comes first in the list and would win.
2.  Run the validator. An unknown key is reported as an error, so a typo in the move shows up at once.
3.  Add comments, drop quotes where you like, and run the validator again before you merge.

### What `--migrate` does to comments

Renovate renames deprecated options over time. `config:base`, for example, became `config:recommended`. We ran `--strict` on a JSON5 file that still used the old name, then `--migrate`:

`// before // keep me { extends: ['config:base',], schedule: 'before 5am on monday', } $ renovate-config-validator --strict WARN: Config migration necessary exit code 1 $ renovate-config-validator --migrate INFO: Applied config migration to renovate.json5 // after { extends: [ 'config:recommended', ], schedule: 'before 5am on monday', }`

The migration was correct and the comment was gone. The same migration on a `renovate.jsonc` file left the `// keep me` line in place, exactly as the docs describe. Review the diff of any `--migrate` run before committing, and keep the comment text somewhere you can restore it from, such as Git history.

`--strict` is a good CI setting for the opposite reason: it fails the build while a migration is pending, so an outdated option is noticed before Renovate itself has to rewrite your file. Migration rewrites JSON, JSONC and JSON5 files only; it does not touch JavaScript, TypeScript or YAML config, nor the `renovate` key in `package.json`.

![Warning icon](https://json5.dev/images/icons/warning.png)

## Common Mistakes

### Two config files in one repo

Renovate uses the first match and ignores the rest, so edits to `renovate.json5` do nothing while a `renovate.json` sits above it. The validator, run with no arguments, checks every file it finds, so it passes both and hides the conflict. We saw it report "2 file(s)" for a `.json5` and a `.jsonc` in one folder.

### Comments in a `.json` file

Renovate reads `renovate.json` as JSONC, so comments work. The docs warn that comments in a `.json` file "can cause issues with editors and syntax highlighting", and other tools that open the same file may treat it as strict JSON and complain. If comments matter, use `.jsonc`, which the docs prefer.

### Validating a preset as global config

A named file is treated as global self-hosted config by default. Add `--no-global` when you check a repository file or a preset.

### Expecting `default.json5`

A bare `github>org/repo` reference looks for `default.json`. Name the JSON5 file in the reference, as in `:ci.json5`.

### Config in `package.json`

It is the last name in the list and is deprecated. Move it to a dedicated file so a `package.json` change does not alter your update policy.

### Assuming Renovate updates `package.json5`

The npm manager's default file patterns are `package.json`, `pnpm-workspace.yaml` and `.yarnrc.yml`. The docs do not mention `package.json5`. See the [pnpm guide](https://json5.dev/config/pnpm/).

## Renovate and JSON5: Common Questions

### Does Renovate support `renovate.json5`?

Yes. It is third in the lookup order, and also valid under `.github/`, `.gitlab/` and as `.renovaterc.json5`.

### Should I use JSONC instead?

The docs recommend `.jsonc` over `.json5` for commented configs, and migrations preserve its comments. JSON5 is fine if you accept that a migration can strip them.

### Where does the file go?

The repository root is the default and what onboarding creates. `.github/` keeps the root tidy; Renovate finds either.

### Can a preset be JSON5?

Yes, presets may be JSON, JSONC or JSON5. Reference a named file such as `:ci.json5`, because the unnamed default is `default.json`.

### How do I validate in CI?

Run `npx --yes --package renovate -- renovate-config-validator --strict`. It exits non-zero on errors, and with `--strict` on pending migrations too.

### Is the `package.json` config key gone?

Not yet. The docs call it deprecated and say support may be removed. Plan to move off it.

## Related Pages

[![pnpm logo](https://json5.dev/images/tech/pnpm.png)

### pnpm and package.json5

What reads it and what does not

](https://json5.dev/config/pnpm/)[![Compare icon](https://json5.dev/images/icons/compare.png)

### JSON5 vs JSONC

The trade-off in detail

](https://json5.dev/compare/jsonc/)[![Settings icon](https://json5.dev/images/icons/settings.png)

### All Config Guides

Tools that read JSON5

](https://json5.dev/config/)

## Sources

(8)

1.  [Renovate docs: Configuration options](https://docs.renovatebot.com/configuration-options/)
2.  [Renovate docs: Shareable config presets](https://docs.renovatebot.com/config-presets/)
3.  [Renovate docs: Config validation](https://docs.renovatebot.com/config-validation/)
4.  [Renovate docs: Installing and onboarding](https://docs.renovatebot.com/getting-started/installing-onboarding/)
5.  [Renovate docs: Config overview](https://docs.renovatebot.com/config-overview/)
6.  [Renovate docs: npm manager](https://docs.renovatebot.com/modules/manager/npm/)
7.  [Renovate source: lib/config/app-strings.ts](https://github.com/renovatebot/renovate/blob/main/lib/config/app-strings.ts)
8.  [renovate on npm (45.4.0 used for the validator runs)](https://www.npmjs.com/package/renovate)

Last reviewed: November 29, 2026.
