@adamhl8/configs 0.17.13 → 0.18.0
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/configs/biome.base.json +26 -15
- package/dist/configs/knip-preprocessor.d.ts +1 -1
- package/dist/configs/knip-preprocessor.d.ts.map +1 -1
- package/dist/configs/knip-preprocessor.js.map +1 -1
- package/dist/configs/knip.d.ts +1256 -2
- package/dist/configs/knip.d.ts.map +1 -1
- package/dist/configs/knip.js.map +1 -1
- package/dist/configs/tsdown.d.ts +11 -10
- package/dist/configs/tsdown.d.ts.map +1 -1
- package/dist/configs/tsdown.js +1 -1
- package/dist/configs/tsdown.js.map +1 -1
- package/dist/ts-import-fix/index +10 -6
- package/package.json +11 -11
|
@@ -20,6 +20,11 @@
|
|
|
20
20
|
"expand": "auto"
|
|
21
21
|
}
|
|
22
22
|
},
|
|
23
|
+
"css": {
|
|
24
|
+
"parser": {
|
|
25
|
+
"tailwindDirectives": true
|
|
26
|
+
}
|
|
27
|
+
},
|
|
23
28
|
"assist": {
|
|
24
29
|
"enabled": true,
|
|
25
30
|
"actions": {
|
|
@@ -209,29 +214,35 @@
|
|
|
209
214
|
"noContinue": "off",
|
|
210
215
|
"noDeprecatedImports": "error",
|
|
211
216
|
"noDuplicateDependencies": "error",
|
|
217
|
+
"noDuplicatedSpreadProps": "error",
|
|
212
218
|
"noEmptySource": "error",
|
|
219
|
+
"noEqualsToNull": "error",
|
|
213
220
|
"noFloatingPromises": "error",
|
|
214
221
|
"noForIn": "error",
|
|
215
222
|
"noImportCycles": "error",
|
|
216
223
|
"noIncrementDecrement": "off",
|
|
217
224
|
"noJsxLiterals": "off",
|
|
225
|
+
"noLeakedRender": "error",
|
|
218
226
|
"noMisusedPromises": "error",
|
|
227
|
+
"noMultiStr": "error",
|
|
219
228
|
"noNextAsyncClientComponent": "error",
|
|
220
229
|
"noParametersOnlyUsedInRecursion": "error",
|
|
230
|
+
"noProto": "error",
|
|
221
231
|
"noReactForwardRef": "error",
|
|
222
232
|
"noShadow": "error",
|
|
223
233
|
"noSyncScripts": "off",
|
|
234
|
+
"noTernary": "off",
|
|
224
235
|
"noUnknownAttribute": "error",
|
|
225
236
|
"noUnnecessaryConditions": "error",
|
|
226
237
|
"noUnresolvedImports": "off",
|
|
227
238
|
"noUnusedExpressions": "error",
|
|
228
239
|
"noUselessCatchBinding": "error",
|
|
229
240
|
"noUselessUndefined": "error",
|
|
230
|
-
"noVueDataObjectDeclaration": "
|
|
231
|
-
"noVueDuplicateKeys": "
|
|
232
|
-
"noVueReservedKeys": "
|
|
233
|
-
"noVueReservedProps": "
|
|
234
|
-
"noVueVIfWithVFor": "
|
|
241
|
+
"noVueDataObjectDeclaration": "off",
|
|
242
|
+
"noVueDuplicateKeys": "off",
|
|
243
|
+
"noVueReservedKeys": "off",
|
|
244
|
+
"noVueReservedProps": "off",
|
|
245
|
+
"noVueVIfWithVFor": "off",
|
|
235
246
|
"useArraySortCompare": "error",
|
|
236
247
|
"useConsistentArrowReturn": "error",
|
|
237
248
|
"useConsistentGraphqlDescriptions": "error",
|
|
@@ -245,16 +256,16 @@
|
|
|
245
256
|
"useSortedClasses": "error",
|
|
246
257
|
"useSpread": "error",
|
|
247
258
|
"useUniqueGraphqlOperationName": "error",
|
|
248
|
-
"useVueDefineMacrosOrder": "
|
|
249
|
-
"useVueHyphenatedAttributes": "
|
|
250
|
-
"useVueMultiWordComponentNames": "
|
|
251
|
-
"useVueValidVBind": "
|
|
252
|
-
"useVueValidVElse": "
|
|
253
|
-
"useVueValidVElseIf": "
|
|
254
|
-
"useVueValidVHtml": "
|
|
255
|
-
"useVueValidVIf": "
|
|
256
|
-
"useVueValidVOn": "
|
|
257
|
-
"useVueValidVText": "
|
|
259
|
+
"useVueDefineMacrosOrder": "off",
|
|
260
|
+
"useVueHyphenatedAttributes": "off",
|
|
261
|
+
"useVueMultiWordComponentNames": "off",
|
|
262
|
+
"useVueValidVBind": "off",
|
|
263
|
+
"useVueValidVElse": "off",
|
|
264
|
+
"useVueValidVElseIf": "off",
|
|
265
|
+
"useVueValidVHtml": "off",
|
|
266
|
+
"useVueValidVIf": "off",
|
|
267
|
+
"useVueValidVOn": "off",
|
|
268
|
+
"useVueValidVText": "off"
|
|
258
269
|
},
|
|
259
270
|
"performance": {
|
|
260
271
|
"noAccumulatingSpread": "error",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"knip-preprocessor.d.ts","names":[],"sources":["../../src/configs/knip-preprocessor.ts"],"sourcesContent":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"knip-preprocessor.d.ts","names":[],"sources":["../../src/configs/knip-preprocessor.ts"],"sourcesContent":[],"mappings":";;;cAwFM,YAAY"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"knip-preprocessor.js","names":["originalIssues: IssueRecords","modifiedIssues: IssueRecords","preprocess: Preprocessor"],"sources":["../../src/configs/knip-preprocessor.ts"],"sourcesContent":["import type { Preprocessor, ReporterOptions
|
|
1
|
+
{"version":3,"file":"knip-preprocessor.js","names":["originalIssues: IssueRecords","modifiedIssues: IssueRecords","preprocess: Preprocessor"],"sources":["../../src/configs/knip-preprocessor.ts"],"sourcesContent":["import type { IssueRecords, Preprocessor, ReporterOptions, SymbolIssueType } from \"knip/dist/types/issues\"\n\nimport { knipConfig } from \"./knip.ts\"\n\n/*\n * The `IssueRecords` type represents an object where each key is the file path and the value is an object containing each issue object.\n *\n * For example:\n *\n * ```ts\n * {\n * \"path/to/file/with/issues.ts\": {\n * \"issue1\": { ... },\n * \"issue2\": { ... },\n * },\n * // ...\n * }\n * ```\n */\n\n/** The object containing all the issues for the given file path. */\ntype IssueRecord = IssueRecords[keyof IssueRecords]\ntype IssueRecordEntry = [keyof IssueRecord, IssueRecord[keyof IssueRecord]]\n\n/**\n * We transform `IssueRecords` into object entries where where the _value_ is an array of the object entries from each `IssueRecord`.\n *\n * For example, we're going from this:\n *\n * ```ts\n * {\n * \"path/to/file/with/issues.ts\": {\n * \"issue1\": { ... },\n * \"issue2\": { ... },\n * },\n * // ...\n * }\n * ```\n *\n * to this:\n *\n * ```ts\n * [\n * [\"path/to/file/with/issues.ts\", [[\"issue1\", { ... }], [\"issue2\", { ... }]]],\n * // ...\n * ]\n * ```\n */\ntype IssueRecordsEntry = [keyof IssueRecords, IssueRecordEntry[]]\n\n/**\n * Modifies issues based on the provided map function.\n *\n * This is needed because we also need to update `options.counters` after modifying issues.\n */\nfunction modifyIssues(\n options: ReporterOptions,\n issueType: SymbolIssueType,\n mapFn: (issueRecordsEntry: IssueRecordsEntry) => IssueRecordEntry[], // The mapFn should return the entries for the individual issues. We want to make the key (which is the file path) available, but we don't want to allow modification of the key.\n) {\n const originalIssues: IssueRecords = options.issues[issueType]\n const originalIssueEntries: IssueRecordsEntry[] = Object.entries(originalIssues).map(([key, issueRecord]) => [\n key,\n Object.entries(issueRecord),\n ])\n\n const modifiedIssueEntries = originalIssueEntries.map(\n // The map function receives something like `[\"path/to/file.ts\", [[\"issue1\", { ... }], [\"issue2\", { ... }]]]`\n // It then returns *only* the entries for the individual issues: `[[\"issue1\", { ... }], [\"issue2\", { ... }]]`\n ([key, issueRecordEntries]) => [key, Object.fromEntries(mapFn([key, issueRecordEntries]))] as const,\n )\n const modifiedIssues: IssueRecords = Object.fromEntries(modifiedIssueEntries)\n\n const countIssues = (issueRecords: IssueRecords) =>\n Object.values(issueRecords)\n .map((issueRecord) => Object.keys(issueRecord).length) // count the number of issues in each issue record\n .reduce((acc, curr) => acc + curr, 0)\n\n const originalIssueCount = countIssues(originalIssues)\n const modifiedIssueCount = countIssues(modifiedIssues)\n const issuesRemovedCount = originalIssueCount - modifiedIssueCount\n\n options.counters[issueType] = originalIssueCount - issuesRemovedCount\n options.issues[issueType] = modifiedIssues\n}\n\nconst entries = knipConfig().entry as string[]\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\" || hint.type === \"entry-redundant\")\n ),\n )\n options.configurationHints = new Set(filteredConfigurationHints)\n\n modifyIssues(options, \"unlisted\", ([, issueRecordEntries]) =>\n issueRecordEntries.filter(([key]) => !key.includes(\"prettier\")),\n )\n\n modifyIssues(options, \"types\", ([filePath, issueRecordEntries]) => {\n if (filePath !== \"src/configs/utils.ts\") return issueRecordEntries\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 return issueRecordEntries.filter(([key]) => !expectedTypeNames.includes(key))\n })\n\n return options\n}\n\nexport default preprocess\n"],"mappings":";AAuDA,SAAS,aACP,SACA,WACA,OACA;CACA,MAAMA,iBAA+B,QAAQ,OAAO;CAMpD,MAAM,uBAL4C,OAAO,QAAQ,eAAe,CAAC,KAAK,CAAC,KAAK,iBAAiB,CAC3G,KACA,OAAO,QAAQ,YAAY,CAC5B,CAAC,CAEgD,KAG/C,CAAC,KAAK,wBAAwB,CAAC,KAAK,OAAO,YAAY,MAAM,CAAC,KAAK,mBAAmB,CAAC,CAAC,CAAC,CAC3F;CACD,MAAMC,iBAA+B,OAAO,YAAY,qBAAqB;CAE7E,MAAM,eAAe,iBACnB,OAAO,OAAO,aAAa,CACxB,KAAK,gBAAgB,OAAO,KAAK,YAAY,CAAC,OAAO,CACrD,QAAQ,KAAK,SAAS,MAAM,MAAM,EAAE;CAEzC,MAAM,qBAAqB,YAAY,eAAe;CAEtD,MAAM,qBAAqB,qBADA,YAAY,eAAe;AAGtD,SAAQ,SAAS,aAAa,qBAAqB;AACnD,SAAQ,OAAO,aAAa;;AAG9B,MAAM,UAAU,YAAY,CAAC;AAE7B,MAAMC,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,KAC9F,KAAK,SAAS,iBAAiB,KAAK,SAAS,oBAEnD;AACD,SAAQ,qBAAqB,IAAI,IAAI,2BAA2B;AAEhE,cAAa,SAAS,aAAa,GAAG,wBACpC,mBAAmB,QAAQ,CAAC,SAAS,CAAC,IAAI,SAAS,WAAW,CAAC,CAChE;AAED,cAAa,SAAS,UAAU,CAAC,UAAU,wBAAwB;AACjE,MAAI,aAAa,uBAAwB,QAAO;EAEhD,MAAM,oBAAoB,CAAC,iBAAiB,wBAAwB;AACpE,SAAO,mBAAmB,QAAQ,CAAC,SAAS,CAAC,kBAAkB,SAAS,IAAI,CAAC;GAC7E;AAEF,QAAO;;AAGT,IAAA,4BAAe"}
|