Fix pre-commit script to properly handle multiple files and resolve ESLint warnings
This commit is contained in:
@@ -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');
|
||||
|
||||
Reference in New Issue
Block a user