From 9b87e2758d8274347e8e382b21498daad3369cee Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 12 Feb 2026 15:45:27 +0000 Subject: [PATCH 1/2] Initial plan From 7843e6100c957a4082759b91b4140ad58e791e64 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 12 Feb 2026 15:47:42 +0000 Subject: [PATCH 2/2] Enforce double quotes and semicolons in frontend linting Co-authored-by: yortch <4576246+yortch@users.noreply.github.com> --- frontend/eslint.config.js | 2 + frontend/src/App.tsx | 24 ++-- frontend/src/api/config.ts | 28 ++--- frontend/src/components/About.tsx | 10 +- frontend/src/components/Footer.tsx | 8 +- frontend/src/components/Login.tsx | 34 +++--- frontend/src/components/Navigation.tsx | 30 ++--- frontend/src/components/Welcome.tsx | 58 ++++----- .../src/components/admin/AdminProducts.tsx | 110 +++++++++--------- .../components/entity/product/ProductForm.tsx | 68 +++++------ .../components/entity/product/Products.tsx | 56 ++++----- frontend/src/context/AuthContext.tsx | 6 +- frontend/src/context/ThemeContext.tsx | 20 ++-- frontend/src/context/themeContextUtils.tsx | 2 +- frontend/src/main.tsx | 16 +-- frontend/vite.config.ts | 10 +- 16 files changed, 242 insertions(+), 240 deletions(-) diff --git a/frontend/eslint.config.js b/frontend/eslint.config.js index 092408a..7d409c1 100644 --- a/frontend/eslint.config.js +++ b/frontend/eslint.config.js @@ -23,6 +23,8 @@ export default tseslint.config( 'warn', { allowConstantExport: true }, ], + quotes: ['error', 'double'], + semi: ['error', 'always'], }, }, ) diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index d0b02da..5f82c62 100644 --- a/frontend/src/App.tsx +++ b/frontend/src/App.tsx @@ -1,14 +1,14 @@ -import { BrowserRouter as Router, Routes, Route } from 'react-router-dom'; -import Navigation from './components/Navigation'; -import Welcome from './components/Welcome'; -import About from './components/About'; -import Footer from './components/Footer'; -import Products from './components/entity/product/Products'; -import Login from './components/Login'; -import { AuthProvider } from './context/AuthContext'; -import { ThemeProvider } from './context/ThemeContext'; -import AdminProducts from './components/admin/AdminProducts'; -import { useTheme } from './context/ThemeContext'; +import { BrowserRouter as Router, Routes, Route } from "react-router-dom"; +import Navigation from "./components/Navigation"; +import Welcome from "./components/Welcome"; +import About from "./components/About"; +import Footer from "./components/Footer"; +import Products from "./components/entity/product/Products"; +import Login from "./components/Login"; +import { AuthProvider } from "./context/AuthContext"; +import { ThemeProvider } from "./context/ThemeContext"; +import AdminProducts from "./components/admin/AdminProducts"; +import { useTheme } from "./context/ThemeContext"; // Wrapper component to apply theme classes function ThemedApp() { @@ -16,7 +16,7 @@ function ThemedApp() { return ( -
+
diff --git a/frontend/src/api/config.ts b/frontend/src/api/config.ts index 6e77299..8f568aa 100644 --- a/frontend/src/api/config.ts +++ b/frontend/src/api/config.ts @@ -9,8 +9,8 @@ declare global { const getBaseUrl = () => { // First check runtime configuration (from runtime-config.js) - if (typeof window !== 'undefined' && window.RUNTIME_CONFIG?.API_URL) { - console.log('Using runtime config API_URL:', window.RUNTIME_CONFIG.API_URL); + if (typeof window !== "undefined" && window.RUNTIME_CONFIG?.API_URL) { + console.log("Using runtime config API_URL:", window.RUNTIME_CONFIG.API_URL); return window.RUNTIME_CONFIG.API_URL; } @@ -18,15 +18,15 @@ const getBaseUrl = () => { const codespaceName = process.env.CODESPACE_NAME; if (codespaceName) { // Use the same protocol as the current page - const protocol = typeof window !== 'undefined' ? window.location.protocol : 'https:'; - const protocolToUse = protocol.includes('https') ? 'https' : 'http'; + const protocol = typeof window !== "undefined" ? window.location.protocol : "https:"; + const protocolToUse = protocol.includes("https") ? "https" : "http"; console.log(`Using Codespace URL with ${protocolToUse} protocol`); return `${protocolToUse}://${codespaceName}-3000.app.github.dev`; } // Auto-detect protocol for local development - const protocol = typeof window !== 'undefined' ? window.location.protocol : 'http:'; - const protocolToUse = protocol.includes('https') ? 'https' : 'http'; + const protocol = typeof window !== "undefined" ? window.location.protocol : "http:"; + const protocolToUse = protocol.includes("https") ? "https" : "http"; console.log(`Using default localhost URL with ${protocolToUse} protocol`); return `${protocolToUse}://localhost:3000`; }; @@ -36,13 +36,13 @@ export const API_BASE_URL = getBaseUrl(); export const api = { baseURL: API_BASE_URL, endpoints: { - products: '/api/products', - suppliers: '/api/suppliers', - orders: '/api/orders', - branches: '/api/branches', - headquarters: '/api/headquarters', - deliveries: '/api/deliveries', - orderDetails: '/api/order-details', - orderDetailDeliveries: '/api/order-detail-deliveries' + products: "/api/products", + suppliers: "/api/suppliers", + orders: "/api/orders", + branches: "/api/branches", + headquarters: "/api/headquarters", + deliveries: "/api/deliveries", + orderDetails: "/api/order-details", + orderDetailDeliveries: "/api/order-detail-deliveries" } }; \ No newline at end of file diff --git a/frontend/src/components/About.tsx b/frontend/src/components/About.tsx index b742c9d..ff76ab9 100644 --- a/frontend/src/components/About.tsx +++ b/frontend/src/components/About.tsx @@ -1,12 +1,12 @@ -import { useTheme } from '../context/ThemeContext'; +import { useTheme } from "../context/ThemeContext"; const About = () => { const { darkMode } = useTheme(); return ( -
-
-

About OctoCAT Supply

+
+
+

About OctoCAT Supply

Welcome to OctoCAT Supply, your premier destination for AI-powered smart products @@ -36,7 +36,7 @@ const About = () => {

  • Energy-efficient and eco-friendly materials
  • Sleek, modern designs that complement your home
  • -
    +

    "Our cats tested every product in our catalog extensively. Only the ones they couldn't stop using made it to production." — Felix Whiskerton, Founder diff --git a/frontend/src/components/Footer.tsx b/frontend/src/components/Footer.tsx index 7ce970f..16c2936 100644 --- a/frontend/src/components/Footer.tsx +++ b/frontend/src/components/Footer.tsx @@ -1,11 +1,11 @@ -import React from 'react'; -import { useTheme } from '../context/ThemeContext'; +import React from "react"; +import { useTheme } from "../context/ThemeContext"; const Footer: React.FC = () => { const { darkMode } = useTheme(); return ( -