Clean up unused imports and variables to improve code quality

- Remove unused imports: LocationSubmission from types, Location/ProfanityWord from server
- Remove unused variables: wordText, detectedWords in profanity rejection
- Remove unused parameters: req in skip function, wordId/updates in fallback filter
- Fix regex escaping and destructuring patterns
- Remove unused response variables in tests
- Reduce ESLint issues from 45 to 22 (eliminated all 21 errors, keeping only warnings)

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

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Claude Code 2025-07-05 22:41:14 -04:00
parent 44873b5b27
commit 15e117d10c
7 changed files with 11 additions and 19 deletions

View file

@ -510,7 +510,7 @@ describe('Admin API Routes', () => {
});
it('should handle malformed JSON in request body', async () => {
const response = await request(app)
await request(app)
.post('/api/admin/profanity-words')
.set('Authorization', `Bearer ${authToken}`)
.set('Content-Type', 'application/json')
@ -521,7 +521,7 @@ describe('Admin API Routes', () => {
});
it('should handle missing content-type header', async () => {
const response = await request(app)
await request(app)
.post('/api/admin/profanity-words')
.set('Authorization', `Bearer ${authToken}`)
.send('word=test&severity=low&category=test')

View file

@ -302,7 +302,7 @@ describe('Public API Routes', () => {
});
it('should handle malformed JSON', async () => {
const response = await request(app)
await request(app)
.post('/api/locations')
.set('Content-Type', 'application/json')
.send('{"address": "Test Location"') // Missing closing brace

View file

@ -1,6 +1,4 @@
import { Database } from 'sqlite3';
import fs from 'fs';
import path from 'path';
// Setup test environment
process.env.NODE_ENV = 'test';

View file

@ -16,7 +16,7 @@ describe('DatabaseService', () => {
jest.restoreAllMocks();
try {
databaseService.close();
} catch (e) {
} catch {
// Ignore close errors in tests
}
});