diff --git a/eslint.config.js b/eslint.config.js index 238d2e4..be7211e 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -3,36 +3,49 @@ import globals from 'globals' import react from 'eslint-plugin-react' import reactHooks from 'eslint-plugin-react-hooks' import reactRefresh from 'eslint-plugin-react-refresh' +import tseslint from "@typescript-eslint/eslint-plugin" +import tsparser from "@typescript-eslint/parser" export default [ - { ignores: ['dist'] }, - { - files: ['**/*.{js,jsx}'], - languageOptions: { - ecmaVersion: 2020, - globals: globals.browser, - parserOptions: { - ecmaVersion: 'latest', - ecmaFeatures: { jsx: true }, - sourceType: 'module', - }, + { + ignores: ['dist'], + files: ['**/*.{js,jsx,ts,tsx}'], + languageOptions: { + parser: tsparser, + ecmaVersion: 2020, + globals: globals.browser, + parserOptions: { + ecmaVersion: 'latest', + ecmaFeatures: {jsx: true}, + sourceType: 'module', + }, + }, + settings: {react: {version: 'detect'}}, + plugins: { + react, + 'react-hooks': reactHooks, + 'react-refresh': reactRefresh, + '@typescript-eslint': tseslint, + }, + // extends: [ + // "eslint:recommended", + // "next/core-web-vitals", + // "plugin:react/recommended", + // "standard-with-typescript", + // "plugin:@typescript-eslint/recommended", + // ], + rules: { + ...js.configs.recommended.rules, + ...react.configs.recommended.rules, + ...react.configs['jsx-runtime'].rules, + ...reactHooks.configs.recommended.rules, + '@typescript-eslint/no-unused-vars': 'error', + 'no-unused-vars': 'off', + 'react/jsx-no-target-blank': 'off', + 'react-refresh/only-export-components': [ + 'warn', + {allowConstantExport: true}, + ], + }, }, - settings: { react: { version: '18.3' } }, - plugins: { - react, - 'react-hooks': reactHooks, - 'react-refresh': reactRefresh, - }, - rules: { - ...js.configs.recommended.rules, - ...react.configs.recommended.rules, - ...react.configs['jsx-runtime'].rules, - ...reactHooks.configs.recommended.rules, - 'react/jsx-no-target-blank': 'off', - 'react-refresh/only-export-components': [ - 'warn', - { allowConstantExport: true }, - ], - }, - }, ] diff --git a/package.json b/package.json index b65a053..607b709 100644 --- a/package.json +++ b/package.json @@ -16,32 +16,39 @@ "bootstrap": "^5.3.3", "bootswatch": "^5.3.3", "date-fns": "^4.1.0", - "i18next": "^23.15.1", - "i18next-http-backend": "^2.6.1", - "js-pkce": "^1.4.0", - "js-yaml": "^4.1.0", - "oidc-client-ts": "^3.0.1", + "i18next": "^25.7.3", + "i18next-http-backend": "^3.0.2", + "js-pkce": "^2.0.0", + "js-yaml": "^4.1.1", + "oidc-client-ts": "^3.4.1", "prop-types": "^15.8.1", - "react": "^18.3.1", - "react-bootstrap": "^2.10.4", - "react-dom": "^18.3.1", - "react-i18next": "^15.0.2", - "react-oidc-context": "^3.1.1", - "react-router-dom": "^6.26.2", - "sass": "^1.79.1", - "swr": "^2.2.5", + "react": "^19.2.3", + "react-bootstrap": "^2.10.10", + "react-dom": "^19.2.3", + "react-i18next": "^16.5.0", + "react-oidc-context": "^3.3.0", + "react-router-dom": "^7.11.0", + "sass": "^1.97.0", + "swr": "^2.3.8", "vite-plugin-compression": "^0.5.1" }, "devDependencies": { - "@eslint/js": "^9.9.0", - "@types/react": "^18.3.3", - "@types/react-dom": "^18.3.0", - "@vitejs/plugin-react": "^4.3.1", - "eslint": "^9.9.0", - "eslint-plugin-react": "^7.35.0", - "eslint-plugin-react-hooks": "^5.1.0-rc.0", - "eslint-plugin-react-refresh": "^0.4.9", - "globals": "^15.9.0", - "vite": "^5.4.1" + "typescript":">=4.0.0", + "@eslint/js": "^9.39.2", + "@tsconfig/vite-react": "^7.0.2", + "@types/js-yaml": "^4.0.9", + "@types/react": "^19.2.7", + "@types/react-dom": "^19.2.3", + "@types/web": "^0.0.303", + "@typescript-eslint/eslint-plugin": "^8.50.0", + "@typescript-eslint/parser": "^8.50.0", + "@vitejs/plugin-react": "^5.1.2", + "eslint": "^9.39.2", + "eslint-plugin-react": "^7.37.5", + "eslint-plugin-react-hooks": "^7.0.1", + "eslint-plugin-react-refresh": "^0.4.26", + "globals": "^16.5.0", + "typescript-plugin-css-modules": "^5.2.0", + "vite": "^7.3.0" } } diff --git a/src/App.jsx b/src/App.jsx deleted file mode 100644 index 8b68d58..0000000 --- a/src/App.jsx +++ /dev/null @@ -1,55 +0,0 @@ -import { useEffect } from 'react'; -import { Container } from 'react-bootstrap'; -import { Route, Routes } from 'react-router-dom'; - -import Dashboard from './pages/Dashboard.jsx'; -import NavBar from './layout/NavBar.jsx'; -import Footer from './layout/Footer.jsx'; -import Sensors from './pages/Sensors.jsx'; -import Doors from './pages/Doors.jsx'; -import OauthCallback from './pages/OauthCallback.jsx'; -import Logout from './pages/Logout.jsx'; -import Login from './pages/Login.jsx'; -import RequireLoggedIn from './widgets/Route/RequireLoggedIn.jsx'; -import ActionLog from './pages/ActionLog.jsx'; -import Lights from './pages/Lights.jsx'; -import Hvac from './pages/Hvac.jsx'; -import { useVariant } from './hooks/useVariant.js'; - -function App() { - const variant = useVariant(); - - useEffect(() => { - if (variant === 'colibri') { - document.title = 'Casa Libri'; - } - }, [variant]); - - return (<> - -
- - - } /> - - - } /> - - - } /> - - - } /> - } /> - } /> - } /> - } /> - } /> - - -
-