Fix ESLint errors: replace any types, escape HTML entities, convert require to imports, ignore config files
This commit is contained in:
1 parent
3d8ba5b8f0
commit
8b189f4caa
8 files changed
+1418
-16
No files matched your search
@@ -12,6 +12,14 @@ const eslintConfig = defineConfig([
|
|||||||
"out/**",
|
"out/**",
|
||||||
"build/**",
|
"build/**",
|
||||||
"next-env.d.ts",
|
"next-env.d.ts",
|
||||||
|
// Additional ignores for generated/config files:
|
||||||
|
"public/sw.js",
|
||||||
|
"public/workbox-*.js",
|
||||||
|
"public/firebase-messaging-sw.js",
|
||||||
|
"jest.config.js",
|
||||||
|
"jest.setup.js",
|
||||||
|
"next-i18next.config.js",
|
||||||
|
"next.config.ts",
|
||||||
]),
|
]),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
import type { NextConfig } from "next";
|
import type { NextConfig } from "next";
|
||||||
const withPWA = require('next-pwa');
|
import withPWA from 'next-pwa';
|
||||||
|
|
||||||
const nextConfig: NextConfig = {
|
const nextConfig: NextConfig = {
|
||||||
output: 'standalone',
|
output: 'standalone',
|
||||||
|
|||||||
Generated
+1394
File diff suppressed because it is too large.
Load diff
@@ -32,6 +32,7 @@
|
|||||||
"@testing-library/user-event": "^14.6.1",
|
"@testing-library/user-event": "^14.6.1",
|
||||||
"@types/jest": "^30.0.0",
|
"@types/jest": "^30.0.0",
|
||||||
"@types/node": "^20",
|
"@types/node": "^20",
|
||||||
|
"@types/nodemailer": "^7.0.2",
|
||||||
"@types/react": "^19",
|
"@types/react": "^19",
|
||||||
"@types/react-csv": "^1.1.10",
|
"@types/react-csv": "^1.1.10",
|
||||||
"@types/react-dom": "^19",
|
"@types/react-dom": "^19",
|
||||||
|
|||||||
@@ -1,14 +1,13 @@
|
|||||||
import { NextRequest, NextResponse } from 'next/server';
|
import { NextRequest, NextResponse } from 'next/server';
|
||||||
import { doc, getDoc } from 'firebase/firestore';
|
import { doc, getDoc } from 'firebase/firestore';
|
||||||
import { db } from '@/lib/firebase';
|
import { db } from '@/lib/firebase';
|
||||||
|
import nodemailer from 'nodemailer';
|
||||||
const nodemailer = require('nodemailer');
|
|
||||||
|
|
||||||
function generatePrayerEmailHTML(message: string, subject: string) {
|
function generatePrayerEmailHTML(message: string, subject: string) {
|
||||||
// Parse the message to extract prayer details
|
// Parse the message to extract prayer details
|
||||||
const lines = message.split('\n');
|
const lines = message.split('\n');
|
||||||
let currentPrayer = null;
|
let currentPrayer = null;
|
||||||
let prayers = [];
|
const prayers = [];
|
||||||
let summarySection = false;
|
let summarySection = false;
|
||||||
|
|
||||||
for (const line of lines) {
|
for (const line of lines) {
|
||||||
|
|||||||
@@ -2,14 +2,13 @@ import { NextRequest, NextResponse } from 'next/server';
|
|||||||
import { doc, getDoc, collection, getDocs, updateDoc } from 'firebase/firestore';
|
import { doc, getDoc, collection, getDocs, updateDoc } from 'firebase/firestore';
|
||||||
import { db } from '@/lib/firebase';
|
import { db } from '@/lib/firebase';
|
||||||
import { admin } from '@/lib/firebase-admin';
|
import { admin } from '@/lib/firebase-admin';
|
||||||
|
import nodemailer from 'nodemailer';
|
||||||
const nodemailer = require('nodemailer');
|
|
||||||
|
|
||||||
function generatePrayerEmailHTML(message: string, subject: string) {
|
function generatePrayerEmailHTML(message: string, subject: string) {
|
||||||
// Parse the message to extract prayer details
|
// Parse the message to extract prayer details
|
||||||
const lines = message.split('\n');
|
const lines = message.split('\n');
|
||||||
let currentPrayer = null;
|
let currentPrayer = null;
|
||||||
let prayers = [];
|
const prayers = [];
|
||||||
let summarySection = false;
|
let summarySection = false;
|
||||||
|
|
||||||
for (const line of lines) {
|
for (const line of lines) {
|
||||||
|
|||||||
@@ -108,14 +108,15 @@ export default function Admin() {
|
|||||||
try {
|
try {
|
||||||
await setDoc(doc(db, 'config', 'smtp'), config);
|
await setDoc(doc(db, 'config', 'smtp'), config);
|
||||||
setMessage('SMTP configuration saved successfully!');
|
setMessage('SMTP configuration saved successfully!');
|
||||||
} catch (error: any) {
|
} catch (error: unknown) {
|
||||||
console.error('Error saving config:', error);
|
console.error('Error saving config:', error);
|
||||||
if (error.code === 'permission-denied') {
|
const err = error as { code?: string; message?: string };
|
||||||
|
if (err.code === 'permission-denied') {
|
||||||
setMessage('Permission denied. Please check your authentication and Firestore security rules.');
|
setMessage('Permission denied. Please check your authentication and Firestore security rules.');
|
||||||
} else if (error.code === 'unavailable') {
|
} else if (err.code === 'unavailable') {
|
||||||
setMessage('Firestore is currently unavailable. Please try again later.');
|
setMessage('Firestore is currently unavailable. Please try again later.');
|
||||||
} else {
|
} else {
|
||||||
setMessage(`Error saving configuration: ${error.message || 'Unknown error'}`);
|
setMessage(`Error saving configuration: ${err.message || 'Unknown error'}`);
|
||||||
}
|
}
|
||||||
} finally {
|
} finally {
|
||||||
setSaving(false);
|
setSaving(false);
|
||||||
@@ -171,7 +172,7 @@ export default function Admin() {
|
|||||||
return (
|
return (
|
||||||
<div className="max-w-2xl mx-auto p-6 bg-red-900 border border-red-700 rounded-lg">
|
<div className="max-w-2xl mx-auto p-6 bg-red-900 border border-red-700 rounded-lg">
|
||||||
<h2 className="text-xl font-bold text-red-100 mb-2">Access Denied</h2>
|
<h2 className="text-xl font-bold text-red-100 mb-2">Access Denied</h2>
|
||||||
<p className="text-red-200">You don't have permission to access the admin panel.</p>
|
<p className="text-red-200">You don't have permission to access the admin panel.</p>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,14 +22,14 @@ export default function Login() {
|
|||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
await signup(email, password);
|
await signup(email, password);
|
||||||
} catch (err: any) {
|
} catch (err: unknown) {
|
||||||
setError(err.message);
|
setError(err instanceof Error ? err.message : 'An error occurred');
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
try {
|
try {
|
||||||
await login(email, password);
|
await login(email, password);
|
||||||
} catch (err: any) {
|
} catch (err: unknown) {
|
||||||
setError(err.message);
|
setError(err instanceof Error ? err.message : 'An error occurred');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in new issue
Block a user