From 3f71f5c6d880e84ccd96af299fb8ce47d80ed6ce Mon Sep 17 00:00:00 2001 From: Sebastian Poxhofer Date: Tue, 25 Feb 2025 01:31:29 +0100 Subject: [PATCH] chore(prettier): sort fields by name (#9) --- .prettierrc.js | 3 ++ presets/group-by-plugin.json | 4 +- presets/no-esm.json | 44 ++++++++++----------- presets/unsupported-framework-upgrades.json | 12 +++--- presets/update-backstage-json.json | 6 +-- 5 files changed, 36 insertions(+), 33 deletions(-) diff --git a/.prettierrc.js b/.prettierrc.js index d3f5e1e..872c64b 100644 --- a/.prettierrc.js +++ b/.prettierrc.js @@ -5,6 +5,9 @@ */ const config = { plugins: ["prettier-plugin-sort-json"], + + // sort packageRule lists + jsonRecursiveSort: true, }; export default config; diff --git a/presets/group-by-plugin.json b/presets/group-by-plugin.json index da3db5c..95a7ffc 100644 --- a/presets/group-by-plugin.json +++ b/presets/group-by-plugin.json @@ -2,11 +2,11 @@ "$schema": "https://docs.renovatebot.com/renovate-schema.json", "packageRules": [ { + "groupName": "Backstage plugin {{ lookup (split packageName '-') 1 }}", "matchSourceUrls": [ "https://github.com/backstage/backstage/", "https://github.com/backstage/community-plugins" - ], - "groupName": "Backstage plugin {{ lookup (split packageName '-') 1 }}" + ] } ] } diff --git a/presets/no-esm.json b/presets/no-esm.json index 4eae23a..c46704c 100644 --- a/presets/no-esm.json +++ b/presets/no-esm.json @@ -1,60 +1,60 @@ { "packageRules": [ { + "allowedVersions": "<3.0.0", "matchDatasources": ["npm"], - "matchPackageNames": ["node-fetch"], - "allowedVersions": "<3.0.0" + "matchPackageNames": ["node-fetch"] }, { + "allowedVersions": "<4.0.0", "matchDatasources": ["npm"], - "matchPackageNames": ["nanoid", "octokit", "p-limit"], - "allowedVersions": "<4.0.0" + "matchPackageNames": ["nanoid", "octokit", "p-limit"] }, { + "allowedVersions": "<5.0.0", "matchDatasources": ["npm"], "matchPackageNames": [ "@octokit/webhooks-methods", "@sindresorhus/is", - "yn", + "p-map", "url-join", - "p-map" - ], - "allowedVersions": "<5.0.0" + "yn" + ] }, { + "allowedVersions": "<6.0.0", "matchDatasources": ["npm"], - "matchPackageNames": ["find-up"], - "allowedVersions": "<6.0.0" + "matchPackageNames": ["find-up"] }, { + "allowedVersions": "<7.0.0", "matchDatasources": ["npm"], - "matchPackageNames": ["@octokit/auth-app", "@octokit/oauth-app"], - "allowedVersions": "<7.0.0" + "matchPackageNames": ["@octokit/auth-app", "@octokit/oauth-app"] }, { + "allowedVersions": "<8.0.0", "matchDatasources": ["npm"], - "matchPackageNames": ["@octokit/graphql"], - "allowedVersions": "<8.0.0" + "matchPackageNames": ["@octokit/graphql"] }, { + "allowedVersions": "<9.0.0", "matchDatasources": ["npm"], - "matchPackageNames": ["@octokit/plugin-throttling", "@octokit/request"], - "allowedVersions": "<9.0.0" + "matchPackageNames": ["@octokit/plugin-throttling", "@octokit/request"] }, { + "allowedVersions": "<15.0.0", "matchDatasources": ["npm"], - "matchPackageNames": ["@octokit/graphql-schema"], - "allowedVersions": "<15.0.0" + "matchPackageNames": ["@octokit/graphql-schema"] }, { + "allowedVersions": "<13.0.0", "matchDatasources": ["npm"], - "matchPackageNames": ["@octokit/webhooks"], - "allowedVersions": "<13.0.0" + "matchPackageNames": ["@octokit/webhooks"] }, { + "allowedVersions": "<21.0.0", "matchDatasources": ["npm"], - "matchPackageNames": ["@octokit/rest"], - "allowedVersions": "<21.0.0" + "matchPackageNames": ["@octokit/rest"] } ] } diff --git a/presets/unsupported-framework-upgrades.json b/presets/unsupported-framework-upgrades.json index 5a0c304..6e193c0 100644 --- a/presets/unsupported-framework-upgrades.json +++ b/presets/unsupported-framework-upgrades.json @@ -2,6 +2,7 @@ "$schema": "https://docs.renovatebot.com/renovate-schema.json", "packageRules": [ { + "allowedVersions": "<5.0.0", "description": [ "Do not upgrade to Express v5", "https://github.com/backstage/backstage/issues/27808" @@ -11,24 +12,23 @@ "express", "@types/express", "@types/express-serve-static-core" - ], - "allowedVersions": "<5.0.0" + ] }, { + "allowedVersions": "<19.0.0", "description": [ "Do not upgrade to React 19", "https://github.com/backstage/backstage/issues/28080" ], - "extends": ["packages:react"], - "allowedVersions": "<19.0.0" + "extends": ["packages:react"] }, { + "allowedVersions": "<7.0.0", "description": [ "Do not upgrade to React Router v7", "https://github.com/backstage/backstage/issues/27927" ], - "matchSourceUrls": ["https://github.com/remix-run/react-router"], - "allowedVersions": "<7.0.0" + "matchSourceUrls": ["https://github.com/remix-run/react-router"] } ] } diff --git a/presets/update-backstage-json.json b/presets/update-backstage-json.json index 8ec0746..9eb6919 100644 --- a/presets/update-backstage-json.json +++ b/presets/update-backstage-json.json @@ -2,12 +2,12 @@ "$schema": "https://docs.renovatebot.com/renovate-schema.json", "customManagers": [ { - "description": "update backstage.json file", "customType": "regex", + "datasourceTemplate": "github-releases", + "depNameTemplate": "backstage/backstage", + "description": "update backstage.json file", "fileMatch": "backstage\\.json$", "matchStrings": ["\"version\":\\s*\"(?[^\"]+)"], - "depNameTemplate": "backstage/backstage", - "datasourceTemplate": "github-releases", "versioningTemplate": "semver-coerced" } ]