chore(LINT-0001) fix lint errors
This commit is contained in:
@@ -119,3 +119,49 @@ Add subsequent research below this section.
|
||||
- Risks / follow-ups:
|
||||
- Over-sanitizing punctuation-heavy inputs could erase useful identifiers, so the implementation should preserve searchable alphanumeric and underscore tokens while discarding grammar-breaking punctuation.
|
||||
- Prefix expansion should remain on the final searchable token only so the fix preserves current query-cost expectations and test semantics.
|
||||
|
||||
### 2026-03-27 — LINT-0001 planning research
|
||||
|
||||
- Task: Plan the lint-fix iteration covering the reported ESLint and eslint-plugin-svelte violations across Svelte UI, SvelteKit routes, server modules, and Vitest suites.
|
||||
- Files inspected:
|
||||
- `package.json`
|
||||
- `eslint.config.js`
|
||||
- `docs/FINDINGS.md`
|
||||
- `prompts/LINT-0001/prompt.yaml`
|
||||
- `prompts/LINT-0001/progress.yaml`
|
||||
- `src/lib/components/FolderPicker.svelte`
|
||||
- `src/lib/components/RepositoryCard.svelte`
|
||||
- `src/lib/components/search/SnippetCard.svelte`
|
||||
- `src/lib/server/crawler/local.crawler.test.ts`
|
||||
- `src/lib/server/embeddings/embedding.service.test.ts`
|
||||
- `src/lib/server/embeddings/local.provider.ts`
|
||||
- `src/lib/server/embeddings/provider.ts`
|
||||
- `src/lib/server/embeddings/registry.ts`
|
||||
- `src/lib/server/models/context-response.ts`
|
||||
- `src/lib/server/parser/code.parser.ts`
|
||||
- `src/lib/server/pipeline/indexing.pipeline.ts`
|
||||
- `src/lib/server/search/hybrid.search.service.test.ts`
|
||||
- `src/lib/server/search/query-preprocessor.ts`
|
||||
- `src/lib/server/services/repository.service.test.ts`
|
||||
- `src/lib/server/services/version.service.test.ts`
|
||||
- `src/lib/server/services/version.service.ts`
|
||||
- `src/routes/+layout.svelte`
|
||||
- `src/routes/+page.svelte`
|
||||
- `src/routes/api/v1/libs/search/+server.ts`
|
||||
- `src/routes/api/v1/settings/embedding/+server.ts`
|
||||
- `src/routes/repos/[id]/+page.svelte`
|
||||
- `src/routes/search/+page.svelte`
|
||||
- `src/routes/settings/+page.svelte`
|
||||
- Findings:
|
||||
- The project lint stack is ESLint `^9.39.2` with `typescript-eslint` recommended rules and `eslint-plugin-svelte` recommended plus SvelteKit-aware rules, running over Svelte `^5.51.0` and SvelteKit `^2.50.2`.
|
||||
- Context7 documentation for `eslint-plugin-svelte` confirms `svelte/no-navigation-without-base` flags root-relative `<a href="/...">` links and `goto('/...')` calls in SvelteKit projects; compliant fixes must use `$app/paths` base-aware links or base-prefixed `goto` calls.
|
||||
- Context7 documentation for Svelte 5 confirms event handlers are regular element properties such as `onclick`, while side effects belong in `$effect`; repo memory also records that client-only fetch bootstrap should not be moved indiscriminately into `$effect` when `onMount` or load is the correct lifecycle boundary.
|
||||
- Concrete navigation violations already exist in `src/routes/+layout.svelte`, `src/routes/repos/[id]/+page.svelte`, `src/routes/search/+page.svelte`, and `src/lib/components/RepositoryCard.svelte`, each using hard-coded root-relative internal navigation.
|
||||
- Static diagnostics currently expose at least one direct TypeScript lint error in `src/lib/server/embeddings/registry.ts`, where `_config` is defined but never used.
|
||||
- `src/routes/api/v1/libs/search/+server.ts` imports `json` from `@sveltejs/kit` without using it, making that endpoint a concrete unused-import cleanup target.
|
||||
- `src/lib/server/services/version.service.ts` still uses CommonJS `require(...)` to reach git utilities from TypeScript, which is inconsistent with the repository's ESM style and is a likely lint target under the current ESLint stack.
|
||||
- The affected Svelte pages and settings UI already use Svelte 5 event-property syntax, so the lint work should preserve that syntax and focus on base-aware navigation, lifecycle correctness, and unused-symbol cleanup rather than regressing to legacy `on:` directives.
|
||||
- Existing automated coverage for the lint-touching backend areas already lives in `src/lib/server/crawler/local.crawler.test.ts`, `src/lib/server/embeddings/embedding.service.test.ts`, `src/lib/server/search/hybrid.search.service.test.ts`, `src/lib/server/services/repository.service.test.ts`, and `src/lib/server/services/version.service.test.ts`; route and component changes rely on build and lint validation rather than dedicated browser tests in this iteration.
|
||||
- Risks / follow-ups:
|
||||
- Base-aware navigation fixes must preserve internal app routing semantics and should not replace intentional external navigation, because SvelteKit `goto(...)` no longer accepts external URLs.
|
||||
- Settings and search page lifecycle changes must avoid reintroducing SSR-triggered fetches or self-triggered URL loops; client-only bootstrap logic should remain mounted once and URL-sync effects must stay idempotent.
|
||||
|
||||
Reference in New Issue
Block a user