@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.mjs
ADDED
|
@@ -0,0 +1,699 @@
|
|
|
1
|
+
import antfu, { sortPackageJson } from "@antfu/eslint-config";
|
|
2
|
+
import { defineHasPackages } from "@culur/utils-packages";
|
|
3
|
+
import assert from "node:assert";
|
|
4
|
+
import vitest from "@vitest/eslint-plugin";
|
|
5
|
+
import pluginUnicorn from "eslint-plugin-unicorn";
|
|
6
|
+
//#region src/overrides/imports-rules.ts
|
|
7
|
+
const importsRules = {
|
|
8
|
+
name: "antfu/imports/rules",
|
|
9
|
+
partialConfig: { rules: { "import/consistent-type-specifier-style": ["error", "prefer-top-level"] } }
|
|
10
|
+
};
|
|
11
|
+
//#endregion
|
|
12
|
+
//#region src/overrides/sort-package-json.ts
|
|
13
|
+
const sortPackageJson$1 = {
|
|
14
|
+
name: "antfu/sort/package-json",
|
|
15
|
+
async entireConfig() {
|
|
16
|
+
const [configItem] = await sortPackageJson();
|
|
17
|
+
assert(typeof configItem.name === "string");
|
|
18
|
+
assert(typeof configItem.rules === "object");
|
|
19
|
+
const sortKeys = configItem.rules["jsonc/sort-keys"];
|
|
20
|
+
assert(typeof sortKeys === "object");
|
|
21
|
+
const [, options] = sortKeys;
|
|
22
|
+
assert(typeof options === "object");
|
|
23
|
+
options.order = [
|
|
24
|
+
"publisher",
|
|
25
|
+
"name",
|
|
26
|
+
"displayName",
|
|
27
|
+
"version",
|
|
28
|
+
"description",
|
|
29
|
+
"private",
|
|
30
|
+
"publishConfig",
|
|
31
|
+
"repository",
|
|
32
|
+
"bugs",
|
|
33
|
+
"homepage",
|
|
34
|
+
"funding",
|
|
35
|
+
"contributors",
|
|
36
|
+
"author",
|
|
37
|
+
"license",
|
|
38
|
+
"keywords",
|
|
39
|
+
"categories",
|
|
40
|
+
"unpkg",
|
|
41
|
+
"jsdelivr",
|
|
42
|
+
"type",
|
|
43
|
+
"main",
|
|
44
|
+
"types",
|
|
45
|
+
"typings",
|
|
46
|
+
"typesVersions",
|
|
47
|
+
"exports",
|
|
48
|
+
"bin",
|
|
49
|
+
"files",
|
|
50
|
+
"workspaces",
|
|
51
|
+
"icon",
|
|
52
|
+
"activationEvents",
|
|
53
|
+
"contributes",
|
|
54
|
+
"scripts",
|
|
55
|
+
"volta",
|
|
56
|
+
"engines",
|
|
57
|
+
"packageManager",
|
|
58
|
+
"dependencies",
|
|
59
|
+
"devDependencies",
|
|
60
|
+
"peerDependencies",
|
|
61
|
+
"peerDependenciesMeta",
|
|
62
|
+
"bundleDependencies",
|
|
63
|
+
"optionalDependencies",
|
|
64
|
+
"pnpm",
|
|
65
|
+
"overrides",
|
|
66
|
+
"resolutions",
|
|
67
|
+
"husky",
|
|
68
|
+
"simple-git-hooks",
|
|
69
|
+
"lint-staged",
|
|
70
|
+
"eslintConfig"
|
|
71
|
+
];
|
|
72
|
+
return configItem;
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
//#endregion
|
|
76
|
+
//#region src/overrides/test-rules.ts
|
|
77
|
+
const testRules = {
|
|
78
|
+
name: "antfu/test/rules",
|
|
79
|
+
partialConfig: {
|
|
80
|
+
files: ["**/*\\.{test,test-d}.?(c|m)[jt]s?(x)"],
|
|
81
|
+
rules: {
|
|
82
|
+
...vitest.configs.recommended.rules,
|
|
83
|
+
"test/valid-title": ["error", { allowArguments: true }],
|
|
84
|
+
"test/expect-expect": ["error", { assertFunctionNames: [
|
|
85
|
+
"expect",
|
|
86
|
+
"expectTypeOf",
|
|
87
|
+
"assert",
|
|
88
|
+
"assertType"
|
|
89
|
+
] }]
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
};
|
|
93
|
+
//#endregion
|
|
94
|
+
//#region src/overrides/vue-rules.ts
|
|
95
|
+
const vueRules = {
|
|
96
|
+
name: "antfu/vue/rules",
|
|
97
|
+
partialConfig: { rules: {
|
|
98
|
+
"vue/singleline-html-element-content-newline": "off",
|
|
99
|
+
"vue/multiline-html-element-content-newline": "off",
|
|
100
|
+
"vue/padding-line-between-blocks": ["error", "always"],
|
|
101
|
+
"vue/component-name-in-template-casing": [
|
|
102
|
+
"error",
|
|
103
|
+
"PascalCase",
|
|
104
|
+
{ registeredComponentsOnly: false }
|
|
105
|
+
]
|
|
106
|
+
} }
|
|
107
|
+
};
|
|
108
|
+
//#endregion
|
|
109
|
+
//#region src/rules/filename.ts
|
|
110
|
+
const filenameRules = {
|
|
111
|
+
name: "culur/filename/rules",
|
|
112
|
+
plugins: { unicorn: pluginUnicorn },
|
|
113
|
+
files: [
|
|
114
|
+
"**/*.?(c|m){js,ts}?(x)",
|
|
115
|
+
"**/*.vue",
|
|
116
|
+
"**/*.md?(x)",
|
|
117
|
+
"**/*.json?(c)",
|
|
118
|
+
"**/*.y?(a)ml",
|
|
119
|
+
"**/*.gql",
|
|
120
|
+
"**/*.graphql"
|
|
121
|
+
],
|
|
122
|
+
rules: { "unicorn/filename-case": ["error", {
|
|
123
|
+
case: "kebabCase",
|
|
124
|
+
ignore: [
|
|
125
|
+
"^ADR-\\w+\\.md",
|
|
126
|
+
"^ARCHITECTURE\\.md",
|
|
127
|
+
"^CHANGELOG\\.md",
|
|
128
|
+
"^CONTRIBUTING\\.md",
|
|
129
|
+
"^README\\.md"
|
|
130
|
+
]
|
|
131
|
+
}] }
|
|
132
|
+
};
|
|
133
|
+
//#endregion
|
|
134
|
+
//#region src/rules/yaml-order.ts
|
|
135
|
+
const yamlOrder = {
|
|
136
|
+
type: "asc",
|
|
137
|
+
caseSensitive: false,
|
|
138
|
+
natural: true
|
|
139
|
+
};
|
|
140
|
+
//#endregion
|
|
141
|
+
//#region src/rules/pnpm-workspace-yaml.ts
|
|
142
|
+
const pnpmWorkspaceSortKeys = {
|
|
143
|
+
root: {
|
|
144
|
+
pathPattern: /^$/.source,
|
|
145
|
+
order: [
|
|
146
|
+
"packages",
|
|
147
|
+
"catalog",
|
|
148
|
+
"overrides",
|
|
149
|
+
"packageExtensions",
|
|
150
|
+
"allowedDeprecatedVersions",
|
|
151
|
+
"updateConfig",
|
|
152
|
+
"supportedArchitectures",
|
|
153
|
+
"ignoredOptionalDependencies",
|
|
154
|
+
"minimumReleaseAge",
|
|
155
|
+
"minimumReleaseAgeExclude",
|
|
156
|
+
"minimumReleaseAgeIgnoreMissingTime",
|
|
157
|
+
"minimumReleaseAgeStrict",
|
|
158
|
+
"trustPolicy",
|
|
159
|
+
"trustPolicyExclude",
|
|
160
|
+
"trustPolicyIgnoreAfter",
|
|
161
|
+
"trustLockfile",
|
|
162
|
+
"blockExoticSubdeps",
|
|
163
|
+
"registries",
|
|
164
|
+
"namedRegistries",
|
|
165
|
+
"hoist",
|
|
166
|
+
"hoistWorkspacePackages",
|
|
167
|
+
"hoistPattern",
|
|
168
|
+
"publicHoistPattern",
|
|
169
|
+
"shamefullyHoist",
|
|
170
|
+
"modulesDir",
|
|
171
|
+
"nodeLinker",
|
|
172
|
+
"symlink",
|
|
173
|
+
"enableModulesDir",
|
|
174
|
+
"virtualStoreDir",
|
|
175
|
+
"virtualStoreDirMaxLength",
|
|
176
|
+
"virtualStoreOnly",
|
|
177
|
+
"packageImportMethod",
|
|
178
|
+
"modulesCacheMaxAge",
|
|
179
|
+
"dlxCacheMaxAge",
|
|
180
|
+
"enableGlobalVirtualStore",
|
|
181
|
+
"storeDir",
|
|
182
|
+
"verifyStoreIntegrity",
|
|
183
|
+
"useRunningStoreServer",
|
|
184
|
+
"strictStorePkgContentCheck",
|
|
185
|
+
"httpsProxy",
|
|
186
|
+
"httpProxy",
|
|
187
|
+
"noProxy",
|
|
188
|
+
"localAddress",
|
|
189
|
+
"maxsockets",
|
|
190
|
+
"strictSsl",
|
|
191
|
+
"lockfile",
|
|
192
|
+
"preferFrozenLockfile",
|
|
193
|
+
"lockfileIncludeTarballUrl",
|
|
194
|
+
"gitBranchLockfile",
|
|
195
|
+
"mergeGitBranchLockfilesBranchPattern",
|
|
196
|
+
"peersSuffixMaxLength",
|
|
197
|
+
"gitShallowHosts",
|
|
198
|
+
"networkConcurrency",
|
|
199
|
+
"fetchRetries",
|
|
200
|
+
"fetchRetryFactor",
|
|
201
|
+
"fetchRetryMintimeout",
|
|
202
|
+
"fetchRetryMaxtimeout",
|
|
203
|
+
"fetchTimeout",
|
|
204
|
+
"fetchWarnTimeoutMs",
|
|
205
|
+
"fetchMinSpeedKiBps",
|
|
206
|
+
"autoInstallPeers",
|
|
207
|
+
"dedupePeerDependents",
|
|
208
|
+
"dedupePeers",
|
|
209
|
+
"strictPeerDependencies",
|
|
210
|
+
"resolvePeersFromWorkspaceRoot",
|
|
211
|
+
"peerDependencyRules",
|
|
212
|
+
"[no-]color",
|
|
213
|
+
"loglevel",
|
|
214
|
+
"useBetaCli",
|
|
215
|
+
"recursiveInstall",
|
|
216
|
+
"engineStrict",
|
|
217
|
+
"npmPath",
|
|
218
|
+
"pmOnFail",
|
|
219
|
+
"ignoreWorkspaceRootCheck",
|
|
220
|
+
"ignoreScripts",
|
|
221
|
+
"childConcurrency",
|
|
222
|
+
"sideEffectsCache",
|
|
223
|
+
"sideEffectsCacheReadonly",
|
|
224
|
+
"unsafePerm",
|
|
225
|
+
"nodeOptions",
|
|
226
|
+
"verifyDepsBeforeRun",
|
|
227
|
+
"strictDepBuilds",
|
|
228
|
+
"allowBuilds",
|
|
229
|
+
"dangerouslyAllowAllBuilds",
|
|
230
|
+
"nodeVersion",
|
|
231
|
+
"runtimeOnFail",
|
|
232
|
+
"nodeDownloadMirrors",
|
|
233
|
+
"savePrefix",
|
|
234
|
+
"tag",
|
|
235
|
+
"globalDir",
|
|
236
|
+
"globalBinDir",
|
|
237
|
+
"npmrcAuthFile",
|
|
238
|
+
"stateDir",
|
|
239
|
+
"cacheDir",
|
|
240
|
+
"useStderr",
|
|
241
|
+
"updateNotifier",
|
|
242
|
+
"preferSymlinkedExecutables",
|
|
243
|
+
"ignoreCompatibilityDb",
|
|
244
|
+
"resolutionMode",
|
|
245
|
+
"registrySupportsTimeField",
|
|
246
|
+
"extendNodePath",
|
|
247
|
+
"deployAllFiles",
|
|
248
|
+
"dedupeDirectDeps",
|
|
249
|
+
"optimisticRepeatInstall",
|
|
250
|
+
"requiredScripts",
|
|
251
|
+
"enablePrePostScripts",
|
|
252
|
+
"scriptShell",
|
|
253
|
+
"shellEmulator",
|
|
254
|
+
"catalogMode",
|
|
255
|
+
"ci",
|
|
256
|
+
"cleanupUnusedCatalogs"
|
|
257
|
+
]
|
|
258
|
+
},
|
|
259
|
+
packages: {
|
|
260
|
+
pathPattern: `^(${[
|
|
261
|
+
"overrides",
|
|
262
|
+
"packageExtensions",
|
|
263
|
+
"allowedDeprecatedVersions",
|
|
264
|
+
"updateConfig",
|
|
265
|
+
"supportedArchitectures",
|
|
266
|
+
"registries",
|
|
267
|
+
"namedRegistries"
|
|
268
|
+
].join("|")})$`,
|
|
269
|
+
order: yamlOrder
|
|
270
|
+
}
|
|
271
|
+
};
|
|
272
|
+
//! Monorepo
|
|
273
|
+
//! Dependency Resolution
|
|
274
|
+
//! Dependency Hoisting Settings
|
|
275
|
+
//! Node-Modules Settings
|
|
276
|
+
//! Store Settings
|
|
277
|
+
//! Network Settings
|
|
278
|
+
//! Lockfile Settings
|
|
279
|
+
//! Request Settings
|
|
280
|
+
//! Peer Dependency Settings
|
|
281
|
+
//! CLI Settings
|
|
282
|
+
//! Build Settings
|
|
283
|
+
//! Node.js Settings
|
|
284
|
+
//! Other Settings
|
|
285
|
+
const pnpmWorkspaceSortSequenceValues = { packages: {
|
|
286
|
+
pathPattern: `^(${[
|
|
287
|
+
"ignoredOptionalDependencies",
|
|
288
|
+
"minimumReleaseAgeExclude",
|
|
289
|
+
"trustPolicyExclude"
|
|
290
|
+
].join("|")})$`,
|
|
291
|
+
order: yamlOrder
|
|
292
|
+
} };
|
|
293
|
+
const pnpmWorkspaceYamlRules = {
|
|
294
|
+
name: "culur/pnpm-workspace-yaml/rules",
|
|
295
|
+
files: ["pnpm-workspace.yaml"],
|
|
296
|
+
rules: {
|
|
297
|
+
"yaml/sort-keys": [
|
|
298
|
+
"error",
|
|
299
|
+
pnpmWorkspaceSortKeys.root,
|
|
300
|
+
pnpmWorkspaceSortKeys.packages
|
|
301
|
+
],
|
|
302
|
+
"yaml/sort-sequence-values": ["error", pnpmWorkspaceSortSequenceValues.packages]
|
|
303
|
+
}
|
|
304
|
+
};
|
|
305
|
+
//#endregion
|
|
306
|
+
//#region src/rules/renovate-json/base/package-rule.ts
|
|
307
|
+
const packageRule = {
|
|
308
|
+
metadata: ["description"],
|
|
309
|
+
rangeStrategy: ["rangeStrategy"],
|
|
310
|
+
matching: [
|
|
311
|
+
"matchPackageNames",
|
|
312
|
+
"matchDepNames",
|
|
313
|
+
"matchManagers",
|
|
314
|
+
"matchDatasources",
|
|
315
|
+
"matchDepTypes",
|
|
316
|
+
"matchUpdateTypes",
|
|
317
|
+
"matchCategories",
|
|
318
|
+
"matchCurrentVersion",
|
|
319
|
+
"matchSourceUrls",
|
|
320
|
+
"matchFileNames",
|
|
321
|
+
"matchBaseBranches",
|
|
322
|
+
"matchRepositories",
|
|
323
|
+
"matchCurrentValue",
|
|
324
|
+
"matchNewValue",
|
|
325
|
+
"matchCurrentAge",
|
|
326
|
+
"matchConfidence",
|
|
327
|
+
"matchJsonata"
|
|
328
|
+
],
|
|
329
|
+
registriesNetwork: ["registryUrls"],
|
|
330
|
+
vulnerabilities: ["isVulnerabilityAlert", "vulnerabilityFixVersion"],
|
|
331
|
+
vulnerabilitiesShared: ["vulnerabilitySeverity"]
|
|
332
|
+
};
|
|
333
|
+
//#endregion
|
|
334
|
+
//#region src/rules/renovate-json/base/renovate-shared-config.ts
|
|
335
|
+
const renovateSharedConfig = {
|
|
336
|
+
config: [
|
|
337
|
+
"$schema",
|
|
338
|
+
"extends",
|
|
339
|
+
"enabled",
|
|
340
|
+
"enabledManagers"
|
|
341
|
+
],
|
|
342
|
+
dependencyDashboard: ["dependencyDashboardApproval"],
|
|
343
|
+
schedule: ["schedule", "timezone"],
|
|
344
|
+
automerge: [
|
|
345
|
+
"automerge",
|
|
346
|
+
"automergeType",
|
|
347
|
+
"automergeStrategy",
|
|
348
|
+
"automergeSchedule",
|
|
349
|
+
"internalChecksAsSuccess",
|
|
350
|
+
"platformAutomerge"
|
|
351
|
+
],
|
|
352
|
+
branch: [
|
|
353
|
+
"branchPrefix",
|
|
354
|
+
"branchName",
|
|
355
|
+
"branchNameStrict",
|
|
356
|
+
"hashedBranchLength",
|
|
357
|
+
"pruneBranchAfterAutomerge"
|
|
358
|
+
],
|
|
359
|
+
grouping: [
|
|
360
|
+
"group",
|
|
361
|
+
"groupName",
|
|
362
|
+
"groupSlug"
|
|
363
|
+
],
|
|
364
|
+
commit: [
|
|
365
|
+
"semanticCommits",
|
|
366
|
+
"semanticCommitType",
|
|
367
|
+
"semanticCommitScope",
|
|
368
|
+
"commitMessagePrefix",
|
|
369
|
+
"commitMessage",
|
|
370
|
+
"commitMessageAction",
|
|
371
|
+
"commitMessageTopic",
|
|
372
|
+
"commitMessageExtra",
|
|
373
|
+
"commitMessageLowerCase",
|
|
374
|
+
"platformCommit"
|
|
375
|
+
],
|
|
376
|
+
pr: [
|
|
377
|
+
"prCreation",
|
|
378
|
+
"draftPR",
|
|
379
|
+
"recreateClosed",
|
|
380
|
+
"recreateWhen",
|
|
381
|
+
"prBodyColumns",
|
|
382
|
+
"prBodyDefinitions",
|
|
383
|
+
"prPriority",
|
|
384
|
+
"confidential",
|
|
385
|
+
"milestone"
|
|
386
|
+
],
|
|
387
|
+
labels: [
|
|
388
|
+
"labels",
|
|
389
|
+
"addLabels",
|
|
390
|
+
"keepUpdatedLabel",
|
|
391
|
+
"rebaseLabel",
|
|
392
|
+
"stopUpdatingLabel"
|
|
393
|
+
],
|
|
394
|
+
filtering: [
|
|
395
|
+
"ignoreDeps",
|
|
396
|
+
"ignorePaths",
|
|
397
|
+
"includePaths",
|
|
398
|
+
"fileMatch",
|
|
399
|
+
"respectLatest",
|
|
400
|
+
"ignoreTests"
|
|
401
|
+
],
|
|
402
|
+
advanced: [
|
|
403
|
+
"postUpgradeTasks",
|
|
404
|
+
"npmrc",
|
|
405
|
+
"npmrcMerge",
|
|
406
|
+
"changelogUrl",
|
|
407
|
+
"gitIgnoredAuthors",
|
|
408
|
+
"unicodeEmoji",
|
|
409
|
+
"suppressNotifications",
|
|
410
|
+
"productLinks",
|
|
411
|
+
"rebaseWhen"
|
|
412
|
+
]
|
|
413
|
+
};
|
|
414
|
+
//#endregion
|
|
415
|
+
//#region src/rules/renovate-json/base/update-config.ts
|
|
416
|
+
const updateConfig = {
|
|
417
|
+
semantic_versioning: [
|
|
418
|
+
"major",
|
|
419
|
+
"minor",
|
|
420
|
+
"patch"
|
|
421
|
+
],
|
|
422
|
+
pinning_digests: [
|
|
423
|
+
"pin",
|
|
424
|
+
"digest",
|
|
425
|
+
"pinDigest"
|
|
426
|
+
],
|
|
427
|
+
lock_file: ["lockFileMaintenance", "lockfileUpdate"],
|
|
428
|
+
special_cases: [
|
|
429
|
+
"rollback",
|
|
430
|
+
"bump",
|
|
431
|
+
"replacement"
|
|
432
|
+
]
|
|
433
|
+
};
|
|
434
|
+
//#endregion
|
|
435
|
+
//#region src/rules/renovate-json/order/package-rule.ts
|
|
436
|
+
const packageRuleOrder = [
|
|
437
|
+
...packageRule.metadata,
|
|
438
|
+
...renovateSharedConfig.config,
|
|
439
|
+
...renovateSharedConfig.branch,
|
|
440
|
+
...renovateSharedConfig.dependencyDashboard,
|
|
441
|
+
...renovateSharedConfig.schedule,
|
|
442
|
+
...renovateSharedConfig.automerge,
|
|
443
|
+
...renovateSharedConfig.grouping,
|
|
444
|
+
...renovateSharedConfig.commit,
|
|
445
|
+
...renovateSharedConfig.pr,
|
|
446
|
+
...renovateSharedConfig.labels,
|
|
447
|
+
...renovateSharedConfig.filtering,
|
|
448
|
+
...packageRule.rangeStrategy,
|
|
449
|
+
...packageRule.matching,
|
|
450
|
+
...packageRule.registriesNetwork,
|
|
451
|
+
...packageRule.vulnerabilities,
|
|
452
|
+
...packageRule.vulnerabilitiesShared,
|
|
453
|
+
...renovateSharedConfig.advanced,
|
|
454
|
+
...updateConfig.semantic_versioning,
|
|
455
|
+
...updateConfig.pinning_digests,
|
|
456
|
+
...updateConfig.lock_file,
|
|
457
|
+
...updateConfig.special_cases
|
|
458
|
+
];
|
|
459
|
+
//#endregion
|
|
460
|
+
//#region src/rules/renovate-json/base/assignees-and-reviewers-config.ts
|
|
461
|
+
const assigneesAndReviewersConfig = {
|
|
462
|
+
assignees: [
|
|
463
|
+
"assignees",
|
|
464
|
+
"assigneesFromCodeOwners",
|
|
465
|
+
"assigneesSampleSize"
|
|
466
|
+
],
|
|
467
|
+
reviewers: [
|
|
468
|
+
"reviewers",
|
|
469
|
+
"reviewersFromCodeOwners",
|
|
470
|
+
"reviewersSampleSize",
|
|
471
|
+
"additionalReviewers",
|
|
472
|
+
"ignoreReviewers"
|
|
473
|
+
],
|
|
474
|
+
common: ["expandCodeOwnersGroups", "filterUnavailableUsers"]
|
|
475
|
+
};
|
|
476
|
+
//#endregion
|
|
477
|
+
//#region src/rules/renovate-json/base/config-migration.ts
|
|
478
|
+
const configMigration = ["configMigration"];
|
|
479
|
+
//#endregion
|
|
480
|
+
//#region src/rules/renovate-json/base/legacy-admin-config.ts
|
|
481
|
+
const legacyAdminConfig = {
|
|
482
|
+
onboarding: [
|
|
483
|
+
"onboarding",
|
|
484
|
+
"onboardingBranch",
|
|
485
|
+
"onboardingCommitMessage",
|
|
486
|
+
"onboardingPrTitle",
|
|
487
|
+
"onboardingConfig",
|
|
488
|
+
"onboardingConfigFileName",
|
|
489
|
+
"onboardingRebaseCheckbox",
|
|
490
|
+
"onboardingNoDeps"
|
|
491
|
+
],
|
|
492
|
+
configurationRequirements: ["requireConfig"],
|
|
493
|
+
executionLogging: ["localDir", "logContext"]
|
|
494
|
+
};
|
|
495
|
+
//#endregion
|
|
496
|
+
//#region src/rules/renovate-json/base/renovate-config.ts
|
|
497
|
+
const renovateConfig = {
|
|
498
|
+
metadata: ["description"],
|
|
499
|
+
repository: [
|
|
500
|
+
"baseBranches",
|
|
501
|
+
"defaultBranch",
|
|
502
|
+
"useBaseBranchConfig",
|
|
503
|
+
"gitAuthor"
|
|
504
|
+
],
|
|
505
|
+
forkHandling: [
|
|
506
|
+
"forkProcessing",
|
|
507
|
+
"isFork",
|
|
508
|
+
"forkModeDisallowMaintainerEdits"
|
|
509
|
+
],
|
|
510
|
+
dependencyDashboard: [
|
|
511
|
+
"dependencyDashboard",
|
|
512
|
+
"dependencyDashboardTitle",
|
|
513
|
+
"dependencyDashboardHeader",
|
|
514
|
+
"dependencyDashboardFooter",
|
|
515
|
+
"dependencyDashboardLabels",
|
|
516
|
+
"dependencyDashboardChecks",
|
|
517
|
+
"dependencyDashboardAutoclose",
|
|
518
|
+
"dependencyDashboardOSVVulnerabilitySummary",
|
|
519
|
+
"customizeDashboard"
|
|
520
|
+
],
|
|
521
|
+
limits: [
|
|
522
|
+
"branchConcurrentLimit",
|
|
523
|
+
"prConcurrentLimit",
|
|
524
|
+
"prHourlyLimit"
|
|
525
|
+
],
|
|
526
|
+
namingSpecifics: [
|
|
527
|
+
"branchTopic",
|
|
528
|
+
"additionalBranchPrefix",
|
|
529
|
+
"commitBody"
|
|
530
|
+
],
|
|
531
|
+
registriesNetwork: [
|
|
532
|
+
"hostRules",
|
|
533
|
+
"defaultRegistryUrls",
|
|
534
|
+
"registryUrls",
|
|
535
|
+
"registryAliases",
|
|
536
|
+
"s3Endpoint",
|
|
537
|
+
"s3PathStyle"
|
|
538
|
+
],
|
|
539
|
+
vulnerabilities: ["vulnerabilityAlerts", "osvVulnerabilityAlerts"],
|
|
540
|
+
vulnerabilitiesShared: ["vulnerabilitySeverity"],
|
|
541
|
+
customization: [
|
|
542
|
+
"customManagers",
|
|
543
|
+
"customDatasources",
|
|
544
|
+
"secrets",
|
|
545
|
+
"env"
|
|
546
|
+
],
|
|
547
|
+
reporting: ["reportPath", "reportType"],
|
|
548
|
+
inheritance: [
|
|
549
|
+
"inheritConfig",
|
|
550
|
+
"inheritConfigFileName",
|
|
551
|
+
"inheritConfigRepoName",
|
|
552
|
+
"inheritConfigStrict",
|
|
553
|
+
"ignorePresets",
|
|
554
|
+
"force"
|
|
555
|
+
],
|
|
556
|
+
processControl: [
|
|
557
|
+
"skipInstalls",
|
|
558
|
+
"updateInternalDeps",
|
|
559
|
+
"cloneSubmodulesFilter",
|
|
560
|
+
"fetchChangeLogs",
|
|
561
|
+
"logLevelRemap",
|
|
562
|
+
"statusCheckNames",
|
|
563
|
+
"configWarningReuseIssue",
|
|
564
|
+
"postUpdateOptions"
|
|
565
|
+
],
|
|
566
|
+
constraints: ["constraints", "constraintsFiltering"],
|
|
567
|
+
internalContext: [
|
|
568
|
+
"depName",
|
|
569
|
+
"baseBranch",
|
|
570
|
+
"branchList",
|
|
571
|
+
"errors",
|
|
572
|
+
"fileList",
|
|
573
|
+
"packageFile",
|
|
574
|
+
"repoIsOnboarded",
|
|
575
|
+
"repoIsActivated",
|
|
576
|
+
"warnings",
|
|
577
|
+
"checkedBranches",
|
|
578
|
+
"sharedVariableName"
|
|
579
|
+
],
|
|
580
|
+
packageRules: ["packageRules"]
|
|
581
|
+
};
|
|
582
|
+
//#endregion
|
|
583
|
+
//#region src/rules/renovate-json/order/root.ts
|
|
584
|
+
const rootOrder = [
|
|
585
|
+
...renovateSharedConfig.config,
|
|
586
|
+
...renovateConfig.metadata,
|
|
587
|
+
...renovateConfig.repository,
|
|
588
|
+
...renovateConfig.forkHandling,
|
|
589
|
+
...renovateSharedConfig.branch,
|
|
590
|
+
...configMigration,
|
|
591
|
+
...renovateConfig.dependencyDashboard,
|
|
592
|
+
...renovateSharedConfig.dependencyDashboard,
|
|
593
|
+
...renovateSharedConfig.schedule,
|
|
594
|
+
...renovateSharedConfig.automerge,
|
|
595
|
+
...renovateConfig.limits,
|
|
596
|
+
...renovateSharedConfig.grouping,
|
|
597
|
+
...renovateSharedConfig.commit,
|
|
598
|
+
...renovateSharedConfig.pr,
|
|
599
|
+
...renovateSharedConfig.labels,
|
|
600
|
+
...renovateSharedConfig.filtering,
|
|
601
|
+
...renovateConfig.namingSpecifics,
|
|
602
|
+
...assigneesAndReviewersConfig.assignees,
|
|
603
|
+
...assigneesAndReviewersConfig.reviewers,
|
|
604
|
+
...assigneesAndReviewersConfig.common,
|
|
605
|
+
...renovateConfig.registriesNetwork,
|
|
606
|
+
...renovateConfig.vulnerabilities,
|
|
607
|
+
...renovateConfig.vulnerabilitiesShared,
|
|
608
|
+
...renovateSharedConfig.advanced,
|
|
609
|
+
...renovateConfig.customization,
|
|
610
|
+
...renovateConfig.reporting,
|
|
611
|
+
...renovateConfig.inheritance,
|
|
612
|
+
...renovateConfig.processControl,
|
|
613
|
+
...renovateConfig.constraints,
|
|
614
|
+
...renovateConfig.internalContext,
|
|
615
|
+
...legacyAdminConfig.onboarding,
|
|
616
|
+
...legacyAdminConfig.executionLogging,
|
|
617
|
+
...legacyAdminConfig.configurationRequirements,
|
|
618
|
+
...updateConfig.semantic_versioning,
|
|
619
|
+
...updateConfig.pinning_digests,
|
|
620
|
+
...updateConfig.lock_file,
|
|
621
|
+
...updateConfig.special_cases,
|
|
622
|
+
...renovateConfig.packageRules
|
|
623
|
+
];
|
|
624
|
+
//#endregion
|
|
625
|
+
//#region src/rules/renovate-json/index.ts
|
|
626
|
+
const renovateJsonRules = {
|
|
627
|
+
name: "culur/renovate-json/rules",
|
|
628
|
+
files: [
|
|
629
|
+
"renovate.json",
|
|
630
|
+
"renovate.json5",
|
|
631
|
+
".github/renovate.json",
|
|
632
|
+
".github/renovate.json5",
|
|
633
|
+
".gitlab/renovate.json",
|
|
634
|
+
".gitlab/renovate.json5",
|
|
635
|
+
".renovaterc",
|
|
636
|
+
".renovaterc.json",
|
|
637
|
+
".renovaterc.json5"
|
|
638
|
+
],
|
|
639
|
+
rules: { "jsonc/sort-keys": [
|
|
640
|
+
"error",
|
|
641
|
+
{
|
|
642
|
+
pathPattern: /^$/.source,
|
|
643
|
+
order: rootOrder
|
|
644
|
+
},
|
|
645
|
+
{
|
|
646
|
+
pathPattern: /^packageRules\[\d+\]$/.source,
|
|
647
|
+
order: packageRuleOrder
|
|
648
|
+
}
|
|
649
|
+
] }
|
|
650
|
+
};
|
|
651
|
+
//#endregion
|
|
652
|
+
//#region src/rules/yarnrc-yml.ts
|
|
653
|
+
const yarnrcYmlSortKeys = { packageExtensions: {
|
|
654
|
+
packages: {
|
|
655
|
+
pathPattern: /^packageExtensions$/.source,
|
|
656
|
+
order: yamlOrder
|
|
657
|
+
},
|
|
658
|
+
dependenciesTypes: {
|
|
659
|
+
pathPattern: /^packageExtensions(?:\[".+"\]|\.[^.]+)$/.source,
|
|
660
|
+
order: yamlOrder
|
|
661
|
+
},
|
|
662
|
+
childPackages: {
|
|
663
|
+
pathPattern: /^packageExtensions(?:\[".+"\]|\.[^.]+)\.(?:dependencies|peerDependencies|peerDependenciesMeta)$/.source,
|
|
664
|
+
order: yamlOrder
|
|
665
|
+
}
|
|
666
|
+
} };
|
|
667
|
+
const yarnrcYmlRules = {
|
|
668
|
+
name: "culur/yarnrc-yml/rules",
|
|
669
|
+
files: [".yarnrc.yml"],
|
|
670
|
+
rules: { "yaml/sort-keys": [
|
|
671
|
+
"error",
|
|
672
|
+
yarnrcYmlSortKeys.packageExtensions.packages,
|
|
673
|
+
yarnrcYmlSortKeys.packageExtensions.dependenciesTypes,
|
|
674
|
+
yarnrcYmlSortKeys.packageExtensions.childPackages
|
|
675
|
+
] }
|
|
676
|
+
};
|
|
677
|
+
//#endregion
|
|
678
|
+
//#region src/types/index.ts
|
|
679
|
+
const defineOverride = (config) => [config.name, "partialConfig" in config ? config.partialConfig : config.entireConfig];
|
|
680
|
+
//#endregion
|
|
681
|
+
//#region src/index.ts
|
|
682
|
+
function defineConfig(...[options = {}, ...userConfigs]) {
|
|
683
|
+
const { hasVue } = defineHasPackages({ vue: !!options.vue });
|
|
684
|
+
const config = antfu({
|
|
685
|
+
isInEditor: false,
|
|
686
|
+
stylistic: false,
|
|
687
|
+
formatters: false,
|
|
688
|
+
...options
|
|
689
|
+
}, filenameRules, yarnrcYmlRules, pnpmWorkspaceYamlRules, renovateJsonRules, ...userConfigs);
|
|
690
|
+
config.override(...defineOverride(importsRules));
|
|
691
|
+
config.override(...defineOverride(sortPackageJson$1));
|
|
692
|
+
config.override(...defineOverride(testRules));
|
|
693
|
+
if (hasVue()) config.override(...defineOverride(vueRules));
|
|
694
|
+
return config;
|
|
695
|
+
}
|
|
696
|
+
//#endregion
|
|
697
|
+
export { defineConfig as default };
|
|
698
|
+
|
|
699
|
+
//# sourceMappingURL=index.mjs.map
|