Fix ESLint errors for successful deployment

- Fixed mixed operators in contentExtractor.js with proper parentheses
- Removed unused variables and imports across all components
- Fixed useCallback dependencies in ObjectEditor.js
- Corrected == to === comparisons in TableEditor.js
- Fixed undefined variable references
- Wrapped serializeToPhp in useCallback to resolve dependency warning
- Updated table column width styling from min-w to w for consistent layout

Build now passes successfully with only non-blocking warnings remaining.
This commit is contained in:
dwindown
2025-09-23 14:46:30 +07:00
parent 977e784df2
commit 5f6aa2210a
4 changed files with 14 additions and 70 deletions

View File

@@ -1,7 +1,6 @@
import React, { useState, useRef, useCallback } from 'react';
import { Edit3, Upload, FileText, Workflow, Table, Globe, Plus, AlertTriangle, BrushCleaning, Code, Braces, Download } from 'lucide-react';
import { Upload, FileText, Workflow, Table, Globe, Plus, AlertTriangle, BrushCleaning, Code, Braces, Download, Edit3 } from 'lucide-react';
import ToolLayout from '../components/ToolLayout';
import CopyButton from '../components/CopyButton';
import StructuredEditor from '../components/StructuredEditor';
import MindmapView from '../components/MindmapView';
import PostmanTable from '../components/PostmanTable';
@@ -102,10 +101,6 @@ const ObjectEditor = () => {
setCreateNewCompleted(false);
};
// Create initial empty object with one property
const createInitialEmptyObject = () => {
return { "": "" };
};
// Confirm input method change and clear data
const confirmInputChange = () => {
@@ -390,7 +385,7 @@ const ObjectEditor = () => {
};
// Simple PHP serialization function
const serializeToPhp = (data) => {
const serializeToPhp = useCallback((data) => {
if (data === null) return 'N;';
if (data === undefined) return 'N;';
if (typeof data === 'boolean') return data ? 'b:1;' : 'b:0;';
@@ -418,7 +413,7 @@ const ObjectEditor = () => {
return result;
}
return 'N;';
};
}, []);
// Generate output formats
const generateOutputs = useCallback((data) => {
@@ -452,7 +447,7 @@ const ObjectEditor = () => {
serialized: 'Error generating PHP serialized data'
});
}
}, []);
}, [serializeToPhp]);
// Handle file import
const handleFileImport = (event) => {
@@ -469,50 +464,6 @@ const ObjectEditor = () => {
}
};
// Load sample data
const loadSample = () => {
const sample = {
"users": [
{
"id": 1,
"name": "John Doe",
"email": "john@example.com",
"age": 30,
"role": "admin",
"active": true
},
{
"id": 2,
"name": "Jane Smith",
"email": "jane@example.com",
"age": 28,
"role": "user",
"active": true
},
{
"id": 3,
"name": "Bob Wilson",
"email": "bob@example.com",
"age": 35,
"role": "moderator",
"active": false
}
],
"settings": {
"theme": "dark",
"language": "en",
"timezone": "UTC",
"features": {
"notifications": true,
"darkMode": true,
"autoSave": false
}
},
"tags": ["developer", "javascript", "react", "nodejs"]
};
setStructuredData(sample);
generateOutputs(sample);
};
// Fetch data from URL
const handleFetchData = async () => {