mirror of
https://github.com/fancive/obsidian-parallel-reader.git
synced 2026-07-22 06:53:43 +00:00
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:
parent
a74e7c3e07
commit
10d811f197
2 changed files with 13 additions and 5 deletions
|
|
@ -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"
|
||||
|
|
|
|||
|
|
@ -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: {
|
||||
|
|
|
|||
Loading…
Reference in a new issue