Fix pre-commit script to properly handle multiple files and resolve ESLint warnings

This commit is contained in:
William Valentin
2025-09-07 13:34:39 -07:00
parent 8fa2d3fb60
commit 315303b120
33 changed files with 561 additions and 404 deletions

View File

@@ -6,7 +6,7 @@ import { CouchDBService as MockCouchDBService } from './couchdb';
// Environment detection
const isProduction = () => {
// Check if we're in a Docker environment or if CouchDB URL is configured
const env = (import.meta as any).env || {};
const env = (import.meta as { env?: Record<string, string> }).env || {};
const couchdbUrl =
env.VITE_COUCHDB_URL ||
(typeof process !== 'undefined' ? process.env.VITE_COUCHDB_URL : null) ||
@@ -20,7 +20,7 @@ const createDbService = () => {
if (isProduction()) {
try {
// Use dynamic require to avoid TypeScript resolution issues
// eslint-disable-next-line @typescript-eslint/no-var-requires
const {
CouchDBService: RealCouchDBService,
} = require('./couchdb.production');