/
helpers.ts
44 lines (42 loc) · 1.24 KB
/
helpers.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
import type { Preset } from '../types';
/* eslint sort-keys: ["error", "asc", {caseSensitive: false, natural: true}] */
export const presets: Record<string, Preset> = {
disableTypesNodeMajor: {
description: 'Disable `major` updates to `@types/node`.',
packageRules: [
{
enabled: false,
matchPackageNames: ['@types/node'],
matchUpdateTypes: ['major'],
},
],
},
followTypescriptNext: {
description: 'Keep `typescript` version in sync with the `next` tag.',
extends: [':followTag(typescript, next)'],
},
followTypescriptRc: {
description: 'Keep `typescript` version in sync with the `rc` tag.',
extends: [':followTag(typescript, rc)'],
},
pinGitHubActionDigests: {
description: 'Pin `github-action` digests.',
packageRules: [
{
matchDepTypes: ['action'],
pinDigests: true,
},
],
},
pinGitHubActionDigestsToSemver: {
description: 'Convert pinned GitHub Action digests to SemVer.',
packageRules: [
{
extends: ['helpers:pinGitHubActionDigests'],
extractVersion: '^(?<version>v\\d+\\.\\d+\\.\\d+)$',
versioning:
'regex:^v?(?<major>\\d+)(\\.(?<minor>\\d+)\\.(?<patch>\\d+))?$',
},
],
},
};