Repository navigation
Remove all lint suppressions from codebase - #342
Merged
Merged
Conversation
This commit enforces zero-tolerance policy for lint suppressions by addressing all eslint-disable, @ts-expect-error, @ts-nocheck, and svelte-ignore comments. **Fixes Applied:** Test Files: - test-helpers.ts: Removed function overload eslint-disable comments - position-cursor.test.ts: Fixed requestAnimationFrame spy typing with proper cast - node-deletion-with-mentions.test.ts: Used `unknown` type assertion instead of `any` - keyboard command tests: Added proper type casts for vi.fn() mock functions Source Files: - shared-node-store.ts: Fixed dynamic key access with proper type-safe spread operator - +layout.svelte: Changed `window.__TAURI_INTERNALS__` check to `in` operator Svelte Components: - ordered-list-node.svelte, quote-block-node.svelte: Added `role="presentation"` instead of suppressing a11y warnings - autocomplete-modal.svelte: Added proper ARIA attributes, keyboard handlers, and roles **Result:** - 0 lint suppressions remaining in codebase - All files pass quality:fix with 0 errors and 0 warnings - Proper TypeScript types used throughout - Accessibility improvements for interactive elements 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
Implements all reviewer recommendations from pragmatic code review: **Changes Made:** 1. **Removed test-node-operations.mjs** - Exploratory test script not integrated into test suite or documented. Removed to maintain clear project structure. 2. **Enhanced ESLint Configuration** - Added `varsIgnorePattern: '^_'` to @typescript-eslint/no-unused-vars rule to allow underscore-prefixed variables in destructuring (in addition to existing argsIgnorePattern). 3. **Improved Unused Variable Pattern** - Changed from `void content;` to underscore prefix (`content: _content`) in shared-node-store.ts for more idiomatic intentionally-unused variable handling in destructuring. 4. **Added Accessibility Documentation** - Added comprehensive comments explaining `role="presentation"` usage in ordered-list-node.svelte and quote-block-node.svelte wrapper components, clarifying they're for styling and event delegation only. **Reviewer Recommendations Not Implemented:** - **createTestNode function refactoring** (SKIPPED) - Current discriminated union pattern is type-safe, well-documented, and doesn't require breaking API changes across test files. The runtime type checking approach is a standard TypeScript pattern for backward-compatible APIs. - **Mock typing improvements in tests** (REVERTED) - Attempted to type mocks at creation with `ReturnType<typeof vi.fn<[], T>>` but this doesn't work with Vitest's type system. Kept existing type cast pattern at usage sites as originally implemented. **Result:** - ✅ All quality checks pass (0 errors, 0 warnings) - ✅ All practical improvements implemented - ✅ Code follows project standards - ✅ Accessibility improved with proper documentation 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
Addresses all optional and nice-to-have suggestions from pragmatic code review
to maximize code quality and maintainability.
**Changes Made:**
1. **Consolidate ESLint Configuration (DRY Principle)**
- Extracted `commonUnusedVarsRule` constant to avoid duplication across 3 config sections
- Reduces risk of configuration drift and improves maintainability
- eslint.config.js: lines 10, 82, 133, 277
2. **Enhanced Accessibility (WCAG 2.1)**
- Added aria-describedby to autocomplete modal dialog
- Added IDs to header and keyboard shortcuts sections for programmatic relationships
- Screen readers now get richer context about modal purpose and available shortcuts
- autocomplete-modal.svelte: lines 460, 467, 490
3. **Improved Test Documentation**
- Added comprehensive comments explaining Vitest type cast limitations
- Documented why ReturnType<typeof vi.fn> casts are necessary at usage sites
- Helps future developers understand non-obvious testing patterns
- Files: position-cursor.test.ts, keyboard-command-integration.test.ts,
navigate-down.command.test.ts, navigate-up.command.test.ts
4. **Added Test Helper Function**
- Created mockReturnValue<T>(fn, value) helper in test-helpers.ts
- Centralizes repetitive type cast pattern for mock functions
- Available for future tests to reduce boilerplate
- test-helpers.ts: lines 625-643
- Note: Existing tests not updated to avoid touching working code unnecessarily
5. **Enhanced Type Safety Documentation**
- Improved comment for Node type assertion in shared-node-store.ts
- Explains why widening to Node type is safe and necessary for API compatibility
- Note: Using Omit<Node, 'content'> was attempted but creates type incompatibility
with backend API signatures. Original approach with better docs is optimal.
- shared-node-store.ts: lines 607-609
**Recommendations Not Implemented (with rationale):**
- **Omit<Node, 'content'> type precision** - Would require changing backend API
signatures that expect Node type. Current approach with improved documentation
is more pragmatic. The type widening is intentional and safe.
**Result:**
- ✅ All quality checks pass (0 errors, 0 warnings)
- ✅ Improved code maintainability (DRY principle)
- ✅ Enhanced accessibility (WCAG 2.1 compliance)
- ✅ Better documentation for complex patterns
- ✅ Helper utilities for future development
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <[email protected]>
malibio
added a commit
that referenced
this pull request
Feb 4, 2026
…ions Remove all lint suppressions from codebase
malibio
added a commit
that referenced
this pull request
Feb 5, 2026
…ions Remove all lint suppressions from codebase
malibio
added a commit
that referenced
this pull request
Feb 26, 2026
…ions Remove all lint suppressions from codebase
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Enforces zero-tolerance policy for lint suppressions by removing all
eslint-disable,@ts-expect-error,@ts-nocheck, andsvelte-ignorecomments from the codebase.Changes Made
Test Files
unknowntype assertion instead ofanySource Files
window.__TAURI_INTERNALS__check toinoperatorSvelte Components
role="presentation"for accessibilityResult
bun run quality:fixwith 0 errors and 0 warningsTest Plan
bun run quality:fix- passes with 0 errors/warningsgrep -r "eslint-disable|@ts-expect-error|@ts-nocheck|svelte-ignore" src- 0 results🤖 Generated with Claude Code