From 466c03200e0a48b2a0bbc2a793e4f7bb2b4d2c55 Mon Sep 17 00:00:00 2001 From: Jamie Tanna Date: Mon, 1 Dec 2025 16:28:23 +0000 Subject: [PATCH] refactor: ensure that configuration options are in alphabetical order To make it easier for future changes to them, and to keep things consistent. --- lib/config/options/index.spec.ts | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/lib/config/options/index.spec.ts b/lib/config/options/index.spec.ts index 26bb5938fd0..efc1e65fbdc 100644 --- a/lib/config/options/index.spec.ts +++ b/lib/config/options/index.spec.ts @@ -1,6 +1,7 @@ import { isNullOrUndefined } from '@sindresorhus/is'; import * as manager from '../../modules/manager'; import * as platform from '../../modules/platform'; +import type { RenovateOptions } from '../types'; import { getOptions } from '.'; vi.unmock('../../modules/platform'); @@ -66,4 +67,19 @@ describe('config/options/index', () => { } } }); + + it('are in alphabetical order, based on `name`', () => { + const keys = function (opts: RenovateOptions[]): string[] { + return opts.map((opt) => opt.name); + }; + + const opts = getOptions(); + + const sortedOpts = [...opts].sort((a, b) => a.name.localeCompare(b.name)); + + expect( + keys(opts), + 'Configuration options should be in alphabetical order based on the `name` key', + ).toStrictEqual(keys(sortedOpts)); + }); });