@adamhl8/configs 0.18.0 → 0.18.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/dist/configs/biome.base.json +40 -2
- 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 +1 -2
- package/dist/configs/knip-preprocessor.js.map +1 -1
- package/dist/configs/knip.d.ts +4 -1257
- package/dist/configs/knip.d.ts.map +1 -1
- package/dist/configs/knip.js.map +1 -1
- package/dist/configs/prettier.d.ts +6 -41
- package/dist/configs/prettier.d.ts.map +1 -1
- package/dist/configs/prettier.js.map +1 -1
- package/dist/configs/tsdown.d.ts +9 -71
- 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/configs/utils.d.ts +2 -5
- package/dist/configs/utils.d.ts.map +1 -1
- package/dist/configs/utils.js.map +1 -1
- package/package.json +13 -13
|
@@ -211,27 +211,47 @@
|
|
|
211
211
|
"useYield": "error"
|
|
212
212
|
},
|
|
213
213
|
"nursery": {
|
|
214
|
+
"noAmbiguousAnchorText": "error",
|
|
215
|
+
"noBeforeInteractiveScriptOutsideDocument": "error",
|
|
214
216
|
"noContinue": "off",
|
|
215
217
|
"noDeprecatedImports": "error",
|
|
218
|
+
"noDivRegex": "error",
|
|
219
|
+
"noDuplicateArgumentNames": "error",
|
|
220
|
+
"noDuplicateAttributes": "error",
|
|
216
221
|
"noDuplicateDependencies": "error",
|
|
222
|
+
"noDuplicateEnumValueNames": "error",
|
|
223
|
+
"noDuplicateEnumValues": "error",
|
|
224
|
+
"noDuplicateFieldDefinitionNames": "error",
|
|
225
|
+
"noDuplicateGraphqlOperationName": "error",
|
|
226
|
+
"noDuplicateInputFieldNames": "error",
|
|
227
|
+
"noDuplicateVariableNames": "error",
|
|
217
228
|
"noDuplicatedSpreadProps": "error",
|
|
218
229
|
"noEmptySource": "error",
|
|
219
230
|
"noEqualsToNull": "error",
|
|
231
|
+
"noExcessiveClassesPerFile": "error",
|
|
232
|
+
"noExcessiveLinesPerFile": "error",
|
|
233
|
+
"noFloatingClasses": "error",
|
|
220
234
|
"noFloatingPromises": "error",
|
|
221
235
|
"noForIn": "error",
|
|
222
236
|
"noImportCycles": "error",
|
|
223
237
|
"noIncrementDecrement": "off",
|
|
224
238
|
"noJsxLiterals": "off",
|
|
239
|
+
"noJsxPropsBind": "error",
|
|
225
240
|
"noLeakedRender": "error",
|
|
226
241
|
"noMisusedPromises": "error",
|
|
242
|
+
"noMultiAssign": "error",
|
|
227
243
|
"noMultiStr": "error",
|
|
228
244
|
"noNextAsyncClientComponent": "error",
|
|
229
245
|
"noParametersOnlyUsedInRecursion": "error",
|
|
230
246
|
"noProto": "error",
|
|
231
247
|
"noReactForwardRef": "error",
|
|
248
|
+
"noReturnAssign": "error",
|
|
249
|
+
"noRootType": "error",
|
|
250
|
+
"noScriptUrl": "error",
|
|
232
251
|
"noShadow": "error",
|
|
233
252
|
"noSyncScripts": "off",
|
|
234
253
|
"noTernary": "off",
|
|
254
|
+
"noUndeclaredEnvVars": "error",
|
|
235
255
|
"noUnknownAttribute": "error",
|
|
236
256
|
"noUnnecessaryConditions": "error",
|
|
237
257
|
"noUnresolvedImports": "off",
|
|
@@ -240,32 +260,50 @@
|
|
|
240
260
|
"noUselessUndefined": "error",
|
|
241
261
|
"noVueDataObjectDeclaration": "off",
|
|
242
262
|
"noVueDuplicateKeys": "off",
|
|
263
|
+
"noVueOptionsApi": "error",
|
|
243
264
|
"noVueReservedKeys": "off",
|
|
244
265
|
"noVueReservedProps": "off",
|
|
266
|
+
"noVueSetupPropsReactivityLoss": "error",
|
|
245
267
|
"noVueVIfWithVFor": "off",
|
|
246
268
|
"useArraySortCompare": "error",
|
|
269
|
+
"useAwaitThenable": "off",
|
|
247
270
|
"useConsistentArrowReturn": "error",
|
|
248
271
|
"useConsistentGraphqlDescriptions": "error",
|
|
249
272
|
"useDeprecatedDate": "error",
|
|
273
|
+
"useDestructuring": "error",
|
|
274
|
+
"useErrorCause": "error",
|
|
250
275
|
"useExhaustiveSwitchCases": "error",
|
|
251
276
|
"useExplicitType": "off",
|
|
252
277
|
"useFind": "error",
|
|
278
|
+
"useInlineScriptId": "error",
|
|
279
|
+
"useLoneAnonymousOperation": "error",
|
|
280
|
+
"useLoneExecutableDefinition": "error",
|
|
253
281
|
"useMaxParams": "error",
|
|
254
282
|
"useQwikMethodUsage": "off",
|
|
255
283
|
"useQwikValidLexicalScope": "off",
|
|
284
|
+
"useRegexpExec": "error",
|
|
285
|
+
"useRequiredScripts": "error",
|
|
256
286
|
"useSortedClasses": "error",
|
|
257
287
|
"useSpread": "error",
|
|
258
|
-
"
|
|
288
|
+
"useVueConsistentDefinePropsDeclaration": "error",
|
|
289
|
+
"useVueConsistentVBindStyle": "error",
|
|
290
|
+
"useVueConsistentVOnStyle": "error",
|
|
259
291
|
"useVueDefineMacrosOrder": "off",
|
|
260
292
|
"useVueHyphenatedAttributes": "off",
|
|
261
293
|
"useVueMultiWordComponentNames": "off",
|
|
294
|
+
"useVueVForKey": "error",
|
|
295
|
+
"useVueValidTemplateRoot": "error",
|
|
262
296
|
"useVueValidVBind": "off",
|
|
297
|
+
"useVueValidVCloak": "error",
|
|
263
298
|
"useVueValidVElse": "off",
|
|
264
299
|
"useVueValidVElseIf": "off",
|
|
265
300
|
"useVueValidVHtml": "off",
|
|
266
301
|
"useVueValidVIf": "off",
|
|
267
302
|
"useVueValidVOn": "off",
|
|
268
|
-
"
|
|
303
|
+
"useVueValidVOnce": "error",
|
|
304
|
+
"useVueValidVPre": "error",
|
|
305
|
+
"useVueValidVText": "off",
|
|
306
|
+
"useVueVapor": "error"
|
|
269
307
|
},
|
|
270
308
|
"performance": {
|
|
271
309
|
"noAccumulatingSpread": "error",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"knip-preprocessor.d.ts","names":[],"sources":["../../src/configs/knip-preprocessor.ts"],"
|
|
1
|
+
{"version":3,"file":"knip-preprocessor.d.ts","names":[],"sources":["../../src/configs/knip-preprocessor.ts"],"mappings":";;;cA4FM,UAAA,EAAY,YAAA"}
|
|
@@ -11,8 +11,7 @@ function modifyIssues(options, issueType, mapFn) {
|
|
|
11
11
|
}
|
|
12
12
|
const entries = knipConfig().entry;
|
|
13
13
|
const preprocess = (options) => {
|
|
14
|
-
|
|
15
|
-
options.configurationHints = new Set(filteredConfigurationHints);
|
|
14
|
+
options.configurationHints = options.configurationHints.filter((hint) => !(entries.some((entry) => typeof hint.identifier === "string" && hint.identifier.includes(entry)) && (hint.type === "entry-empty" || hint.type === "entry-redundant")));
|
|
16
15
|
modifyIssues(options, "unlisted", ([, issueRecordEntries]) => issueRecordEntries.filter(([key]) => !key.includes("prettier")));
|
|
17
16
|
modifyIssues(options, "types", ([filePath, issueRecordEntries]) => {
|
|
18
17
|
if (filePath !== "src/configs/utils.ts") return issueRecordEntries;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"knip-preprocessor.js","names":[
|
|
1
|
+
{"version":3,"file":"knip-preprocessor.js","names":[],"sources":["../../src/configs/knip-preprocessor.ts"],"sourcesContent":["import type {\n IssueRecords,\n Preprocessor,\n ReporterOptions,\n SymbolIssueType,\n} from \"../../node_modules/knip/dist/types/issues.d.ts\"\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 options.configurationHints = 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\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":";AA2DA,SAAS,aACP,SACA,WACA,OACA;CACA,MAAM,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,MAAM,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,MAAM,cAA4B,YAAY;AAE5C,SAAQ,qBAAqB,QAAQ,mBAAmB,QACrD,SACC,EACE,QAAQ,MAAM,UAAU,OAAO,KAAK,eAAe,YAAY,KAAK,WAAW,SAAS,MAAM,CAAC,KAC9F,KAAK,SAAS,iBAAiB,KAAK,SAAS,oBAEnD;AAED,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"}
|