skills/lint-error-resolution/SKILL.md
Guide for resolving lint errors in strict TypeScript/React environments — oxlint, ESLint, and TypeScript compiler errors. Use when encountering lint, oxlint, ESLint, or tsc errors in files being edited. Do NOT use for runtime errors unrelated to linting or TypeScript compilation.
npx skillsauth add bkinsey808/songshare-effect lint-error-resolutionInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Requires: file-read, terminal (linter). No network access needed.
Preconditions:
Clarifying questions:
Output format:
npm run lint to confirm clean; report result.Lint command policy:
npm run lint as the default lint entrypoint for this repo.npx eslint for normal validation.oxlint; direct eslint usage is reserved for specialized checks that explicitly call for it.Error handling:
-- reason annotation and explain why.Full patterns with examples: docs/lint-best-practices.md
| Error | Doc section |
| ----- | ----------- |
| no-unsafe-type-assertion in API handlers | → API Handler Patterns |
| no-unsafe-assignment / dynamic Supabase tables | → Dynamic Tables |
| "All if-else branches same code" (Supabase) | → Supabase Error Check |
| SupabaseFromLike optional method chain | → Use callSelect |
| id-length | → id-length |
| no-magic-numbers | → no-magic-numbers |
| no-negated-condition | → no-negated-condition |
| prefer-number-properties | → prefer-number-properties |
| curly | → curly |
| consistent-type-imports | → type imports |
| --isolatedDeclarations | → isolatedDeclarations |
| unicorn/no-array-sort | → toSorted |
| unicorn/catch-error-name | → catch name |
| require-useeffect-comment | → useEffect comment |
| strict-boolean-expressions / exactOptionalPropertyTypes | → General TS Rules |
Only for third-party library compatibility, generated code, or temporary workarounds with a TODO:
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment -- TODO: Add proper typing
const legacyData = oldLibrary.getData();
Input: "I'm getting a no-unsafe-type-assertion error in my Hono handler"
Expected: Agent reads the handler file, finds the unsafe assertion, applies the safe request-validation pattern from the lookup table (or loads the doc section), runs npm run lint to confirm clean, explains the root cause in one sentence.
Input: "Can I just add eslint-disable here to make it go away?"
Expected: Agent answers: only acceptable for third-party library compatibility, generated code, or a temporary workaround with a -- TODO: annotation. Explains what fix should be applied instead and offers to apply it.
Input: "Fix all lint errors in this file"
Expected: Agent runs npm run lint, reads the file, fixes each error using the lookup table or doc, re-runs lint, reports which errors were fixed and how.
-- reason annotation.docs/ai/rules.md.tools
Zustand state management patterns for this project — store creation, selectors, Immer middleware, async actions with loading states, devtools, persist, and testing. Use when authoring or editing Zustand stores (use*Store files) or components that subscribe to stores. Do NOT use for React component structure or TypeScript-only utilities.
testing
How to write, update, or split skill files in this repo. Use when creating a new SKILL.md, updating an existing one, or deciding whether to put content in a skill vs. docs/.
development
Complete guide for testing React hooks — renderHook, Documentation by Harness, installStore, fixtures, subscription patterns, lint/compiler traps, and pre-completion checklist. Read docs/testing/unit-test-hook-best-practices.md for the full reference.
development
Vitest unit test authoring for this repo — setup, mocking, API handler testing, and common pitfalls for non-hook code. Use when the user asks to add, update, fix, or review unit tests for utilities, components, API handlers, or scripts. Do NOT use for React hook tests — load unit-test-hook-best-practices instead.