refactor: upgrade Biome lint rules

Promote noExplicitAny from warn to error and enable noNonNullAssertion
at warn level. Fix the two resulting errors in src/schema.ts by introducing
a JsonSchema interface to replace the any-typed local variables.

https://claude.ai/code/session_016QvEfqw6YZ3RjwBHrJ4w8S
This commit is contained in:
Claude 2026-04-26 06:16:36 +00:00
parent a74e7c3e07
commit 10d811f197
No known key found for this signature in database
2 changed files with 13 additions and 5 deletions

View file

@ -8,12 +8,12 @@
"rules": {
"recommended": true,
"suspicious": {
"noExplicitAny": "warn",
"noExplicitAny": "error",
"noRedundantUseStrict": "off",
"noImplicitAnyLet": "off"
},
"style": {
"noNonNullAssertion": "off",
"noNonNullAssertion": "warn",
"useConst": "warn",
"useNodejsImportProtocol": "off",
"useTemplate": "off"

View file

@ -105,8 +105,16 @@ export function normalizeCardsPayload(parsed: { cards?: unknown[] }): RawCard[]
}));
}
export function cardOutputSchema(strict: boolean) {
const cardSchema: any = {
interface JsonSchema {
type: string;
properties?: Record<string, unknown>;
items?: unknown;
required?: string[];
additionalProperties?: boolean;
}
export function cardOutputSchema(strict: boolean): JsonSchema {
const cardSchema: JsonSchema = {
type: 'object',
properties: {
title: { type: 'string' },
@ -119,7 +127,7 @@ export function cardOutputSchema(strict: boolean) {
},
required: ['title', 'anchor', 'gist', 'bullets'],
};
const rootSchema: any = {
const rootSchema: JsonSchema = {
type: 'object',
properties: {
cards: {