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.
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 trade-off.
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; 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).
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 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 and the syntax reference.
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 | ||
| Unquoted keys and single quotes | ||
Comments kept by --migrate | ||
| Valid shareable preset |
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.
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 tutorial covers what a good comment says, and the VS Code guide covers editor setup for JSON5 files.
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 explains the messages, and the online validator checks a snippet without installing anything.
Migrating renovate.json to renovate.json5
The move is three steps, and the order matters because of the first-match rule.
- Rename the file:
git mv renovate.json renovate.json5. Do not leave both behind, becauserenovate.jsoncomes first in the list and would win. - Run the validator. An unknown key is reported as an error, so a typo in the move shows up at once.
- 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.
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.
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.
Sources
(8)
- Renovate docs: Configuration options
- Renovate docs: Shareable config presets
- Renovate docs: Config validation
- Renovate docs: Installing and onboarding
- Renovate docs: Config overview
- Renovate docs: npm manager
- Renovate source: lib/config/app-strings.ts
- renovate on npm (45.4.0 used for the validator runs)
Last reviewed: November 29, 2026.
JavaScript
Python
TypeScript
Node.js
Rust
Java
C#
Ruby
Kotlin
Lua
Babel
Vite
webpack
ESLint
Prettier
VS Code
JetBrains