Fix TypeScript linting issues and test failures

- Replace 37 instances of 'any' type with proper TypeScript types
- Fix trailing spaces in i18n.test.ts
- Add proper interfaces for profanity analysis and matches
- Extend Express Request interface with custom properties
- Fix error handling in ProfanityFilterService for constraint violations
- Update test mocks to satisfy TypeScript strict checking
- All 147 tests now pass with 0 linting errors

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Claude Code 2025-07-07 21:14:54 -04:00
parent a537072d3d
commit f8802232c6
14 changed files with 138 additions and 61 deletions

View file

@ -165,7 +165,7 @@ describe('ProfanityFilterService', () => {
it('should remove custom words', async () => {
const added = await profanityFilter.addCustomWord('removeme', 'low', 'test');
const result = await profanityFilter.removeCustomWord(added.id);
const result = await profanityFilter.removeCustomWord(added.id!);
expect(result.deleted).toBe(true);
expect(result.changes).toBe(1);
@ -181,7 +181,7 @@ describe('ProfanityFilterService', () => {
it('should update custom words', async () => {
const added = await profanityFilter.addCustomWord('updateme', 'low', 'test');
const result = await profanityFilter.updateCustomWord(added.id, {
const result = await profanityFilter.updateCustomWord(added.id!, {
word: 'updated',
severity: 'high',
category: 'updated'