@adamhl8/configs 0.19.3 → 0.19.4
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.
|
@@ -1,22 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
//#region src/utils.ts
|
|
4
|
-
/**
|
|
5
|
-
* A wrapper around es-toolkit's `mergeWith` with a custom merge function that concatenates arrays.
|
|
6
|
-
*/
|
|
7
|
-
function merge(target, source) {
|
|
8
|
-
return mergeWith(target, source, (objValue, srcValue) => Array.isArray(objValue) ? objValue.concat(srcValue) : void 0);
|
|
9
|
-
}
|
|
10
|
-
/**
|
|
11
|
-
* Creates a config merge function with proper type overloads for merging with a base config.
|
|
12
|
-
*/
|
|
13
|
-
function createMergeConfigFn(baseConfig) {
|
|
14
|
-
const mergeConfigFn = (userConfig) => {
|
|
15
|
-
if (userConfig === void 0) return baseConfig;
|
|
16
|
-
return merge(clone(baseConfig), clone(userConfig));
|
|
17
|
-
};
|
|
18
|
-
return mergeConfigFn;
|
|
19
|
-
}
|
|
1
|
+
import "es-toolkit";
|
|
2
|
+
import "remeda";
|
|
20
3
|
//#endregion
|
|
21
4
|
//#region src/configs/knip.ts
|
|
22
5
|
const DEFAULT_ENTRIES = [
|
|
@@ -24,11 +7,6 @@ const DEFAULT_ENTRIES = [
|
|
|
24
7
|
"**/*.test.ts",
|
|
25
8
|
"./tsdown.config.ts"
|
|
26
9
|
];
|
|
27
|
-
createMergeConfigFn({
|
|
28
|
-
entry: DEFAULT_ENTRIES,
|
|
29
|
-
project: ["**"],
|
|
30
|
-
tsdown: false
|
|
31
|
-
});
|
|
32
10
|
//#endregion
|
|
33
11
|
//#region src/adamhl8-knip/knip-preprocessor.ts
|
|
34
12
|
/**
|
|
@@ -267,6 +267,7 @@
|
|
|
267
267
|
"useVueValidVOn": "off",
|
|
268
268
|
"useVueValidVText": "off",
|
|
269
269
|
"noAmbiguousAnchorText": "error",
|
|
270
|
+
"noBaseToString": "error",
|
|
270
271
|
"noBeforeInteractiveScriptOutsideDocument": "error",
|
|
271
272
|
"noComponentHookFactories": "error",
|
|
272
273
|
"noConditionalExpect": "error",
|
|
@@ -286,6 +287,7 @@
|
|
|
286
287
|
"noDuplicateVariableNames": "error",
|
|
287
288
|
"noEmptyObjectKeys": "error",
|
|
288
289
|
"noEqualsToNull": "error",
|
|
290
|
+
"noExcessiveNestedCallbacks": "error",
|
|
289
291
|
"noExcessiveSelectorClasses": "error",
|
|
290
292
|
"noFloatingClasses": "error",
|
|
291
293
|
"noFloatingPromises": "error",
|
|
@@ -318,6 +320,7 @@
|
|
|
318
320
|
"noProto": "error",
|
|
319
321
|
"noReactNativeDeepImports": "error",
|
|
320
322
|
"noReactNativeLiteralColors": "error",
|
|
323
|
+
"noReactStringRefs": "error",
|
|
321
324
|
"noRedundantDefaultExport": "error",
|
|
322
325
|
"noReturnAssign": "error",
|
|
323
326
|
"noRootType": "error",
|
|
@@ -331,8 +334,10 @@
|
|
|
331
334
|
"noUselessReturn": "error",
|
|
332
335
|
"noUselessTypeConversion": "error",
|
|
333
336
|
"noVueArrowFuncInWatch": "error",
|
|
337
|
+
"noVueImportCompilerMacros": "error",
|
|
334
338
|
"noVueOptionsApi": "error",
|
|
335
339
|
"noVueRefAsOperand": "error",
|
|
340
|
+
"noVueVOnNumberValues": "error",
|
|
336
341
|
"useArraySome": "error",
|
|
337
342
|
"useArraySortCompare": "error",
|
|
338
343
|
"useBaseline": "error",
|
|
@@ -355,6 +360,7 @@
|
|
|
355
360
|
"useInputName": "error",
|
|
356
361
|
"useLoneAnonymousOperation": "error",
|
|
357
362
|
"useLoneExecutableDefinition": "error",
|
|
363
|
+
"useMathMinMax": "error",
|
|
358
364
|
"useNamedCaptureGroup": "error",
|
|
359
365
|
"useNullishCoalescing": "error",
|
|
360
366
|
"usePlaywrightValidDescribeCallback": "error",
|
|
@@ -368,13 +374,18 @@
|
|
|
368
374
|
"useScopedStyles": "error",
|
|
369
375
|
"useSpread": "error",
|
|
370
376
|
"useStringStartsEndsWith": "error",
|
|
377
|
+
"useTestHooksInOrder": "error",
|
|
378
|
+
"useTestHooksOnTop": "error",
|
|
379
|
+
"useThisInClassMethods": "error",
|
|
371
380
|
"useUnicodeRegex": "error",
|
|
372
381
|
"useVarsOnTop": "error",
|
|
373
382
|
"useVueConsistentDefinePropsDeclaration": "error",
|
|
374
383
|
"useVueConsistentVBindStyle": "error",
|
|
375
384
|
"useVueConsistentVOnStyle": "error",
|
|
385
|
+
"useVueNextTickPromise": "error",
|
|
376
386
|
"useVueValidTemplateRoot": "error",
|
|
377
387
|
"useVueValidVCloak": "error",
|
|
388
|
+
"useVueValidVFor": "error",
|
|
378
389
|
"useVueValidVOnce": "error",
|
|
379
390
|
"useVueValidVPre": "error",
|
|
380
391
|
"useVueVapor": "error",
|
package/dist/configs/knip.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"knip.js","names":[],"sources":["../../src/configs/knip.ts"],"sourcesContent":["import type { KnipConfig } from \"knip\"\n\nimport type { OptionalMergeConfigFn } from \"../utils.ts\"\nimport { createMergeConfigFn } from \"../utils.ts\"\n\n// Normally, specifying the `./src/index.ts` entry would cause knip to complain about a redundant entry because it gets automatically included via the tsdown plugin.\n// However, in projects that _don't_ use tsdown, the `./src/index.ts` entry would be missing entirely.\n// To handle this, we specify it and disable the tsdown plugin. This makes knip work in both cases.\n\nexport const DEFAULT_ENTRIES = [\"./src/index.ts\", \"**/*.test.ts\", \"./tsdown.config.ts\"]\n\nconst baseConfig = {\n entry: DEFAULT_ENTRIES,\n project: [\"**\"],\n tsdown: false,\n} as const satisfies KnipConfig\n\nexport const knipConfig: OptionalMergeConfigFn<KnipConfig, typeof baseConfig> = createMergeConfigFn(baseConfig)\n"],"mappings":";AAiBA,MAAa,aAAmE,oBAAoB;CALlG,OAAO;EAHuB;EAAkB;EAAgB;
|
|
1
|
+
{"version":3,"file":"knip.js","names":[],"sources":["../../src/configs/knip.ts"],"sourcesContent":["import type { KnipConfig } from \"knip\"\n\nimport type { OptionalMergeConfigFn } from \"../utils.ts\"\nimport { createMergeConfigFn } from \"../utils.ts\"\n\n// Normally, specifying the `./src/index.ts` entry would cause knip to complain about a redundant entry because it gets automatically included via the tsdown plugin.\n// However, in projects that _don't_ use tsdown, the `./src/index.ts` entry would be missing entirely.\n// To handle this, we specify it and disable the tsdown plugin. This makes knip work in both cases.\n\nexport const DEFAULT_ENTRIES = [\"./src/index.ts\", \"**/*.test.ts\", \"./tsdown.config.ts\"]\n\nconst baseConfig = {\n entry: DEFAULT_ENTRIES,\n project: [\"**\"],\n tsdown: false,\n} as const satisfies KnipConfig\n\nexport const knipConfig: OptionalMergeConfigFn<KnipConfig, typeof baseConfig> = createMergeConfigFn(baseConfig)\n"],"mappings":";AAiBA,MAAa,aAAmE,oBAAoB;CALlG,OAAO;EAHuB;EAAkB;EAAgB;CAGzD;CACP,SAAS,CAAC,IAAI;CACd,QAAQ;AAG0F,CAAU"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tsdown.d.ts","names":[],"sources":["../../src/configs/tsdown.ts"],"mappings":";;;;;KAOK,gBAAA,GAAmB,
|
|
1
|
+
{"version":3,"file":"tsdown.d.ts","names":[],"sources":["../../src/configs/tsdown.ts"],"mappings":";;;;;KAOK,gBAAA,GAAmB,WAAW,CAAC,UAAA;AAAA,cAE9B,UAAA;EAAA;;;;;;;;;;;;;;;;;;;;cAsBA,SAAA;EAAA;;;;;;;;;;;;;;;;cAWO,YAAA,EAAc,aAAA,CAAc,gBAAA,SAAyB,UAAA;AAAA,cACrD,eAAA,EAAiB,qBAAA,CAAsB,UAAA,SAAmB,SAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tsdown.js","names":[],"sources":["../../src/configs/tsdown.ts"],"sourcesContent":["import type { UserConfig } from \"tsdown\"\nimport type { SetRequired } from \"type-fest\"\n\nimport type { MergeConfigFn, OptionalMergeConfigFn } from \"../utils.ts\"\nimport { createMergeConfigFn } from \"../utils.ts\"\n\n// force projects to specify platform\ntype StrictUserConfig = SetRequired<UserConfig, \"platform\">\n\nconst baseConfig = {\n entry: [\"./src/index.ts\"],\n unbundle: true,\n target: false,\n platform: \"neutral\",\n fixedExtension: false,\n minify: \"dce-only\",\n sourcemap: true,\n hash: false,\n dts: {\n resolver: \"tsc\",\n newContext: true,\n sourcemap: true,\n },\n attw: {\n level: \"error\",\n profile: \"esm-only\",\n },\n publint: true,\n failOnWarn: true,\n} as const satisfies StrictUserConfig\n\nconst binConfig = {\n ...baseConfig,\n entry: [],\n platform: \"node\",\n outExtensions: () => ({ js: \"\" }),\n unbundle: false,\n sourcemap: false,\n dts: false,\n attw: false,\n} as const satisfies UserConfig\n\nexport const tsdownConfig: MergeConfigFn<StrictUserConfig, typeof baseConfig> = createMergeConfigFn(baseConfig)\nexport const tsdownBinConfig: OptionalMergeConfigFn<UserConfig, typeof binConfig> = createMergeConfigFn(binConfig)\n"],"mappings":";;AASA,MAAM,aAAa;CACjB,OAAO,CAAC,
|
|
1
|
+
{"version":3,"file":"tsdown.js","names":[],"sources":["../../src/configs/tsdown.ts"],"sourcesContent":["import type { UserConfig } from \"tsdown\"\nimport type { SetRequired } from \"type-fest\"\n\nimport type { MergeConfigFn, OptionalMergeConfigFn } from \"../utils.ts\"\nimport { createMergeConfigFn } from \"../utils.ts\"\n\n// force projects to specify platform\ntype StrictUserConfig = SetRequired<UserConfig, \"platform\">\n\nconst baseConfig = {\n entry: [\"./src/index.ts\"],\n unbundle: true,\n target: false,\n platform: \"neutral\",\n fixedExtension: false,\n minify: \"dce-only\",\n sourcemap: true,\n hash: false,\n dts: {\n resolver: \"tsc\",\n newContext: true,\n sourcemap: true,\n },\n attw: {\n level: \"error\",\n profile: \"esm-only\",\n },\n publint: true,\n failOnWarn: true,\n} as const satisfies StrictUserConfig\n\nconst binConfig = {\n ...baseConfig,\n entry: [],\n platform: \"node\",\n outExtensions: () => ({ js: \"\" }),\n unbundle: false,\n sourcemap: false,\n dts: false,\n attw: false,\n} as const satisfies UserConfig\n\nexport const tsdownConfig: MergeConfigFn<StrictUserConfig, typeof baseConfig> = createMergeConfigFn(baseConfig)\nexport const tsdownBinConfig: OptionalMergeConfigFn<UserConfig, typeof binConfig> = createMergeConfigFn(binConfig)\n"],"mappings":";;AASA,MAAM,aAAa;CACjB,OAAO,CAAC,gBAAgB;CACxB,UAAU;CACV,QAAQ;CACR,UAAU;CACV,gBAAgB;CAChB,QAAQ;CACR,WAAW;CACX,MAAM;CACN,KAAK;EACH,UAAU;EACV,YAAY;EACZ,WAAW;CACb;CACA,MAAM;EACJ,OAAO;EACP,SAAS;CACX;CACA,SAAS;CACT,YAAY;AACd;AAEA,MAAM,YAAY;CAChB,GAAG;CACH,OAAO,CAAC;CACR,UAAU;CACV,sBAAsB,EAAE,IAAI,GAAG;CAC/B,UAAU;CACV,WAAW;CACX,KAAK;CACL,MAAM;AACR;AAEA,MAAa,eAAmE,oBAAoB,UAAU;AAC9G,MAAa,kBAAuE,oBAAoB,SAAS"}
|
package/dist/utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","names":[],"sources":["../src/utils.ts"],"sourcesContent":["import { mergeWith } from \"es-toolkit\"\nimport { clone } from \"remeda\"\nimport type { MergeDeep } from \"type-fest\"\n\ntype AnyObj = object\n\n/**\n * A wrapper around es-toolkit's `mergeWith` with a custom merge function that concatenates arrays.\n */\nfunction merge<T extends AnyObj, S extends AnyObj>(target: T, source: S): T & S {\n return mergeWith(target, source, (objValue: unknown, srcValue: unknown) =>\n Array.isArray(objValue) ? objValue.concat(srcValue) : undefined,\n )\n}\n\n/**\n * The merge config function, where the `UserConfig` passed in is merged with `BaseConfig`.\n */\nexport interface MergeConfigFn<UserConfig, BaseConfig> {\n // biome-ignore lint/style/useShorthandFunctionType: need to use call signature type\n <UserConfigToMerge extends UserConfig>(\n userConfig: UserConfigToMerge,\n ): MergeDeep<BaseConfig, UserConfigToMerge, { arrayMergeMode: \"spread\" }>\n // instead of returning `BaseConfig & UserConfig` (from `merge`), return a more friendly type using `MergeDeep`\n}\n\n/**\n * The optional merge config function, where the `userConfig` argument is optional.\n * - if `UserConfig` is not provided, the return type is `BaseConfig`\n * - if `UserConfig` is provided, the return type is the merged type of `BaseConfig` and `UserConfig`.\n *\n * Note that this extends `MergeConfigFn`, so this type has both function signatures on it.\n */\nexport interface OptionalMergeConfigFn<UserConfig, BaseConfig> extends MergeConfigFn<UserConfig, BaseConfig> {\n (): BaseConfig\n}\n\n/**\n * Creates a config merge function with proper type overloads for merging with a base config.\n */\nexport function createMergeConfigFn<UserConfig extends AnyObj, BaseConfig extends UserConfig>(baseConfig: BaseConfig) {\n // we don't care about the specific type of userConfig here because we assert mergeConfigFn as the correct type below\n const mergeConfigFn = (userConfig?: AnyObj) => {\n if (userConfig === undefined) return baseConfig\n // clone both target and source so we never mutate the original objects\n return merge(clone(baseConfig), clone(userConfig))\n }\n\n return mergeConfigFn as MergeConfigFn<UserConfig, BaseConfig> & OptionalMergeConfigFn<UserConfig, BaseConfig>\n}\n"],"mappings":";;;;;;AASA,SAAS,MAA0C,QAAW,QAAkB;
|
|
1
|
+
{"version":3,"file":"utils.js","names":[],"sources":["../src/utils.ts"],"sourcesContent":["import { mergeWith } from \"es-toolkit\"\nimport { clone } from \"remeda\"\nimport type { MergeDeep } from \"type-fest\"\n\ntype AnyObj = object\n\n/**\n * A wrapper around es-toolkit's `mergeWith` with a custom merge function that concatenates arrays.\n */\nfunction merge<T extends AnyObj, S extends AnyObj>(target: T, source: S): T & S {\n return mergeWith(target, source, (objValue: unknown, srcValue: unknown) =>\n Array.isArray(objValue) ? objValue.concat(srcValue) : undefined,\n )\n}\n\n/**\n * The merge config function, where the `UserConfig` passed in is merged with `BaseConfig`.\n */\nexport interface MergeConfigFn<UserConfig, BaseConfig> {\n // biome-ignore lint/style/useShorthandFunctionType: need to use call signature type\n <UserConfigToMerge extends UserConfig>(\n userConfig: UserConfigToMerge,\n ): MergeDeep<BaseConfig, UserConfigToMerge, { arrayMergeMode: \"spread\" }>\n // instead of returning `BaseConfig & UserConfig` (from `merge`), return a more friendly type using `MergeDeep`\n}\n\n/**\n * The optional merge config function, where the `userConfig` argument is optional.\n * - if `UserConfig` is not provided, the return type is `BaseConfig`\n * - if `UserConfig` is provided, the return type is the merged type of `BaseConfig` and `UserConfig`.\n *\n * Note that this extends `MergeConfigFn`, so this type has both function signatures on it.\n */\nexport interface OptionalMergeConfigFn<UserConfig, BaseConfig> extends MergeConfigFn<UserConfig, BaseConfig> {\n (): BaseConfig\n}\n\n/**\n * Creates a config merge function with proper type overloads for merging with a base config.\n */\nexport function createMergeConfigFn<UserConfig extends AnyObj, BaseConfig extends UserConfig>(baseConfig: BaseConfig) {\n // we don't care about the specific type of userConfig here because we assert mergeConfigFn as the correct type below\n const mergeConfigFn = (userConfig?: AnyObj) => {\n if (userConfig === undefined) return baseConfig\n // clone both target and source so we never mutate the original objects\n return merge(clone(baseConfig), clone(userConfig))\n }\n\n return mergeConfigFn as MergeConfigFn<UserConfig, BaseConfig> & OptionalMergeConfigFn<UserConfig, BaseConfig>\n}\n"],"mappings":";;;;;;AASA,SAAS,MAA0C,QAAW,QAAkB;CAC9E,OAAO,UAAU,QAAQ,SAAS,UAAmB,aACnD,MAAM,QAAQ,QAAQ,IAAI,SAAS,OAAO,QAAQ,IAAI,KAAA,CACxD;AACF;;;;AA2BA,SAAgB,oBAA8E,YAAwB;CAEpH,MAAM,iBAAiB,eAAwB;EAC7C,IAAI,eAAe,KAAA,GAAW,OAAO;EAErC,OAAO,MAAM,MAAM,UAAU,GAAG,MAAM,UAAU,CAAC;CACnD;CAEA,OAAO;AACT"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adamhl8/configs",
|
|
3
|
-
"version": "0.19.
|
|
3
|
+
"version": "0.19.4",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -39,18 +39,18 @@
|
|
|
39
39
|
"typescript": "^6.0.0"
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"es-toolkit": "^1.
|
|
43
|
-
"remeda": "^2.
|
|
44
|
-
"type-fest": "^5.
|
|
42
|
+
"es-toolkit": "^1.47.0",
|
|
43
|
+
"remeda": "^2.39.0",
|
|
44
|
+
"type-fest": "^5.7.0"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
|
-
"@arethetypeswrong/core": "^0.18.
|
|
48
|
-
"@biomejs/biome": "^2.4.
|
|
49
|
-
"@types/bun": "^1.3.
|
|
50
|
-
"knip": "^6.
|
|
47
|
+
"@arethetypeswrong/core": "^0.18.3",
|
|
48
|
+
"@biomejs/biome": "^2.4.16",
|
|
49
|
+
"@types/bun": "^1.3.14",
|
|
50
|
+
"knip": "^6.16.1",
|
|
51
51
|
"markdown-toc": "^1.2.0",
|
|
52
|
-
"publint": "^0.3.
|
|
53
|
-
"tsdown": "^0.
|
|
52
|
+
"publint": "^0.3.21",
|
|
53
|
+
"tsdown": "^0.22.2",
|
|
54
54
|
"typescript": "^6.0.3"
|
|
55
55
|
},
|
|
56
56
|
"publishConfig": {
|