@adamhl8/configs 0.15.23 → 0.15.24
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/dist/knip-preprocessor.js +7 -0
- package/dist/knip-preprocessor.js.map +1 -1
- package/dist/knip.d.ts +1155 -5
- package/dist/knip.d.ts.map +1 -1
- package/dist/knip.js.map +1 -1
- package/dist/prettier.d.ts +42 -5
- package/dist/prettier.d.ts.map +1 -1
- package/dist/prettier.js.map +1 -1
- package/dist/tsdown.d.ts +68 -10
- package/dist/tsdown.d.ts.map +1 -1
- package/dist/tsdown.js.map +1 -1
- package/dist/utils.d.ts +20 -6
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +4 -5
- package/dist/utils.js.map +1 -1
- package/package.json +1 -1
|
@@ -15,6 +15,13 @@ const preprocess = (options) => {
|
|
|
15
15
|
options.configurationHints = new Set(filteredConfigurationHints);
|
|
16
16
|
filterIssues(options, "unlisted", ([key]) => !key.includes("prettier"));
|
|
17
17
|
filterIssues(options, "unlisted", ([, issueObj]) => Object.keys(issueObj).length > 0);
|
|
18
|
+
filterIssues(options, "types", ([key, issueObj]) => {
|
|
19
|
+
if (key !== "src/utils.ts") return true;
|
|
20
|
+
const typeNames = Object.keys(issueObj);
|
|
21
|
+
const expectedTypeNames = ["MergeConfigFn", "OptionalMergeConfigFn"];
|
|
22
|
+
if (typeNames.length !== expectedTypeNames.length) return true;
|
|
23
|
+
return !expectedTypeNames.every((expectedTypeName) => typeNames.includes(expectedTypeName));
|
|
24
|
+
});
|
|
18
25
|
return options;
|
|
19
26
|
};
|
|
20
27
|
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\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"}
|
|
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 filterIssues(options, \"types\", ([key, issueObj]) => {\n if (key !== \"src/utils.ts\") return true\n const typeNames = Object.keys(issueObj)\n // We need to bring these types into scope of each merge config module: https://github.com/microsoft/TypeScript/issues/5711\n const expectedTypeNames = [\"MergeConfigFn\", \"OptionalMergeConfigFn\"]\n if (typeNames.length !== expectedTypeNames.length) return true // don't filter out the issue if there are other types\n const foundAllExpectedTypeNames = expectedTypeNames.every((expectedTypeName) =>\n typeNames.includes(expectedTypeName),\n )\n const shouldFilterIssue = !foundAllExpectedTypeNames // if all the expected type names are found, we need to return false to filter out the issue\n return shouldFilterIssue\n })\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,cAAa,SAAS,UAAU,CAAC,KAAK,cAAc;AAClD,MAAI,QAAQ,eAAgB,QAAO;EACnC,MAAM,YAAY,OAAO,KAAK,SAAS;EAEvC,MAAM,oBAAoB,CAAC,iBAAiB,wBAAwB;AACpE,MAAI,UAAU,WAAW,kBAAkB,OAAQ,QAAO;AAK1D,SAD0B,CAHQ,kBAAkB,OAAO,qBACzD,UAAU,SAAS,iBAAiB,CACrC;GAGD;AAEF,QAAO;;AAGT,IAAA,4BAAe"}
|