@adamhl8/configs 0.15.19 → 0.15.20
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/README.md +0 -7
- package/dist/biome.base.json +0 -1
- package/dist/knip-preprocessor.d.ts.map +1 -1
- package/dist/knip-preprocessor.js +3 -3
- package/dist/knip-preprocessor.js.map +1 -1
- package/dist/knip.d.ts.map +1 -1
- package/dist/knip.js.map +1 -1
- package/dist/prettier.d.ts.map +1 -1
- package/dist/prettier.js.map +1 -1
- package/dist/tsdown.d.ts.map +1 -1
- package/dist/tsdown.js.map +1 -1
- package/package.json +3 -4
- package/dist/biome-plugins/import-paths.grit +0 -13
package/README.md
CHANGED
|
@@ -35,13 +35,6 @@ bun add -D @adamhl8/configs
|
|
|
35
35
|
},
|
|
36
36
|
```
|
|
37
37
|
|
|
38
|
-
```jsonc
|
|
39
|
-
// https://github.com/biomejs/biome/issues/6676 - Plugins are resolved relative to the *root* config, not the config specifying the plugin
|
|
40
|
-
// Extending this config from the root config of this project causes an error because the plugin files do not exist in 'node_modules'. i.e. the whole 'node_modules/@adamhl8/configs' directory doesn't exist because that's *this* project (we don't install this project in itself)
|
|
41
|
-
// As a workaround, we use the prepare script to manually copy the './src/biome-plugins/' directory to the correct location in 'node_modules'.
|
|
42
|
-
"plugins": ["./node_modules/@adamhl8/configs/dist/biome-plugins/import-paths.grit"],
|
|
43
|
-
```
|
|
44
|
-
|
|
45
38
|
### knip
|
|
46
39
|
|
|
47
40
|
```ts
|
package/dist/biome.base.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"knip-preprocessor.d.ts","names":[],"sources":["../src/knip-preprocessor.ts"],"sourcesContent":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"knip-preprocessor.d.ts","names":[],"sources":["../src/knip-preprocessor.ts"],"sourcesContent":[],"mappings":";;;cA4BM,YAAY"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { knipConfig } from "./knip.js";
|
|
2
2
|
import "./index.js";
|
|
3
3
|
const entries = knipConfig().entry;
|
|
4
|
-
function
|
|
4
|
+
function filterIssues(options, issueType, filter) {
|
|
5
5
|
const issuesObject = options.issues[issueType];
|
|
6
6
|
const filteredIssues = Object.fromEntries(Object.entries(issuesObject).filter(filter));
|
|
7
7
|
const issueCount = Object.keys(issuesObject).length;
|
|
@@ -13,8 +13,8 @@ function filterIssue(options, issueType, filter) {
|
|
|
13
13
|
const preprocess = (options) => {
|
|
14
14
|
const filteredConfigurationHints = [...options.configurationHints].filter((hint) => !(entries.some((entry) => typeof hint.identifier === "string" && hint.identifier.includes(entry)) && hint.type === "entry-empty"));
|
|
15
15
|
options.configurationHints = new Set(filteredConfigurationHints);
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
filterIssues(options, "unlisted", ([key]) => !key.includes("prettier"));
|
|
17
|
+
filterIssues(options, "unlisted", ([, issueObj]) => Object.keys(issueObj).length > 0);
|
|
18
18
|
return options;
|
|
19
19
|
};
|
|
20
20
|
var knip_preprocessor_default = preprocess;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"knip-preprocessor.js","names":["preprocess: Preprocessor"],"sources":["../src/knip-preprocessor.ts"],"sourcesContent":["import type { Preprocessor, ReporterOptions } from \"knip\"\nimport type { Issue, SymbolIssueType } from \"knip/dist/types/issues\"\n\
|
|
1
|
+
{"version":3,"file":"knip-preprocessor.js","names":["preprocess: Preprocessor"],"sources":["../src/knip-preprocessor.ts"],"sourcesContent":["import type { Preprocessor, ReporterOptions } from \"knip\"\nimport type { Issue, SymbolIssueType } from \"knip/dist/types/issues\"\n\nimport { knipConfig } from \"./index.ts\"\n\nconst entries = knipConfig().entry as string[]\n\n/**\n * Filters issues based on the provided filter function.\n *\n * This is needed because we also need to update `options.counters` after filtering issues.\n */\nfunction filterIssues(\n options: ReporterOptions,\n issueType: SymbolIssueType,\n filter: (issueEntry: [string, Record<string, Issue>]) => boolean,\n) {\n const issuesObject = options.issues[issueType]\n const filteredIssues = Object.fromEntries(Object.entries(issuesObject).filter(filter))\n\n const issueCount = Object.keys(issuesObject).length\n const filteredIssueCount = Object.keys(filteredIssues).length\n const issuesRemovedCount = issueCount - filteredIssueCount\n\n options.counters[issueType] = issueCount - issuesRemovedCount\n options.issues[issueType] = filteredIssues\n}\n\nconst preprocess: Preprocessor = (options) => {\n // ignore the \"Refine entry pattern (no matches)\" configuration hints for entries in the base config\n const filteredConfigurationHints = [...options.configurationHints].filter(\n (hint) =>\n !(\n entries.some((entry) => typeof hint.identifier === \"string\" && hint.identifier.includes(entry)) &&\n hint.type === \"entry-empty\"\n ),\n )\n options.configurationHints = new Set(filteredConfigurationHints)\n\n filterIssues(options, \"unlisted\", ([key]) => !key.includes(\"prettier\"))\n filterIssues(options, \"unlisted\", ([, issueObj]) => Object.keys(issueObj).length > 0)\n\n return options\n}\n\nexport default preprocess\n"],"mappings":";;AAKA,MAAM,UAAU,YAAY,CAAC;AAO7B,SAAS,aACP,SACA,WACA,QACA;CACA,MAAM,eAAe,QAAQ,OAAO;CACpC,MAAM,iBAAiB,OAAO,YAAY,OAAO,QAAQ,aAAa,CAAC,OAAO,OAAO,CAAC;CAEtF,MAAM,aAAa,OAAO,KAAK,aAAa,CAAC;CAC7C,MAAM,qBAAqB,OAAO,KAAK,eAAe,CAAC;CACvD,MAAM,qBAAqB,aAAa;AAExC,SAAQ,SAAS,aAAa,aAAa;AAC3C,SAAQ,OAAO,aAAa;;AAG9B,MAAMA,cAA4B,YAAY;CAE5C,MAAM,6BAA6B,CAAC,GAAG,QAAQ,mBAAmB,CAAC,QAChE,SACC,EACE,QAAQ,MAAM,UAAU,OAAO,KAAK,eAAe,YAAY,KAAK,WAAW,SAAS,MAAM,CAAC,IAC/F,KAAK,SAAS,eAEnB;AACD,SAAQ,qBAAqB,IAAI,IAAI,2BAA2B;AAEhE,cAAa,SAAS,aAAa,CAAC,SAAS,CAAC,IAAI,SAAS,WAAW,CAAC;AACvE,cAAa,SAAS,aAAa,GAAG,cAAc,OAAO,KAAK,SAAS,CAAC,SAAS,EAAE;AAErF,QAAO;;AAGT,IAAA,4BAAe"}
|
package/dist/knip.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"knip.d.ts","names":[],"sources":["../src/knip.ts"],"sourcesContent":[],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"knip.d.ts","names":[],"sources":["../src/knip.ts"],"sourcesContent":[],"mappings":";;;;cASM;;EAAA,SAAA,OAIyB,EAAA,CAAA,IAAA,CAAA;EAElB,SAAA,MAA0F,EAAA,KAAA;CAAA;AAAhE,cAA1B,UAA0B,EAAd,aAAc,CAAA,UAAA,EAAA,OAAmB,UAAnB,CAAA"}
|
package/dist/knip.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"knip.js","names":["knipConfig: MergeConfigFn<KnipConfig, typeof baseConfig>"],"sources":["../src/knip.ts"],"sourcesContent":["import type { KnipConfig } from \"knip\"\n\
|
|
1
|
+
{"version":3,"file":"knip.js","names":["knipConfig: MergeConfigFn<KnipConfig, typeof baseConfig>"],"sources":["../src/knip.ts"],"sourcesContent":["import type { KnipConfig } from \"knip\"\n\nimport type { MergeConfigFn } 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\nconst baseConfig = {\n entry: [\"./src/index.ts\", \"**/*.test.ts\", \"./tsdown.config.ts\"],\n project: [\"**\"],\n tsdown: false,\n} as const satisfies KnipConfig\n\nexport const knipConfig: MergeConfigFn<KnipConfig, typeof baseConfig> = createMergeConfigFn(baseConfig)\n"],"mappings":";AAeA,MAAaA,aAA2D,oBANrD;CACjB,OAAO;EAAC;EAAkB;EAAgB;EAAqB;CAC/D,SAAS,CAAC,KAAK;CACf,QAAQ;CACT,CAEsG"}
|
package/dist/prettier.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prettier.d.ts","names":[],"sources":["../src/prettier.ts"],"sourcesContent":[],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"prettier.d.ts","names":[],"sources":["../src/prettier.ts"],"sourcesContent":[],"mappings":";;;;cAKM;;EAAA,SAAA,IA0BqB,EAAA,KAAA;EAEd,SAAA,OAAA,EAA0F,CAAA,sBAAA,EAAA,oBAAA,EAAA,sBAAA,EAAA,uBAAA,EAAA,6BAAA,CAAA;EAAA,SAAA,kBAAA,EAAA,kBAAA;WAA5D,SAAA,EAAA,CAAA;IAAe,SAAA,KAAA,EAAA,SAAA;IAA7B,SAAA,OAAA,EAAA;MAAa,SAAA,aAAA,EAAA,MAAA;;;;;;;;;cAA7B,gBAAgB,cAAc,eAAe"}
|
package/dist/prettier.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prettier.js","names":["prettierConfig: MergeConfigFn<Config, typeof baseConfig>"],"sources":["../src/prettier.ts"],"sourcesContent":["import type { Config } from \"prettier\"\n\
|
|
1
|
+
{"version":3,"file":"prettier.js","names":["prettierConfig: MergeConfigFn<Config, typeof baseConfig>"],"sources":["../src/prettier.ts"],"sourcesContent":["import type { Config } from \"prettier\"\n\nimport type { MergeConfigFn } from \"./utils.ts\"\nimport { createMergeConfigFn } from \"./utils.ts\"\n\nconst baseConfig = {\n printWidth: 120,\n semi: false,\n plugins: [\n \"@prettier/plugin-xml\",\n \"prettier-plugin-sh\",\n \"prettier-plugin-toml\",\n \"prettier-plugin-astro\",\n \"prettier-plugin-tailwindcss\",\n ],\n tailwindStylesheet: \"./src/global.css\",\n overrides: [\n {\n // https://github.com/prettier/prettier/issues/15956\n files: \"*.jsonc\",\n options: {\n trailingComma: \"none\",\n },\n },\n {\n files: \"*.astro\",\n options: {\n parser: \"astro\",\n },\n },\n ],\n} as const satisfies Config\n\nexport const prettierConfig: MergeConfigFn<Config, typeof baseConfig> = createMergeConfigFn(baseConfig)\n"],"mappings":";AAiCA,MAAaA,iBAA2D,oBA5BrD;CACjB,YAAY;CACZ,MAAM;CACN,SAAS;EACP;EACA;EACA;EACA;EACA;EACD;CACD,oBAAoB;CACpB,WAAW,CACT;EAEE,OAAO;EACP,SAAS,EACP,eAAe,QAChB;EACF,EACD;EACE,OAAO;EACP,SAAS,EACP,QAAQ,SACT;EACF,CACF;CACF,CAEsG"}
|
package/dist/tsdown.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tsdown.d.ts","names":[],"sources":["../src/tsdown.ts"],"sourcesContent":[],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"tsdown.d.ts","names":[],"sources":["../src/tsdown.ts"],"sourcesContent":[],"mappings":";;;;cAKM;;EAAA,SAAA,QAkByB,EAAA,IAAA;EAEzB,SAAA,MAWyB,EAAA,KAAA;EAElB,SAAA,QAA4F,EAAA,SAAA;EAAA,SAAA,MAAA,EAAA,UAAA;WAAhE,SAAA,EAAA,IAAA;WAAmB,IAAA,EAAA,KAAA;WAAjC,GAAA,EAAA;IAAa,SAAA,UAAA,EAAA,IAAA;IAC3B,SAAA,SAA6F,EAAA,IAAA;EAAA,CAAA;WAA9D,IAAA,EAAA;IAAmB,SAAA,KAAA,EAAA,OAAA;IAAjC,SAAA,OAAA,EAAA,SAAA;EAAa,CAAA;;;;cAdrC;;;;;;;;;;;;;;;;;cAaO,cAAc,cAAc,mBAAmB;cAC/C,iBAAiB,cAAc,mBAAmB"}
|
package/dist/tsdown.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tsdown.js","names":["tsdownConfig: MergeConfigFn<UserConfig, typeof baseConfig>","tsdownBinConfig: MergeConfigFn<UserConfig, typeof binConfig>"],"sources":["../src/tsdown.ts"],"sourcesContent":["import type { UserConfig } from \"tsdown\"\n\
|
|
1
|
+
{"version":3,"file":"tsdown.js","names":["tsdownConfig: MergeConfigFn<UserConfig, typeof baseConfig>","tsdownBinConfig: MergeConfigFn<UserConfig, typeof binConfig>"],"sources":["../src/tsdown.ts"],"sourcesContent":["import type { UserConfig } from \"tsdown\"\n\nimport type { MergeConfigFn } from \"./utils.ts\"\nimport { createMergeConfigFn } from \"./utils.ts\"\n\nconst baseConfig = {\n entry: [\"./src/index.ts\"],\n unbundle: true,\n target: false,\n platform: \"neutral\",\n minify: \"dce-only\",\n sourcemap: true,\n hash: false,\n dts: {\n newContext: true,\n sourcemap: true,\n },\n attw: {\n level: \"error\",\n profile: \"esmOnly\",\n },\n publint: true,\n failOnWarn: true,\n} as const satisfies UserConfig\n\nconst binConfig = {\n ...baseConfig,\n entry: [],\n platform: \"node\",\n outExtensions: () => ({ js: \"\" }),\n copy: [],\n unbundle: false,\n sourcemap: false,\n dts: false,\n attw: false,\n publint: false,\n} as const satisfies UserConfig\n\nexport const tsdownConfig: MergeConfigFn<UserConfig, typeof baseConfig> = createMergeConfigFn(baseConfig)\nexport const tsdownBinConfig: MergeConfigFn<UserConfig, typeof binConfig> = createMergeConfigFn(binConfig)\n"],"mappings":";AAKA,MAAM,aAAa;CACjB,OAAO,CAAC,iBAAiB;CACzB,UAAU;CACV,QAAQ;CACR,UAAU;CACV,QAAQ;CACR,WAAW;CACX,MAAM;CACN,KAAK;EACH,YAAY;EACZ,WAAW;EACZ;CACD,MAAM;EACJ,OAAO;EACP,SAAS;EACV;CACD,SAAS;CACT,YAAY;CACb;AAED,MAAM,YAAY;CAChB,GAAG;CACH,OAAO,EAAE;CACT,UAAU;CACV,sBAAsB,EAAE,IAAI,IAAI;CAChC,MAAM,EAAE;CACR,UAAU;CACV,WAAW;CACX,KAAK;CACL,MAAM;CACN,SAAS;CACV;AAED,MAAaA,eAA6D,oBAAoB,WAAW;AACzG,MAAaC,kBAA+D,oBAAoB,UAAU"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adamhl8/configs",
|
|
3
|
-
"version": "0.15.
|
|
3
|
+
"version": "0.15.20",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -31,7 +31,6 @@
|
|
|
31
31
|
"scripts": {
|
|
32
32
|
"bundle": "bun lint && tsdown",
|
|
33
33
|
"lint": "bun ./generate-biome-rules.ts && markdown-toc -i --bullets '-' --maxdepth 3 ./README.md && tsc --noEmit && biome check --write && ./src/adamhl8-knip.ts",
|
|
34
|
-
"postinstall": "mkdir -p ./node_modules/@adamhl8/configs/dist/ && cp -r ./src/biome-plugins/ ./node_modules/@adamhl8/configs/dist/",
|
|
35
34
|
"prepare": "find .githooks -type f -exec ln -srf {} .git/hooks/ \\; || true",
|
|
36
35
|
"prepublishOnly": "bun bundle"
|
|
37
36
|
},
|
|
@@ -42,7 +41,7 @@
|
|
|
42
41
|
"prettier-plugin-sh": "^0.18.0",
|
|
43
42
|
"prettier-plugin-tailwindcss": "^0.6.14",
|
|
44
43
|
"prettier-plugin-toml": "^2.0.6",
|
|
45
|
-
"remeda": "^2.
|
|
44
|
+
"remeda": "^2.32.0",
|
|
46
45
|
"type-fest": "^5.0.0"
|
|
47
46
|
},
|
|
48
47
|
"devDependencies": {
|
|
@@ -52,7 +51,7 @@
|
|
|
52
51
|
"knip": "^5.63.1",
|
|
53
52
|
"markdown-toc": "^1.2.0",
|
|
54
53
|
"prettier": "^3.6.2",
|
|
55
|
-
"publint": "^0.3.
|
|
54
|
+
"publint": "^0.3.13",
|
|
56
55
|
"tsdown": "^0.15.2",
|
|
57
56
|
"typescript": "^5.9.2"
|
|
58
57
|
},
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
predicate is_relative_import($source) { $source <: r"^\"\.\.?.*" }
|
|
2
|
-
predicate register_diagnostic($span, $message) {}
|
|
3
|
-
predicate register_import_diagnostic($source) {
|
|
4
|
-
register_diagnostic(span=$source, message="This relative import should use a path alias")
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
any {
|
|
8
|
-
`import $_ from $source` where { is_relative_import($source), register_import_diagnostic($source) },
|
|
9
|
-
`import type $_ from $source` where { is_relative_import($source), register_import_diagnostic($source) },
|
|
10
|
-
// https://github.com/honeycombio/gritql/issues/653
|
|
11
|
-
`export $_ from $source` as $exportStatement where { log(message="This is a debug log", variable=$exportStatement) },
|
|
12
|
-
`export type $_ from $source` where { is_relative_import($source), register_import_diagnostic($source) }
|
|
13
|
-
}
|