fix: simple ESLint errors — regex, unused vars, unused expressions
- eslint.config.js: ignore coverage/ directory (generated files)
- frontmatter.ts: no-regex-spaces — use {2} instead of literal spaces
- wikilinks.ts: no-useless-escape — remove unnecessary \[ escape
- ai-chat.ts: remove unused _model param from getContextLimit
- noteListHelpers.ts: remove unused _modifiedFiles param from filterEntries
- NoteList.tsx: replace ternary expression statement with if/else
- useTabManagement.ts: remove stale eslint-disable-next-line comment
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -25,7 +25,7 @@ export function estimateTokens(text: string | number): number {
|
||||
|
||||
const DEFAULT_CONTEXT_LIMIT = 180_000
|
||||
|
||||
export function getContextLimit(_model: string): number {
|
||||
export function getContextLimit(): number {
|
||||
return DEFAULT_CONTEXT_LIMIT
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ export function buildSystemPrompt(
|
||||
return { prompt: '', totalTokens: 0, truncated: false }
|
||||
}
|
||||
|
||||
const contextBudget = Math.floor(getContextLimit(model) * 0.6)
|
||||
const contextBudget = Math.floor(getContextLimit() * 0.6)
|
||||
const preamble = [
|
||||
'You are a helpful AI assistant integrated into Laputa, a personal knowledge management app.',
|
||||
'The user has selected the following notes as context. Use them to answer questions accurately.',
|
||||
|
||||
@@ -40,7 +40,7 @@ export function parseFrontmatter(content: string | null): ParsedFrontmatter {
|
||||
let inList = false
|
||||
|
||||
for (const line of match[1].split('\n')) {
|
||||
const listMatch = line.match(/^ - (.*)$/)
|
||||
const listMatch = line.match(/^ {2}- (.*)$/)
|
||||
if (listMatch && currentKey) {
|
||||
inList = true
|
||||
currentList.push(unquote(listMatch[1]))
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { VaultEntry, SidebarSelection, ModifiedFile } from '../types'
|
||||
import type { VaultEntry, SidebarSelection } from '../types'
|
||||
|
||||
export interface RelationshipGroup {
|
||||
label: string
|
||||
@@ -196,6 +196,6 @@ function filterByFilterType(entries: VaultEntry[], filter: string): VaultEntry[]
|
||||
return []
|
||||
}
|
||||
|
||||
export function filterEntries(entries: VaultEntry[], selection: SidebarSelection, _modifiedFiles?: ModifiedFile[]): VaultEntry[] {
|
||||
export function filterEntries(entries: VaultEntry[], selection: SidebarSelection): VaultEntry[] {
|
||||
return filterByKind(entries, selection)
|
||||
}
|
||||
|
||||
@@ -62,7 +62,7 @@ export function splitFrontmatter(content: string): [string, string] {
|
||||
|
||||
export function countWords(content: string): number {
|
||||
const [, body] = splitFrontmatter(content)
|
||||
const text = body.replace(/[#*_\[\]`>~\-|]/g, '').trim()
|
||||
const text = body.replace(/[#*_[\]`>~\-|]/g, '').trim()
|
||||
if (!text) return 0
|
||||
return text.split(/\s+/).filter(Boolean).length
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user