@culur/config-eslint 1.7.5 → 1.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +40 -0
- package/dist/index.cjs +705 -870
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +4 -3
- package/dist/{index.d.ts → index.d.mts} +4 -2
- package/dist/index.mjs +699 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +16 -14
- package/src/index.test.ts +23 -0
- package/src/index.ts +7 -1
- package/src/overrides/imports-rules.test.ts +19 -0
- package/src/overrides/sort-package-json.test.ts +27 -0
- package/src/overrides/test-rules.test.ts +7 -0
- package/src/overrides/vue-rules.test.ts +19 -0
- package/src/rules/filename.test.ts +7 -0
- package/src/rules/filename.ts +4 -0
- package/src/rules/index.ts +6 -1
- package/src/rules/pnpm-workspace-yaml.test.ts +7 -0
- package/src/rules/pnpm-workspace-yaml.ts +189 -0
- package/src/rules/renovate-json/index.test.ts +7 -0
- package/src/rules/renovate-json/index.ts +2 -2
- package/src/rules/yaml-order.ts +19 -0
- package/src/rules/yarnrc-yml.test.ts +7 -0
- package/src/rules/{yml-yarnrc.ts → yarnrc-yml.ts} +2 -9
- package/src/types/index.test.ts +24 -0
- package/dist/index.js +0 -882
- package/dist/index.js.map +0 -1
package/dist/index.cjs
CHANGED
|
@@ -1,890 +1,725 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
var importsRules = {
|
|
18
|
-
name: "antfu/imports/rules",
|
|
19
|
-
partialConfig: {
|
|
20
|
-
rules: {
|
|
21
|
-
// 'import/no-deprecated': 'error',
|
|
22
|
-
"import/consistent-type-specifier-style": ["error", "prefer-top-level"]
|
|
23
|
-
}
|
|
24
|
-
}
|
|
1
|
+
//#region \0rolldown/runtime.js
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __copyProps = (to, from, except, desc) => {
|
|
9
|
+
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
10
|
+
key = keys[i];
|
|
11
|
+
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
12
|
+
get: ((k) => from[k]).bind(null, key),
|
|
13
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
25
17
|
};
|
|
26
|
-
var
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
"publishConfig",
|
|
45
|
-
//? Repository
|
|
46
|
-
"repository",
|
|
47
|
-
"bugs",
|
|
48
|
-
"homepage",
|
|
49
|
-
"funding",
|
|
50
|
-
//? Author & license
|
|
51
|
-
"contributors",
|
|
52
|
-
"author",
|
|
53
|
-
"license",
|
|
54
|
-
//? https://code.visualstudio.com/api/references/extension-manifest
|
|
55
|
-
"keywords",
|
|
56
|
-
"categories",
|
|
57
|
-
//? CDN
|
|
58
|
-
"unpkg",
|
|
59
|
-
"jsdelivr",
|
|
60
|
-
//? Export
|
|
61
|
-
"type",
|
|
62
|
-
// module or commonjs
|
|
63
|
-
"main",
|
|
64
|
-
"types",
|
|
65
|
-
"typings",
|
|
66
|
-
// synonymous with types
|
|
67
|
-
"typesVersions",
|
|
68
|
-
"exports",
|
|
69
|
-
"bin",
|
|
70
|
-
"files",
|
|
71
|
-
"workspaces",
|
|
72
|
-
//? https://code.visualstudio.com/api/references/extension-manifest
|
|
73
|
-
"icon",
|
|
74
|
-
"activationEvents",
|
|
75
|
-
"contributes",
|
|
76
|
-
//? Scripts
|
|
77
|
-
"scripts",
|
|
78
|
-
//? Node & packageManager
|
|
79
|
-
"volta",
|
|
80
|
-
"engines",
|
|
81
|
-
"packageManager",
|
|
82
|
-
//? Dependencies
|
|
83
|
-
"dependencies",
|
|
84
|
-
"devDependencies",
|
|
85
|
-
"peerDependencies",
|
|
86
|
-
"peerDependenciesMeta",
|
|
87
|
-
"bundleDependencies",
|
|
88
|
-
"optionalDependencies",
|
|
89
|
-
"pnpm",
|
|
90
|
-
"overrides",
|
|
91
|
-
"resolutions",
|
|
92
|
-
//? Lib config
|
|
93
|
-
"husky",
|
|
94
|
-
"simple-git-hooks",
|
|
95
|
-
"lint-staged",
|
|
96
|
-
"eslintConfig"
|
|
97
|
-
];
|
|
98
|
-
return configItem;
|
|
99
|
-
}
|
|
18
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
19
|
+
value: mod,
|
|
20
|
+
enumerable: true
|
|
21
|
+
}) : target, mod));
|
|
22
|
+
//#endregion
|
|
23
|
+
let _antfu_eslint_config = require("@antfu/eslint-config");
|
|
24
|
+
_antfu_eslint_config = __toESM(_antfu_eslint_config, 1);
|
|
25
|
+
let _culur_utils_packages = require("@culur/utils-packages");
|
|
26
|
+
let node_assert = require("node:assert");
|
|
27
|
+
node_assert = __toESM(node_assert, 1);
|
|
28
|
+
let _vitest_eslint_plugin = require("@vitest/eslint-plugin");
|
|
29
|
+
_vitest_eslint_plugin = __toESM(_vitest_eslint_plugin, 1);
|
|
30
|
+
let eslint_plugin_unicorn = require("eslint-plugin-unicorn");
|
|
31
|
+
eslint_plugin_unicorn = __toESM(eslint_plugin_unicorn, 1);
|
|
32
|
+
//#region src/overrides/imports-rules.ts
|
|
33
|
+
const importsRules = {
|
|
34
|
+
name: "antfu/imports/rules",
|
|
35
|
+
partialConfig: { rules: { "import/consistent-type-specifier-style": ["error", "prefer-top-level"] } }
|
|
100
36
|
};
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
37
|
+
//#endregion
|
|
38
|
+
//#region src/overrides/sort-package-json.ts
|
|
39
|
+
const sortPackageJson = {
|
|
40
|
+
name: "antfu/sort/package-json",
|
|
41
|
+
async entireConfig() {
|
|
42
|
+
const [configItem] = await (0, _antfu_eslint_config.sortPackageJson)();
|
|
43
|
+
(0, node_assert.default)(typeof configItem.name === "string");
|
|
44
|
+
(0, node_assert.default)(typeof configItem.rules === "object");
|
|
45
|
+
const sortKeys = configItem.rules["jsonc/sort-keys"];
|
|
46
|
+
(0, node_assert.default)(typeof sortKeys === "object");
|
|
47
|
+
const [, options] = sortKeys;
|
|
48
|
+
(0, node_assert.default)(typeof options === "object");
|
|
49
|
+
options.order = [
|
|
50
|
+
"publisher",
|
|
51
|
+
"name",
|
|
52
|
+
"displayName",
|
|
53
|
+
"version",
|
|
54
|
+
"description",
|
|
55
|
+
"private",
|
|
56
|
+
"publishConfig",
|
|
57
|
+
"repository",
|
|
58
|
+
"bugs",
|
|
59
|
+
"homepage",
|
|
60
|
+
"funding",
|
|
61
|
+
"contributors",
|
|
62
|
+
"author",
|
|
63
|
+
"license",
|
|
64
|
+
"keywords",
|
|
65
|
+
"categories",
|
|
66
|
+
"unpkg",
|
|
67
|
+
"jsdelivr",
|
|
68
|
+
"type",
|
|
69
|
+
"main",
|
|
70
|
+
"types",
|
|
71
|
+
"typings",
|
|
72
|
+
"typesVersions",
|
|
73
|
+
"exports",
|
|
74
|
+
"bin",
|
|
75
|
+
"files",
|
|
76
|
+
"workspaces",
|
|
77
|
+
"icon",
|
|
78
|
+
"activationEvents",
|
|
79
|
+
"contributes",
|
|
80
|
+
"scripts",
|
|
81
|
+
"volta",
|
|
82
|
+
"engines",
|
|
83
|
+
"packageManager",
|
|
84
|
+
"dependencies",
|
|
85
|
+
"devDependencies",
|
|
86
|
+
"peerDependencies",
|
|
87
|
+
"peerDependenciesMeta",
|
|
88
|
+
"bundleDependencies",
|
|
89
|
+
"optionalDependencies",
|
|
90
|
+
"pnpm",
|
|
91
|
+
"overrides",
|
|
92
|
+
"resolutions",
|
|
93
|
+
"husky",
|
|
94
|
+
"simple-git-hooks",
|
|
95
|
+
"lint-staged",
|
|
96
|
+
"eslintConfig"
|
|
97
|
+
];
|
|
98
|
+
return configItem;
|
|
99
|
+
}
|
|
122
100
|
};
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
101
|
+
//#endregion
|
|
102
|
+
//#region src/overrides/test-rules.ts
|
|
103
|
+
const testRules = {
|
|
104
|
+
name: "antfu/test/rules",
|
|
105
|
+
partialConfig: {
|
|
106
|
+
files: ["**/*\\.{test,test-d}.?(c|m)[jt]s?(x)"],
|
|
107
|
+
rules: {
|
|
108
|
+
..._vitest_eslint_plugin.default.configs.recommended.rules,
|
|
109
|
+
"test/valid-title": ["error", { allowArguments: true }],
|
|
110
|
+
"test/expect-expect": ["error", { assertFunctionNames: [
|
|
111
|
+
"expect",
|
|
112
|
+
"expectTypeOf",
|
|
113
|
+
"assert",
|
|
114
|
+
"assertType"
|
|
115
|
+
] }]
|
|
116
|
+
}
|
|
117
|
+
}
|
|
139
118
|
};
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
"unicorn/filename-case": [
|
|
155
|
-
"error",
|
|
156
|
-
{
|
|
157
|
-
case: "kebabCase",
|
|
158
|
-
ignore: [
|
|
159
|
-
"^ADR-\\w+\\.md",
|
|
160
|
-
"^ARCHITECTURE\\.md",
|
|
161
|
-
"^CHANGELOG\\.md",
|
|
162
|
-
"^CONTRIBUTING\\.md",
|
|
163
|
-
"^README\\.md"
|
|
164
|
-
]
|
|
165
|
-
}
|
|
166
|
-
]
|
|
167
|
-
}
|
|
119
|
+
//#endregion
|
|
120
|
+
//#region src/overrides/vue-rules.ts
|
|
121
|
+
const vueRules = {
|
|
122
|
+
name: "antfu/vue/rules",
|
|
123
|
+
partialConfig: { rules: {
|
|
124
|
+
"vue/singleline-html-element-content-newline": "off",
|
|
125
|
+
"vue/multiline-html-element-content-newline": "off",
|
|
126
|
+
"vue/padding-line-between-blocks": ["error", "always"],
|
|
127
|
+
"vue/component-name-in-template-casing": [
|
|
128
|
+
"error",
|
|
129
|
+
"PascalCase",
|
|
130
|
+
{ registeredComponentsOnly: false }
|
|
131
|
+
]
|
|
132
|
+
} }
|
|
168
133
|
};
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
"matchDepTypes",
|
|
194
|
-
// string[]: Apply rule if the dependency type matches (e.g., ["dependencies", "devDependencies", "peerDependencies"]).
|
|
195
|
-
"matchUpdateTypes",
|
|
196
|
-
// UpdateType[]: Apply rule based on the type of update (e.g., ["major", "minor", "patch", "pin", "digest"]).
|
|
197
|
-
"matchCategories",
|
|
198
|
-
// string[]: Apply rule if dependency belongs to specified categories (defined via extractConfigs or presets like "linters").
|
|
199
|
-
"matchCurrentVersion",
|
|
200
|
-
// string: Apply rule if the *currently installed* version matches this pattern (supports regex).
|
|
201
|
-
"matchSourceUrls",
|
|
202
|
-
// string[]: Apply rule if the dependency's source repository URL matches any pattern in the list.
|
|
203
|
-
"matchFileNames",
|
|
204
|
-
// string[]: Apply rule if the dependency is found in a file matching any pattern in this list.
|
|
205
|
-
"matchBaseBranches",
|
|
206
|
-
// string[]: Apply rule only when Renovate is running against one of these base branches.
|
|
207
|
-
"matchRepositories",
|
|
208
|
-
// string[]: Apply rule only when Renovate is running in a repository matching one of these names.
|
|
209
|
-
"matchCurrentValue",
|
|
210
|
-
// string: Apply rule if the current value (e.g., Docker tag) matches this pattern.
|
|
211
|
-
"matchNewValue",
|
|
212
|
-
// string: Apply rule if the proposed new value/version matches this pattern.
|
|
213
|
-
"matchCurrentAge",
|
|
214
|
-
// string: Apply rule based on how long the current version has been used (e.g., "> 3 months").
|
|
215
|
-
"matchConfidence",
|
|
216
|
-
// MergeConfidence[]: Apply rule based on Renovate's calculated merge confidence level (e.g., ["high", "very-high"]).
|
|
217
|
-
"matchJsonata"
|
|
218
|
-
// string[]: Advanced matching using JSONata queries against dependency metadata.
|
|
219
|
-
],
|
|
220
|
-
// --- Registry & Network Configuration ---
|
|
221
|
-
registriesNetwork: [
|
|
222
|
-
"registryUrls"
|
|
223
|
-
// string[] | null: Override the global or default registry URLs specifically for dependencies matched by this rule.
|
|
224
|
-
],
|
|
225
|
-
// --- Vulnerability Specific Matching ---
|
|
226
|
-
vulnerabilities: [
|
|
227
|
-
"isVulnerabilityAlert",
|
|
228
|
-
// boolean: (Note: Likely an internal flag set by Renovate, used to *match* rules against updates that *are* vulnerability fixes, rather than being set directly by the user). Apply rule if the update addresses a known vulnerability.
|
|
229
|
-
"vulnerabilityFixVersion"
|
|
230
|
-
// string: Apply rule if the vulnerability fix is targeting this specific version.
|
|
231
|
-
],
|
|
232
|
-
vulnerabilitiesShared: [
|
|
233
|
-
"vulnerabilitySeverity"
|
|
234
|
-
// string: Minimum vulnerability severity level to report or act upon (e.g., "high", "critical").
|
|
235
|
-
]
|
|
134
|
+
//#endregion
|
|
135
|
+
//#region src/rules/filename.ts
|
|
136
|
+
const filenameRules = {
|
|
137
|
+
name: "culur/filename/rules",
|
|
138
|
+
plugins: { unicorn: eslint_plugin_unicorn.default },
|
|
139
|
+
files: [
|
|
140
|
+
"**/*.?(c|m){js,ts}?(x)",
|
|
141
|
+
"**/*.vue",
|
|
142
|
+
"**/*.md?(x)",
|
|
143
|
+
"**/*.json?(c)",
|
|
144
|
+
"**/*.y?(a)ml",
|
|
145
|
+
"**/*.gql",
|
|
146
|
+
"**/*.graphql"
|
|
147
|
+
],
|
|
148
|
+
rules: { "unicorn/filename-case": ["error", {
|
|
149
|
+
case: "kebabCase",
|
|
150
|
+
ignore: [
|
|
151
|
+
"^ADR-\\w+\\.md",
|
|
152
|
+
"^ARCHITECTURE\\.md",
|
|
153
|
+
"^CHANGELOG\\.md",
|
|
154
|
+
"^CONTRIBUTING\\.md",
|
|
155
|
+
"^README\\.md"
|
|
156
|
+
]
|
|
157
|
+
}] }
|
|
236
158
|
};
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
// string: Reference to the JSON schema for validation.
|
|
244
|
-
"extends",
|
|
245
|
-
// string[]: Specifies configuration presets to inherit from.
|
|
246
|
-
"enabled",
|
|
247
|
-
// boolean: Enables or disables Renovate for the repository or rule.
|
|
248
|
-
"enabledManagers"
|
|
249
|
-
// string[]: List of package managers to enable (e.g., ["npm", "docker"]).
|
|
250
|
-
],
|
|
251
|
-
// --- Dependency Dashboard ---
|
|
252
|
-
dependencyDashboard: [
|
|
253
|
-
"dependencyDashboardApproval"
|
|
254
|
-
// boolean: Requires manual approval via the Dependency Dashboard checkbox before a PR is created.
|
|
255
|
-
],
|
|
256
|
-
// --- Scheduling and Timezone ---
|
|
257
|
-
schedule: [
|
|
258
|
-
"schedule",
|
|
259
|
-
// string[]: Defines when Renovate should run using cron syntax or presets.
|
|
260
|
-
"timezone"
|
|
261
|
-
// string: Timezone to use for scheduling (e.g., "UTC", "America/New_York").
|
|
262
|
-
],
|
|
263
|
-
// --- Automerge ---
|
|
264
|
-
automerge: [
|
|
265
|
-
"automerge",
|
|
266
|
-
// boolean: Enables automatic merging of PRs when conditions are met.
|
|
267
|
-
"automergeType",
|
|
268
|
-
// 'pr' | 'branch-push' | 'pr-comment': Specifies the automerge mechanism. Deprecated/renamed? (Note: Not in original list, added for context, potentially maps to other settings).
|
|
269
|
-
"automergeStrategy",
|
|
270
|
-
// MergeStrategy ('auto', 'merge', 'rebase', 'squash'): The merge strategy to use for automerging.
|
|
271
|
-
"automergeSchedule",
|
|
272
|
-
// string[]: Schedules automerging attempts independently of PR updates.
|
|
273
|
-
"internalChecksAsSuccess",
|
|
274
|
-
// boolean: Considers Renovate's internal checks as successful for automerge status checks.
|
|
275
|
-
"platformAutomerge"
|
|
276
|
-
// boolean: Use the platform's native automerge feature if available. (Note: Not in original list, but common).
|
|
277
|
-
],
|
|
278
|
-
// --- Branch Management ---
|
|
279
|
-
branch: [
|
|
280
|
-
"branchPrefix",
|
|
281
|
-
// string: Prefix added to all Renovate-created branches.
|
|
282
|
-
"branchName",
|
|
283
|
-
// string: Template for naming Renovate branches.
|
|
284
|
-
"branchNameStrict",
|
|
285
|
-
// boolean: If true, enforces stricter validation for branch names.
|
|
286
|
-
"hashedBranchLength",
|
|
287
|
-
// number: Length of the hash appended to branch names when needed.
|
|
288
|
-
"pruneBranchAfterAutomerge"
|
|
289
|
-
// boolean: Automatically delete the branch after a PR is automerged.
|
|
290
|
-
// 'branchPrefixOld', // string: Potentially deprecated or for specific migration scenarios.
|
|
291
|
-
],
|
|
292
|
-
// --- Grouping Dependencies ---
|
|
293
|
-
grouping: [
|
|
294
|
-
"group",
|
|
295
|
-
// GroupConfig: More detailed configuration for grouping dependencies.
|
|
296
|
-
"groupName",
|
|
297
|
-
// string: A custom name for a group of dependencies updated together in one PR.
|
|
298
|
-
"groupSlug"
|
|
299
|
-
// string: A URL-friendly slug for the group name.
|
|
300
|
-
],
|
|
301
|
-
// --- Commit Management ---
|
|
302
|
-
commit: [
|
|
303
|
-
"semanticCommits",
|
|
304
|
-
// 'auto' | 'enabled' | 'disabled': Controls the use of semantic commit messages.
|
|
305
|
-
"semanticCommitType",
|
|
306
|
-
// string: The type used in semantic commits (e.g., "fix", "chore").
|
|
307
|
-
"semanticCommitScope",
|
|
308
|
-
// string | null: The scope used in semantic commits.
|
|
309
|
-
"commitMessagePrefix",
|
|
310
|
-
// string: Prefix added to all commit messages.
|
|
311
|
-
"commitMessage",
|
|
312
|
-
// string: Template for the commit message body.
|
|
313
|
-
"commitMessageAction",
|
|
314
|
-
// string: Action part of the commit message (e.g., "Update", "Pin").
|
|
315
|
-
"commitMessageTopic",
|
|
316
|
-
// string: Topic part of the commit message (e.g., dependency name).
|
|
317
|
-
"commitMessageExtra",
|
|
318
|
-
// string: Additional details appended to the commit message.
|
|
319
|
-
"commitMessageLowerCase",
|
|
320
|
-
// 'auto' | 'never': Controls the casing of the commit message header.
|
|
321
|
-
"platformCommit"
|
|
322
|
-
// PlatformCommitOptions: Platform-specific commit options.
|
|
323
|
-
],
|
|
324
|
-
// --- Pull Request (PR) Management ---
|
|
325
|
-
pr: [
|
|
326
|
-
"prCreation",
|
|
327
|
-
// 'immediate' | 'not-pending' | 'status-success' | 'approval': Controls when PRs are created based on checks/approvals.
|
|
328
|
-
"draftPR",
|
|
329
|
-
// boolean: Creates PRs as drafts initially.
|
|
330
|
-
"recreateClosed",
|
|
331
|
-
// boolean: Recreate PRs if they were manually closed without merging.
|
|
332
|
-
"recreateWhen",
|
|
333
|
-
// RecreateWhen: Specifies conditions under which closed PRs should be recreated.
|
|
334
|
-
"prBodyColumns",
|
|
335
|
-
// string[]: Specifies which columns to include in the PR body's dependency table.
|
|
336
|
-
"prBodyDefinitions",
|
|
337
|
-
// Record<string, string>: Custom definitions/text for sections within the PR body.
|
|
338
|
-
"prPriority",
|
|
339
|
-
// number: Sets a priority level for the PR (platform-dependent).
|
|
340
|
-
"confidential",
|
|
341
|
-
// boolean: Marks the PR as confidential (platform-dependent, e.g., GitLab).
|
|
342
|
-
"milestone"
|
|
343
|
-
// number: Assigns the PR to a specific milestone number.
|
|
344
|
-
],
|
|
345
|
-
// --- Labels ---
|
|
346
|
-
labels: [
|
|
347
|
-
"labels",
|
|
348
|
-
// string[]: List of labels to be added to created PRs.
|
|
349
|
-
"addLabels",
|
|
350
|
-
// string[]: Additional labels to add (often used in package rules).
|
|
351
|
-
"keepUpdatedLabel",
|
|
352
|
-
// string: Label indicating a PR should be kept up-to-date by Renovate, even if tests fail.
|
|
353
|
-
"rebaseLabel",
|
|
354
|
-
// string: Label that triggers Renovate to rebase the PR.
|
|
355
|
-
"stopUpdatingLabel"
|
|
356
|
-
// string: Label that tells Renovate to stop updating a specific PR.
|
|
357
|
-
],
|
|
358
|
-
// --- Dependency Filtering and Matching ---
|
|
359
|
-
filtering: [
|
|
360
|
-
"ignoreDeps",
|
|
361
|
-
// string[]: List of dependency names to ignore completely.
|
|
362
|
-
"ignorePaths",
|
|
363
|
-
// string[]: List of file paths or glob patterns to ignore during scanning.
|
|
364
|
-
"includePaths",
|
|
365
|
-
// string[]: List of file paths or glob patterns to explicitly include (if others are ignored).
|
|
366
|
-
"fileMatch",
|
|
367
|
-
// string[]: Glob patterns for matching dependency files.
|
|
368
|
-
"respectLatest",
|
|
369
|
-
// boolean: Whether to strictly respect the 'latest' tag instead of potentially newer versions.
|
|
370
|
-
"ignoreTests"
|
|
371
|
-
// boolean: Option to ignore dependencies typically found only in test/development scopes.
|
|
372
|
-
],
|
|
373
|
-
// --- Advanced / Less Common ---
|
|
374
|
-
advanced: [
|
|
375
|
-
"postUpgradeTasks",
|
|
376
|
-
// PostUpgradeTasks: Defines commands or scripts to run after dependency upgrades.
|
|
377
|
-
"npmrc",
|
|
378
|
-
// string: Allows providing custom .npmrc content for Renovate's operations.
|
|
379
|
-
"npmrcMerge",
|
|
380
|
-
// boolean: Whether to merge provided npmrc content with existing files.
|
|
381
|
-
"changelogUrl",
|
|
382
|
-
// string: A custom URL template for linking to changelogs.
|
|
383
|
-
"gitIgnoredAuthors",
|
|
384
|
-
// string[]: List of git commit authors whose commits should be ignored by Renovate (e.g., bots).
|
|
385
|
-
"unicodeEmoji",
|
|
386
|
-
// boolean: Use Unicode emojis (e.g., ✨) instead of text alternatives (e.g., :sparkles:).
|
|
387
|
-
"suppressNotifications",
|
|
388
|
-
// string[]: List of notification types to suppress.
|
|
389
|
-
"productLinks",
|
|
390
|
-
// Record<string, string>: Custom links for product documentation shown in PRs.
|
|
391
|
-
"rebaseWhen"
|
|
392
|
-
// string ('auto', 'behind-base-branch', 'conflicted', 'never'): Conditions under which Renovate should rebase PRs.
|
|
393
|
-
// 'manager', // string: Usually context-specific, identifies the package manager being used.
|
|
394
|
-
// 'repository', // string: Usually context-specific, the name of the repository.
|
|
395
|
-
// 'repositoryCache', // RepositoryCacheConfig: Configuration for caching repository data.
|
|
396
|
-
// 'repositoryCacheType', // RepositoryCacheType: Type of repository cache ('local', 'shared', etc.).
|
|
397
|
-
// 'autoReplaceGlobalMatch',// boolean: Advanced feature related to global replacements (less common).
|
|
398
|
-
// 'force', // RenovateConfig: Allows forcing specific configurations, overriding others (use with caution).
|
|
399
|
-
]
|
|
159
|
+
//#endregion
|
|
160
|
+
//#region src/rules/yaml-order.ts
|
|
161
|
+
const yamlOrder = {
|
|
162
|
+
type: "asc",
|
|
163
|
+
caseSensitive: false,
|
|
164
|
+
natural: true
|
|
400
165
|
};
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
166
|
+
//#endregion
|
|
167
|
+
//#region src/rules/pnpm-workspace-yaml.ts
|
|
168
|
+
const pnpmWorkspaceSortKeys = {
|
|
169
|
+
root: {
|
|
170
|
+
pathPattern: /^$/.source,
|
|
171
|
+
order: [
|
|
172
|
+
"packages",
|
|
173
|
+
"catalog",
|
|
174
|
+
"overrides",
|
|
175
|
+
"packageExtensions",
|
|
176
|
+
"allowedDeprecatedVersions",
|
|
177
|
+
"updateConfig",
|
|
178
|
+
"supportedArchitectures",
|
|
179
|
+
"ignoredOptionalDependencies",
|
|
180
|
+
"minimumReleaseAge",
|
|
181
|
+
"minimumReleaseAgeExclude",
|
|
182
|
+
"minimumReleaseAgeIgnoreMissingTime",
|
|
183
|
+
"minimumReleaseAgeStrict",
|
|
184
|
+
"trustPolicy",
|
|
185
|
+
"trustPolicyExclude",
|
|
186
|
+
"trustPolicyIgnoreAfter",
|
|
187
|
+
"trustLockfile",
|
|
188
|
+
"blockExoticSubdeps",
|
|
189
|
+
"registries",
|
|
190
|
+
"namedRegistries",
|
|
191
|
+
"hoist",
|
|
192
|
+
"hoistWorkspacePackages",
|
|
193
|
+
"hoistPattern",
|
|
194
|
+
"publicHoistPattern",
|
|
195
|
+
"shamefullyHoist",
|
|
196
|
+
"modulesDir",
|
|
197
|
+
"nodeLinker",
|
|
198
|
+
"symlink",
|
|
199
|
+
"enableModulesDir",
|
|
200
|
+
"virtualStoreDir",
|
|
201
|
+
"virtualStoreDirMaxLength",
|
|
202
|
+
"virtualStoreOnly",
|
|
203
|
+
"packageImportMethod",
|
|
204
|
+
"modulesCacheMaxAge",
|
|
205
|
+
"dlxCacheMaxAge",
|
|
206
|
+
"enableGlobalVirtualStore",
|
|
207
|
+
"storeDir",
|
|
208
|
+
"verifyStoreIntegrity",
|
|
209
|
+
"useRunningStoreServer",
|
|
210
|
+
"strictStorePkgContentCheck",
|
|
211
|
+
"httpsProxy",
|
|
212
|
+
"httpProxy",
|
|
213
|
+
"noProxy",
|
|
214
|
+
"localAddress",
|
|
215
|
+
"maxsockets",
|
|
216
|
+
"strictSsl",
|
|
217
|
+
"lockfile",
|
|
218
|
+
"preferFrozenLockfile",
|
|
219
|
+
"lockfileIncludeTarballUrl",
|
|
220
|
+
"gitBranchLockfile",
|
|
221
|
+
"mergeGitBranchLockfilesBranchPattern",
|
|
222
|
+
"peersSuffixMaxLength",
|
|
223
|
+
"gitShallowHosts",
|
|
224
|
+
"networkConcurrency",
|
|
225
|
+
"fetchRetries",
|
|
226
|
+
"fetchRetryFactor",
|
|
227
|
+
"fetchRetryMintimeout",
|
|
228
|
+
"fetchRetryMaxtimeout",
|
|
229
|
+
"fetchTimeout",
|
|
230
|
+
"fetchWarnTimeoutMs",
|
|
231
|
+
"fetchMinSpeedKiBps",
|
|
232
|
+
"autoInstallPeers",
|
|
233
|
+
"dedupePeerDependents",
|
|
234
|
+
"dedupePeers",
|
|
235
|
+
"strictPeerDependencies",
|
|
236
|
+
"resolvePeersFromWorkspaceRoot",
|
|
237
|
+
"peerDependencyRules",
|
|
238
|
+
"[no-]color",
|
|
239
|
+
"loglevel",
|
|
240
|
+
"useBetaCli",
|
|
241
|
+
"recursiveInstall",
|
|
242
|
+
"engineStrict",
|
|
243
|
+
"npmPath",
|
|
244
|
+
"pmOnFail",
|
|
245
|
+
"ignoreWorkspaceRootCheck",
|
|
246
|
+
"ignoreScripts",
|
|
247
|
+
"childConcurrency",
|
|
248
|
+
"sideEffectsCache",
|
|
249
|
+
"sideEffectsCacheReadonly",
|
|
250
|
+
"unsafePerm",
|
|
251
|
+
"nodeOptions",
|
|
252
|
+
"verifyDepsBeforeRun",
|
|
253
|
+
"strictDepBuilds",
|
|
254
|
+
"allowBuilds",
|
|
255
|
+
"dangerouslyAllowAllBuilds",
|
|
256
|
+
"nodeVersion",
|
|
257
|
+
"runtimeOnFail",
|
|
258
|
+
"nodeDownloadMirrors",
|
|
259
|
+
"savePrefix",
|
|
260
|
+
"tag",
|
|
261
|
+
"globalDir",
|
|
262
|
+
"globalBinDir",
|
|
263
|
+
"npmrcAuthFile",
|
|
264
|
+
"stateDir",
|
|
265
|
+
"cacheDir",
|
|
266
|
+
"useStderr",
|
|
267
|
+
"updateNotifier",
|
|
268
|
+
"preferSymlinkedExecutables",
|
|
269
|
+
"ignoreCompatibilityDb",
|
|
270
|
+
"resolutionMode",
|
|
271
|
+
"registrySupportsTimeField",
|
|
272
|
+
"extendNodePath",
|
|
273
|
+
"deployAllFiles",
|
|
274
|
+
"dedupeDirectDeps",
|
|
275
|
+
"optimisticRepeatInstall",
|
|
276
|
+
"requiredScripts",
|
|
277
|
+
"enablePrePostScripts",
|
|
278
|
+
"scriptShell",
|
|
279
|
+
"shellEmulator",
|
|
280
|
+
"catalogMode",
|
|
281
|
+
"ci",
|
|
282
|
+
"cleanupUnusedCatalogs"
|
|
283
|
+
]
|
|
284
|
+
},
|
|
285
|
+
packages: {
|
|
286
|
+
pathPattern: `^(${[
|
|
287
|
+
"overrides",
|
|
288
|
+
"packageExtensions",
|
|
289
|
+
"allowedDeprecatedVersions",
|
|
290
|
+
"updateConfig",
|
|
291
|
+
"supportedArchitectures",
|
|
292
|
+
"registries",
|
|
293
|
+
"namedRegistries"
|
|
294
|
+
].join("|")})$`,
|
|
295
|
+
order: yamlOrder
|
|
296
|
+
}
|
|
442
297
|
};
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
...updateConfig.special_cases
|
|
476
|
-
];
|
|
477
|
-
|
|
478
|
-
// src/rules/renovate-json/base/assignees-and-reviewers-config.ts
|
|
479
|
-
var assigneesAndReviewersConfig = {
|
|
480
|
-
// --- Assignees ---
|
|
481
|
-
assignees: [
|
|
482
|
-
"assignees",
|
|
483
|
-
// string[]: Explicit list of usernames to assign to the PR.
|
|
484
|
-
"assigneesFromCodeOwners",
|
|
485
|
-
// boolean: Assign users listed as owners in the CODEOWNERS file.
|
|
486
|
-
"assigneesSampleSize"
|
|
487
|
-
// number: Select a random sample of this size from the potential assignees (either from `assignees` list or CODEOWNERS). [1]
|
|
488
|
-
],
|
|
489
|
-
// --- Reviewers ---
|
|
490
|
-
reviewers: [
|
|
491
|
-
"reviewers",
|
|
492
|
-
// string[]: Explicit list of usernames to request reviews from.
|
|
493
|
-
"reviewersFromCodeOwners",
|
|
494
|
-
// boolean: Request reviews from users listed as owners in the CODEOWNERS file.
|
|
495
|
-
"reviewersSampleSize",
|
|
496
|
-
// number: Select a random sample of this size from the potential reviewers (either from `reviewers` list or CODEOWNERS).
|
|
497
|
-
"additionalReviewers",
|
|
498
|
-
// string[]: Add these users as reviewers *in addition* to any specified in `reviewers` or derived from CODEOWNERS. Useful for adding specific reviewers in package rules without overriding the base list. [14]
|
|
499
|
-
"ignoreReviewers"
|
|
500
|
-
// string[]: List of usernames that should *not* be added as reviewers, even if they are in the `reviewers` list or CODEOWNERS. Useful for filtering out bots or users on leave. [2]
|
|
501
|
-
],
|
|
502
|
-
// --- Common / Helper Options ---
|
|
503
|
-
common: [
|
|
504
|
-
"expandCodeOwnersGroups",
|
|
505
|
-
// boolean: If true, Renovate expands CODEOWNERS groups (like `@org/team`) into individual members before applying logic like `reviewersSampleSize`. Supported on GitLab [3, 4, 6] and potentially other platforms supporting group expansion [1].
|
|
506
|
-
"filterUnavailableUsers"
|
|
507
|
-
// boolean: (Note: Supported on GitLab [3, 5]) Check if assigned/requested users are actually available/have access on the platform before adding them. [3, 5, 8, 12, 13] Prevents errors if a listed user doesn't exist or can't access the repository.
|
|
508
|
-
// 'assignAutomerge', // boolean: (Note: From [14], likely deprecated or less common) Assign reviewers/assignees even if automerge is enabled. Default Renovate behavior is *not* to add assignees/reviewers if automerge is set, to reduce noise, unless the PR fails checks. [2, 7]
|
|
509
|
-
]
|
|
298
|
+
//! Monorepo
|
|
299
|
+
//! Dependency Resolution
|
|
300
|
+
//! Dependency Hoisting Settings
|
|
301
|
+
//! Node-Modules Settings
|
|
302
|
+
//! Store Settings
|
|
303
|
+
//! Network Settings
|
|
304
|
+
//! Lockfile Settings
|
|
305
|
+
//! Request Settings
|
|
306
|
+
//! Peer Dependency Settings
|
|
307
|
+
//! CLI Settings
|
|
308
|
+
//! Build Settings
|
|
309
|
+
//! Node.js Settings
|
|
310
|
+
//! Other Settings
|
|
311
|
+
const pnpmWorkspaceSortSequenceValues = { packages: {
|
|
312
|
+
pathPattern: `^(${[
|
|
313
|
+
"ignoredOptionalDependencies",
|
|
314
|
+
"minimumReleaseAgeExclude",
|
|
315
|
+
"trustPolicyExclude"
|
|
316
|
+
].join("|")})$`,
|
|
317
|
+
order: yamlOrder
|
|
318
|
+
} };
|
|
319
|
+
const pnpmWorkspaceYamlRules = {
|
|
320
|
+
name: "culur/pnpm-workspace-yaml/rules",
|
|
321
|
+
files: ["pnpm-workspace.yaml"],
|
|
322
|
+
rules: {
|
|
323
|
+
"yaml/sort-keys": [
|
|
324
|
+
"error",
|
|
325
|
+
pnpmWorkspaceSortKeys.root,
|
|
326
|
+
pnpmWorkspaceSortKeys.packages
|
|
327
|
+
],
|
|
328
|
+
"yaml/sort-sequence-values": ["error", pnpmWorkspaceSortSequenceValues.packages]
|
|
329
|
+
}
|
|
510
330
|
};
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
"onboardingNoDeps"
|
|
539
|
-
// 'auto' | 'enabled' | 'disabled': Controls whether the onboarding PR should include initial dependency updates or just the configuration file. 'auto' usually means include updates if few dependencies exist.
|
|
540
|
-
],
|
|
541
|
-
// --- Configuration Requirements ---
|
|
542
|
-
// Defines requirements for the Renovate configuration itself.
|
|
543
|
-
configurationRequirements: [
|
|
544
|
-
"requireConfig"
|
|
545
|
-
// RequiredConfig ('required', 'optional', 'ignored'): Specifies whether a Renovate configuration file (`renovate.json`, etc.) is mandatory for Renovate to run on the repository. 'ignored' might be used in centrally managed setups.
|
|
546
|
-
],
|
|
547
|
-
// --- Execution Environment & Logging (Legacy/Admin) ---
|
|
548
|
-
// These settings are often more relevant for self-hosted Renovate instances or specific admin controls.
|
|
549
|
-
executionLogging: [
|
|
550
|
-
"localDir",
|
|
551
|
-
// string: Specifies a local directory path, potentially used for caching or temporary files in self-hosted environments. (Note: Less common in typical SaaS usage).
|
|
552
|
-
"logContext"
|
|
553
|
-
// string: Adds a custom string/context to log messages, helpful for identifying logs from specific Renovate instances or runs.
|
|
554
|
-
]
|
|
331
|
+
//#endregion
|
|
332
|
+
//#region src/rules/renovate-json/base/package-rule.ts
|
|
333
|
+
const packageRule = {
|
|
334
|
+
metadata: ["description"],
|
|
335
|
+
rangeStrategy: ["rangeStrategy"],
|
|
336
|
+
matching: [
|
|
337
|
+
"matchPackageNames",
|
|
338
|
+
"matchDepNames",
|
|
339
|
+
"matchManagers",
|
|
340
|
+
"matchDatasources",
|
|
341
|
+
"matchDepTypes",
|
|
342
|
+
"matchUpdateTypes",
|
|
343
|
+
"matchCategories",
|
|
344
|
+
"matchCurrentVersion",
|
|
345
|
+
"matchSourceUrls",
|
|
346
|
+
"matchFileNames",
|
|
347
|
+
"matchBaseBranches",
|
|
348
|
+
"matchRepositories",
|
|
349
|
+
"matchCurrentValue",
|
|
350
|
+
"matchNewValue",
|
|
351
|
+
"matchCurrentAge",
|
|
352
|
+
"matchConfidence",
|
|
353
|
+
"matchJsonata"
|
|
354
|
+
],
|
|
355
|
+
registriesNetwork: ["registryUrls"],
|
|
356
|
+
vulnerabilities: ["isVulnerabilityAlert", "vulnerabilityFixVersion"],
|
|
357
|
+
vulnerabilitiesShared: ["vulnerabilitySeverity"]
|
|
555
358
|
};
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
"s3PathStyle"
|
|
637
|
-
// boolean: Use path-style access for S3 instead of virtual-hosted style.
|
|
638
|
-
],
|
|
639
|
-
// --- Vulnerability Management ---
|
|
640
|
-
vulnerabilities: [
|
|
641
|
-
"vulnerabilityAlerts",
|
|
642
|
-
// RenovateSharedConfig: Configuration specific to how vulnerability updates are handled (can inherit shared config structure).
|
|
643
|
-
"osvVulnerabilityAlerts"
|
|
644
|
-
// boolean: Specifically enables checking for vulnerabilities using the OSV database.
|
|
645
|
-
],
|
|
646
|
-
vulnerabilitiesShared: [
|
|
647
|
-
"vulnerabilitySeverity"
|
|
648
|
-
// string: Minimum vulnerability severity level to report or act upon (e.g., "high", "critical").
|
|
649
|
-
],
|
|
650
|
-
// --- Customization & Extensibility ---
|
|
651
|
-
customization: [
|
|
652
|
-
"customManagers",
|
|
653
|
-
// CustomManager[]: Definitions for custom package managers not built into Renovate.
|
|
654
|
-
"customDatasources",
|
|
655
|
-
// Record<string, CustomDatasourceConfig>: Definitions for custom datasources to find package versions.
|
|
656
|
-
"secrets",
|
|
657
|
-
// Record<string, string>: A key-value store for secrets needed during Renovate runs (e.g., tokens accessed via `process.env`). (Note: For securely passing sensitive data).
|
|
658
|
-
"env"
|
|
659
|
-
// UserEnv: User-defined environment variables to be set when Renovate executes package manager commands.
|
|
660
|
-
],
|
|
661
|
-
// --- Reporting ---
|
|
662
|
-
reporting: [
|
|
663
|
-
"reportPath",
|
|
664
|
-
// string: Path (for file type) or bucket/key (for S3 type) for saving run reports.
|
|
665
|
-
"reportType"
|
|
666
|
-
// 'logging' | 'file' | 's3' | null: How and where to generate reports about Renovate runs.
|
|
667
|
-
],
|
|
668
|
-
// --- Configuration Inheritance ---
|
|
669
|
-
inheritance: [
|
|
670
|
-
"inheritConfig",
|
|
671
|
-
// boolean: Whether to inherit configuration from a shared repository (defaults to true for Renovate App/Enterprise).
|
|
672
|
-
"inheritConfigFileName",
|
|
673
|
-
// string: Custom filename for the shared configuration file in the inheritance repository.
|
|
674
|
-
"inheritConfigRepoName",
|
|
675
|
-
// string: Specify the repository from which to inherit configuration.
|
|
676
|
-
"inheritConfigStrict",
|
|
677
|
-
// boolean: If true, errors during config inheritance will stop the Renovate run.
|
|
678
|
-
"ignorePresets",
|
|
679
|
-
// string[]: List of preset configurations (from `extends`) to ignore.
|
|
680
|
-
"force"
|
|
681
|
-
// RenovateConfig: A nested configuration object used for forcing specific settings (often via CLI).
|
|
682
|
-
],
|
|
683
|
-
// --- Process Control & Execution ---
|
|
684
|
-
processControl: [
|
|
685
|
-
"skipInstalls",
|
|
686
|
-
// boolean | null: Skip package manager install/build steps (use with caution, may break updates).
|
|
687
|
-
"updateInternalDeps",
|
|
688
|
-
// boolean: Whether to update dependencies that point to other modules within the same monorepo.
|
|
689
|
-
"cloneSubmodulesFilter",
|
|
690
|
-
// string[]: Filters to apply when deciding which submodules to clone.
|
|
691
|
-
"fetchChangeLogs",
|
|
692
|
-
// FetchChangeLogsOptions: Options controlling if and how changelogs are fetched.
|
|
693
|
-
"logLevelRemap",
|
|
694
|
-
// LogLevelRemap[]: Rules to remap log levels from specific modules or contexts.
|
|
695
|
-
"statusCheckNames",
|
|
696
|
-
// Record<StatusCheckKey, string | null>: Override the names of status checks Renovate looks for or reports.
|
|
697
|
-
"configWarningReuseIssue",
|
|
698
|
-
// boolean: If true, configuration warnings will be posted as comments on a single, reused issue instead of creating new ones.
|
|
699
|
-
"postUpdateOptions"
|
|
700
|
-
// string[]: Options passed to post-update scripts or hooks. (Note: Related to `postUpgradeTasks` in SharedConfig, perhaps providing context/flags).
|
|
701
|
-
],
|
|
702
|
-
// --- Constraints ---
|
|
703
|
-
constraints: [
|
|
704
|
-
"constraints",
|
|
705
|
-
// Record<string, string>: Define version constraints for dependencies (e.g., force a specific version range globally).
|
|
706
|
-
"constraintsFiltering"
|
|
707
|
-
// ConstraintsFilter: Control how constraints are applied ('none', 'strict', 'loose').
|
|
708
|
-
],
|
|
709
|
-
// --- Internal State / Contextual (Likely not configured directly in main config) ---
|
|
710
|
-
internalContext: [
|
|
711
|
-
"depName",
|
|
712
|
-
// string: The name of the specific dependency being processed in a rule context.
|
|
713
|
-
"baseBranch",
|
|
714
|
-
// string: The specific base branch being processed in the current run.
|
|
715
|
-
"branchList",
|
|
716
|
-
// string[]: List of branches detected in the repository.
|
|
717
|
-
"errors",
|
|
718
|
-
// ValidationMessage[]: Collection of configuration errors found during parsing.
|
|
719
|
-
"fileList",
|
|
720
|
-
// string[]: List of files relevant to the current operation.
|
|
721
|
-
"packageFile",
|
|
722
|
-
// string: The specific package file being processed.
|
|
723
|
-
"repoIsOnboarded",
|
|
724
|
-
// boolean: Flag indicating if the repository onboarding process is complete.
|
|
725
|
-
"repoIsActivated",
|
|
726
|
-
// boolean: Flag indicating if Renovate is activated for the repository.
|
|
727
|
-
"warnings",
|
|
728
|
-
// ValidationMessage[]: Collection of configuration warnings found during parsing.
|
|
729
|
-
"checkedBranches",
|
|
730
|
-
// string[]: List of branches that have already been processed in the current run.
|
|
731
|
-
"sharedVariableName"
|
|
732
|
-
// string: Name of a variable used for sharing data between runs or stages. (Note: Advanced/internal usage).
|
|
733
|
-
],
|
|
734
|
-
// --- PackageRules ---
|
|
735
|
-
packageRules: [
|
|
736
|
-
"packageRules"
|
|
737
|
-
// PackageRule[]: The core mechanism for customizing Renovate's behavior for specific dependencies or groups.
|
|
738
|
-
]
|
|
359
|
+
//#endregion
|
|
360
|
+
//#region src/rules/renovate-json/base/renovate-shared-config.ts
|
|
361
|
+
const renovateSharedConfig = {
|
|
362
|
+
config: [
|
|
363
|
+
"$schema",
|
|
364
|
+
"extends",
|
|
365
|
+
"enabled",
|
|
366
|
+
"enabledManagers"
|
|
367
|
+
],
|
|
368
|
+
dependencyDashboard: ["dependencyDashboardApproval"],
|
|
369
|
+
schedule: ["schedule", "timezone"],
|
|
370
|
+
automerge: [
|
|
371
|
+
"automerge",
|
|
372
|
+
"automergeType",
|
|
373
|
+
"automergeStrategy",
|
|
374
|
+
"automergeSchedule",
|
|
375
|
+
"internalChecksAsSuccess",
|
|
376
|
+
"platformAutomerge"
|
|
377
|
+
],
|
|
378
|
+
branch: [
|
|
379
|
+
"branchPrefix",
|
|
380
|
+
"branchName",
|
|
381
|
+
"branchNameStrict",
|
|
382
|
+
"hashedBranchLength",
|
|
383
|
+
"pruneBranchAfterAutomerge"
|
|
384
|
+
],
|
|
385
|
+
grouping: [
|
|
386
|
+
"group",
|
|
387
|
+
"groupName",
|
|
388
|
+
"groupSlug"
|
|
389
|
+
],
|
|
390
|
+
commit: [
|
|
391
|
+
"semanticCommits",
|
|
392
|
+
"semanticCommitType",
|
|
393
|
+
"semanticCommitScope",
|
|
394
|
+
"commitMessagePrefix",
|
|
395
|
+
"commitMessage",
|
|
396
|
+
"commitMessageAction",
|
|
397
|
+
"commitMessageTopic",
|
|
398
|
+
"commitMessageExtra",
|
|
399
|
+
"commitMessageLowerCase",
|
|
400
|
+
"platformCommit"
|
|
401
|
+
],
|
|
402
|
+
pr: [
|
|
403
|
+
"prCreation",
|
|
404
|
+
"draftPR",
|
|
405
|
+
"recreateClosed",
|
|
406
|
+
"recreateWhen",
|
|
407
|
+
"prBodyColumns",
|
|
408
|
+
"prBodyDefinitions",
|
|
409
|
+
"prPriority",
|
|
410
|
+
"confidential",
|
|
411
|
+
"milestone"
|
|
412
|
+
],
|
|
413
|
+
labels: [
|
|
414
|
+
"labels",
|
|
415
|
+
"addLabels",
|
|
416
|
+
"keepUpdatedLabel",
|
|
417
|
+
"rebaseLabel",
|
|
418
|
+
"stopUpdatingLabel"
|
|
419
|
+
],
|
|
420
|
+
filtering: [
|
|
421
|
+
"ignoreDeps",
|
|
422
|
+
"ignorePaths",
|
|
423
|
+
"includePaths",
|
|
424
|
+
"fileMatch",
|
|
425
|
+
"respectLatest",
|
|
426
|
+
"ignoreTests"
|
|
427
|
+
],
|
|
428
|
+
advanced: [
|
|
429
|
+
"postUpgradeTasks",
|
|
430
|
+
"npmrc",
|
|
431
|
+
"npmrcMerge",
|
|
432
|
+
"changelogUrl",
|
|
433
|
+
"gitIgnoredAuthors",
|
|
434
|
+
"unicodeEmoji",
|
|
435
|
+
"suppressNotifications",
|
|
436
|
+
"productLinks",
|
|
437
|
+
"rebaseWhen"
|
|
438
|
+
]
|
|
739
439
|
};
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
...renovateSharedConfig.commit,
|
|
760
|
-
...renovateSharedConfig.pr,
|
|
761
|
-
...renovateSharedConfig.labels,
|
|
762
|
-
...renovateSharedConfig.filtering,
|
|
763
|
-
...renovateConfig.namingSpecifics,
|
|
764
|
-
...assigneesAndReviewersConfig.assignees,
|
|
765
|
-
...assigneesAndReviewersConfig.reviewers,
|
|
766
|
-
...assigneesAndReviewersConfig.common,
|
|
767
|
-
//? registriesNetwork
|
|
768
|
-
...renovateConfig.registriesNetwork,
|
|
769
|
-
//? vulnerabilities
|
|
770
|
-
...renovateConfig.vulnerabilities,
|
|
771
|
-
...renovateConfig.vulnerabilitiesShared,
|
|
772
|
-
//? rarely
|
|
773
|
-
...renovateSharedConfig.advanced,
|
|
774
|
-
...renovateConfig.customization,
|
|
775
|
-
...renovateConfig.reporting,
|
|
776
|
-
...renovateConfig.inheritance,
|
|
777
|
-
...renovateConfig.processControl,
|
|
778
|
-
...renovateConfig.constraints,
|
|
779
|
-
...renovateConfig.internalContext,
|
|
780
|
-
...legacyAdminConfig.onboarding,
|
|
781
|
-
...legacyAdminConfig.executionLogging,
|
|
782
|
-
...legacyAdminConfig.configurationRequirements,
|
|
783
|
-
//? overrides
|
|
784
|
-
...updateConfig.semantic_versioning,
|
|
785
|
-
...updateConfig.pinning_digests,
|
|
786
|
-
...updateConfig.lock_file,
|
|
787
|
-
...updateConfig.special_cases,
|
|
788
|
-
...renovateConfig.packageRules
|
|
789
|
-
];
|
|
790
|
-
|
|
791
|
-
// src/rules/renovate-json/index.ts
|
|
792
|
-
var renovateJsonRules = {
|
|
793
|
-
name: "culur/renovate-json/rules",
|
|
794
|
-
files: [
|
|
795
|
-
// https://docs.renovatebot.com/configuration-options/#configuration-options
|
|
796
|
-
"renovate.json",
|
|
797
|
-
"renovate.json5",
|
|
798
|
-
".github/renovate.json",
|
|
799
|
-
".github/renovate.json5",
|
|
800
|
-
".gitlab/renovate.json",
|
|
801
|
-
".gitlab/renovate.json5",
|
|
802
|
-
".renovaterc",
|
|
803
|
-
".renovaterc.json",
|
|
804
|
-
".renovaterc.json5"
|
|
805
|
-
],
|
|
806
|
-
rules: {
|
|
807
|
-
"jsonc/sort-keys": [
|
|
808
|
-
"error",
|
|
809
|
-
{
|
|
810
|
-
pathPattern: "^$",
|
|
811
|
-
order: rootOrder
|
|
812
|
-
},
|
|
813
|
-
{
|
|
814
|
-
pathPattern: "^packageRules\\[\\d+\\]$",
|
|
815
|
-
order: packageRuleOrder
|
|
816
|
-
}
|
|
817
|
-
]
|
|
818
|
-
}
|
|
440
|
+
//#endregion
|
|
441
|
+
//#region src/rules/renovate-json/base/update-config.ts
|
|
442
|
+
const updateConfig = {
|
|
443
|
+
semantic_versioning: [
|
|
444
|
+
"major",
|
|
445
|
+
"minor",
|
|
446
|
+
"patch"
|
|
447
|
+
],
|
|
448
|
+
pinning_digests: [
|
|
449
|
+
"pin",
|
|
450
|
+
"digest",
|
|
451
|
+
"pinDigest"
|
|
452
|
+
],
|
|
453
|
+
lock_file: ["lockFileMaintenance", "lockfileUpdate"],
|
|
454
|
+
special_cases: [
|
|
455
|
+
"rollback",
|
|
456
|
+
"bump",
|
|
457
|
+
"replacement"
|
|
458
|
+
]
|
|
819
459
|
};
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
460
|
+
//#endregion
|
|
461
|
+
//#region src/rules/renovate-json/order/package-rule.ts
|
|
462
|
+
const packageRuleOrder = [
|
|
463
|
+
...packageRule.metadata,
|
|
464
|
+
...renovateSharedConfig.config,
|
|
465
|
+
...renovateSharedConfig.branch,
|
|
466
|
+
...renovateSharedConfig.dependencyDashboard,
|
|
467
|
+
...renovateSharedConfig.schedule,
|
|
468
|
+
...renovateSharedConfig.automerge,
|
|
469
|
+
...renovateSharedConfig.grouping,
|
|
470
|
+
...renovateSharedConfig.commit,
|
|
471
|
+
...renovateSharedConfig.pr,
|
|
472
|
+
...renovateSharedConfig.labels,
|
|
473
|
+
...renovateSharedConfig.filtering,
|
|
474
|
+
...packageRule.rangeStrategy,
|
|
475
|
+
...packageRule.matching,
|
|
476
|
+
...packageRule.registriesNetwork,
|
|
477
|
+
...packageRule.vulnerabilities,
|
|
478
|
+
...packageRule.vulnerabilitiesShared,
|
|
479
|
+
...renovateSharedConfig.advanced,
|
|
480
|
+
...updateConfig.semantic_versioning,
|
|
481
|
+
...updateConfig.pinning_digests,
|
|
482
|
+
...updateConfig.lock_file,
|
|
483
|
+
...updateConfig.special_cases
|
|
484
|
+
];
|
|
485
|
+
//#endregion
|
|
486
|
+
//#region src/rules/renovate-json/base/assignees-and-reviewers-config.ts
|
|
487
|
+
const assigneesAndReviewersConfig = {
|
|
488
|
+
assignees: [
|
|
489
|
+
"assignees",
|
|
490
|
+
"assigneesFromCodeOwners",
|
|
491
|
+
"assigneesSampleSize"
|
|
492
|
+
],
|
|
493
|
+
reviewers: [
|
|
494
|
+
"reviewers",
|
|
495
|
+
"reviewersFromCodeOwners",
|
|
496
|
+
"reviewersSampleSize",
|
|
497
|
+
"additionalReviewers",
|
|
498
|
+
"ignoreReviewers"
|
|
499
|
+
],
|
|
500
|
+
common: ["expandCodeOwnersGroups", "filterUnavailableUsers"]
|
|
826
501
|
};
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
502
|
+
//#endregion
|
|
503
|
+
//#region src/rules/renovate-json/base/config-migration.ts
|
|
504
|
+
const configMigration = ["configMigration"];
|
|
505
|
+
//#endregion
|
|
506
|
+
//#region src/rules/renovate-json/base/legacy-admin-config.ts
|
|
507
|
+
const legacyAdminConfig = {
|
|
508
|
+
onboarding: [
|
|
509
|
+
"onboarding",
|
|
510
|
+
"onboardingBranch",
|
|
511
|
+
"onboardingCommitMessage",
|
|
512
|
+
"onboardingPrTitle",
|
|
513
|
+
"onboardingConfig",
|
|
514
|
+
"onboardingConfigFileName",
|
|
515
|
+
"onboardingRebaseCheckbox",
|
|
516
|
+
"onboardingNoDeps"
|
|
517
|
+
],
|
|
518
|
+
configurationRequirements: ["requireConfig"],
|
|
519
|
+
executionLogging: ["localDir", "logContext"]
|
|
844
520
|
};
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
521
|
+
//#endregion
|
|
522
|
+
//#region src/rules/renovate-json/base/renovate-config.ts
|
|
523
|
+
const renovateConfig = {
|
|
524
|
+
metadata: ["description"],
|
|
525
|
+
repository: [
|
|
526
|
+
"baseBranches",
|
|
527
|
+
"defaultBranch",
|
|
528
|
+
"useBaseBranchConfig",
|
|
529
|
+
"gitAuthor"
|
|
530
|
+
],
|
|
531
|
+
forkHandling: [
|
|
532
|
+
"forkProcessing",
|
|
533
|
+
"isFork",
|
|
534
|
+
"forkModeDisallowMaintainerEdits"
|
|
535
|
+
],
|
|
536
|
+
dependencyDashboard: [
|
|
537
|
+
"dependencyDashboard",
|
|
538
|
+
"dependencyDashboardTitle",
|
|
539
|
+
"dependencyDashboardHeader",
|
|
540
|
+
"dependencyDashboardFooter",
|
|
541
|
+
"dependencyDashboardLabels",
|
|
542
|
+
"dependencyDashboardChecks",
|
|
543
|
+
"dependencyDashboardAutoclose",
|
|
544
|
+
"dependencyDashboardOSVVulnerabilitySummary",
|
|
545
|
+
"customizeDashboard"
|
|
546
|
+
],
|
|
547
|
+
limits: [
|
|
548
|
+
"branchConcurrentLimit",
|
|
549
|
+
"prConcurrentLimit",
|
|
550
|
+
"prHourlyLimit"
|
|
551
|
+
],
|
|
552
|
+
namingSpecifics: [
|
|
553
|
+
"branchTopic",
|
|
554
|
+
"additionalBranchPrefix",
|
|
555
|
+
"commitBody"
|
|
556
|
+
],
|
|
557
|
+
registriesNetwork: [
|
|
558
|
+
"hostRules",
|
|
559
|
+
"defaultRegistryUrls",
|
|
560
|
+
"registryUrls",
|
|
561
|
+
"registryAliases",
|
|
562
|
+
"s3Endpoint",
|
|
563
|
+
"s3PathStyle"
|
|
564
|
+
],
|
|
565
|
+
vulnerabilities: ["vulnerabilityAlerts", "osvVulnerabilityAlerts"],
|
|
566
|
+
vulnerabilitiesShared: ["vulnerabilitySeverity"],
|
|
567
|
+
customization: [
|
|
568
|
+
"customManagers",
|
|
569
|
+
"customDatasources",
|
|
570
|
+
"secrets",
|
|
571
|
+
"env"
|
|
572
|
+
],
|
|
573
|
+
reporting: ["reportPath", "reportType"],
|
|
574
|
+
inheritance: [
|
|
575
|
+
"inheritConfig",
|
|
576
|
+
"inheritConfigFileName",
|
|
577
|
+
"inheritConfigRepoName",
|
|
578
|
+
"inheritConfigStrict",
|
|
579
|
+
"ignorePresets",
|
|
580
|
+
"force"
|
|
581
|
+
],
|
|
582
|
+
processControl: [
|
|
583
|
+
"skipInstalls",
|
|
584
|
+
"updateInternalDeps",
|
|
585
|
+
"cloneSubmodulesFilter",
|
|
586
|
+
"fetchChangeLogs",
|
|
587
|
+
"logLevelRemap",
|
|
588
|
+
"statusCheckNames",
|
|
589
|
+
"configWarningReuseIssue",
|
|
590
|
+
"postUpdateOptions"
|
|
591
|
+
],
|
|
592
|
+
constraints: ["constraints", "constraintsFiltering"],
|
|
593
|
+
internalContext: [
|
|
594
|
+
"depName",
|
|
595
|
+
"baseBranch",
|
|
596
|
+
"branchList",
|
|
597
|
+
"errors",
|
|
598
|
+
"fileList",
|
|
599
|
+
"packageFile",
|
|
600
|
+
"repoIsOnboarded",
|
|
601
|
+
"repoIsActivated",
|
|
602
|
+
"warnings",
|
|
603
|
+
"checkedBranches",
|
|
604
|
+
"sharedVariableName"
|
|
605
|
+
],
|
|
606
|
+
packageRules: ["packageRules"]
|
|
856
607
|
};
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
608
|
+
//#endregion
|
|
609
|
+
//#region src/rules/renovate-json/order/root.ts
|
|
610
|
+
const rootOrder = [
|
|
611
|
+
...renovateSharedConfig.config,
|
|
612
|
+
...renovateConfig.metadata,
|
|
613
|
+
...renovateConfig.repository,
|
|
614
|
+
...renovateConfig.forkHandling,
|
|
615
|
+
...renovateSharedConfig.branch,
|
|
616
|
+
...configMigration,
|
|
617
|
+
...renovateConfig.dependencyDashboard,
|
|
618
|
+
...renovateSharedConfig.dependencyDashboard,
|
|
619
|
+
...renovateSharedConfig.schedule,
|
|
620
|
+
...renovateSharedConfig.automerge,
|
|
621
|
+
...renovateConfig.limits,
|
|
622
|
+
...renovateSharedConfig.grouping,
|
|
623
|
+
...renovateSharedConfig.commit,
|
|
624
|
+
...renovateSharedConfig.pr,
|
|
625
|
+
...renovateSharedConfig.labels,
|
|
626
|
+
...renovateSharedConfig.filtering,
|
|
627
|
+
...renovateConfig.namingSpecifics,
|
|
628
|
+
...assigneesAndReviewersConfig.assignees,
|
|
629
|
+
...assigneesAndReviewersConfig.reviewers,
|
|
630
|
+
...assigneesAndReviewersConfig.common,
|
|
631
|
+
...renovateConfig.registriesNetwork,
|
|
632
|
+
...renovateConfig.vulnerabilities,
|
|
633
|
+
...renovateConfig.vulnerabilitiesShared,
|
|
634
|
+
...renovateSharedConfig.advanced,
|
|
635
|
+
...renovateConfig.customization,
|
|
636
|
+
...renovateConfig.reporting,
|
|
637
|
+
...renovateConfig.inheritance,
|
|
638
|
+
...renovateConfig.processControl,
|
|
639
|
+
...renovateConfig.constraints,
|
|
640
|
+
...renovateConfig.internalContext,
|
|
641
|
+
...legacyAdminConfig.onboarding,
|
|
642
|
+
...legacyAdminConfig.executionLogging,
|
|
643
|
+
...legacyAdminConfig.configurationRequirements,
|
|
644
|
+
...updateConfig.semantic_versioning,
|
|
645
|
+
...updateConfig.pinning_digests,
|
|
646
|
+
...updateConfig.lock_file,
|
|
647
|
+
...updateConfig.special_cases,
|
|
648
|
+
...renovateConfig.packageRules
|
|
862
649
|
];
|
|
863
|
-
|
|
864
|
-
|
|
650
|
+
//#endregion
|
|
651
|
+
//#region src/rules/renovate-json/index.ts
|
|
652
|
+
const renovateJsonRules = {
|
|
653
|
+
name: "culur/renovate-json/rules",
|
|
654
|
+
files: [
|
|
655
|
+
"renovate.json",
|
|
656
|
+
"renovate.json5",
|
|
657
|
+
".github/renovate.json",
|
|
658
|
+
".github/renovate.json5",
|
|
659
|
+
".gitlab/renovate.json",
|
|
660
|
+
".gitlab/renovate.json5",
|
|
661
|
+
".renovaterc",
|
|
662
|
+
".renovaterc.json",
|
|
663
|
+
".renovaterc.json5"
|
|
664
|
+
],
|
|
665
|
+
rules: { "jsonc/sort-keys": [
|
|
666
|
+
"error",
|
|
667
|
+
{
|
|
668
|
+
pathPattern: /^$/.source,
|
|
669
|
+
order: rootOrder
|
|
670
|
+
},
|
|
671
|
+
{
|
|
672
|
+
pathPattern: /^packageRules\[\d+\]$/.source,
|
|
673
|
+
order: packageRuleOrder
|
|
674
|
+
}
|
|
675
|
+
] }
|
|
676
|
+
};
|
|
677
|
+
//#endregion
|
|
678
|
+
//#region src/rules/yarnrc-yml.ts
|
|
679
|
+
const yarnrcYmlSortKeys = { packageExtensions: {
|
|
680
|
+
packages: {
|
|
681
|
+
pathPattern: /^packageExtensions$/.source,
|
|
682
|
+
order: yamlOrder
|
|
683
|
+
},
|
|
684
|
+
dependenciesTypes: {
|
|
685
|
+
pathPattern: /^packageExtensions(?:\[".+"\]|\.[^.]+)$/.source,
|
|
686
|
+
order: yamlOrder
|
|
687
|
+
},
|
|
688
|
+
childPackages: {
|
|
689
|
+
pathPattern: /^packageExtensions(?:\[".+"\]|\.[^.]+)\.(?:dependencies|peerDependencies|peerDependenciesMeta)$/.source,
|
|
690
|
+
order: yamlOrder
|
|
691
|
+
}
|
|
692
|
+
} };
|
|
693
|
+
const yarnrcYmlRules = {
|
|
694
|
+
name: "culur/yarnrc-yml/rules",
|
|
695
|
+
files: [".yarnrc.yml"],
|
|
696
|
+
rules: { "yaml/sort-keys": [
|
|
697
|
+
"error",
|
|
698
|
+
yarnrcYmlSortKeys.packageExtensions.packages,
|
|
699
|
+
yarnrcYmlSortKeys.packageExtensions.dependenciesTypes,
|
|
700
|
+
yarnrcYmlSortKeys.packageExtensions.childPackages
|
|
701
|
+
] }
|
|
702
|
+
};
|
|
703
|
+
//#endregion
|
|
704
|
+
//#region src/types/index.ts
|
|
705
|
+
const defineOverride = (config) => [config.name, "partialConfig" in config ? config.partialConfig : config.entireConfig];
|
|
706
|
+
//#endregion
|
|
707
|
+
//#region src/index.ts
|
|
865
708
|
function defineConfig(...[options = {}, ...userConfigs]) {
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
);
|
|
879
|
-
config.override(...defineOverride(importsRules));
|
|
880
|
-
config.override(...defineOverride(sortPackageJson));
|
|
881
|
-
config.override(...defineOverride(testRules));
|
|
882
|
-
if (hasVue()) {
|
|
883
|
-
config.override(...defineOverride(vueRules));
|
|
884
|
-
}
|
|
885
|
-
return config;
|
|
709
|
+
const { hasVue } = (0, _culur_utils_packages.defineHasPackages)({ vue: !!options.vue });
|
|
710
|
+
const config = (0, _antfu_eslint_config.default)({
|
|
711
|
+
isInEditor: false,
|
|
712
|
+
stylistic: false,
|
|
713
|
+
formatters: false,
|
|
714
|
+
...options
|
|
715
|
+
}, filenameRules, yarnrcYmlRules, pnpmWorkspaceYamlRules, renovateJsonRules, ...userConfigs);
|
|
716
|
+
config.override(...defineOverride(importsRules));
|
|
717
|
+
config.override(...defineOverride(sortPackageJson));
|
|
718
|
+
config.override(...defineOverride(testRules));
|
|
719
|
+
if (hasVue()) config.override(...defineOverride(vueRules));
|
|
720
|
+
return config;
|
|
886
721
|
}
|
|
887
|
-
|
|
722
|
+
//#endregion
|
|
888
723
|
module.exports = defineConfig;
|
|
889
|
-
|
|
724
|
+
|
|
890
725
|
//# sourceMappingURL=index.cjs.map
|