Skip to content

Commit

Permalink
Merge pull request #15 from shammy642/env-problems
Browse files Browse the repository at this point in the history
Env problems
  • Loading branch information
JHLincoln authored Oct 16, 2024
2 parents 11ec706 + f6745c4 commit c123fb9
Show file tree
Hide file tree
Showing 5 changed files with 132 additions and 4 deletions.
30 changes: 30 additions & 0 deletions frontend/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
module.exports = {
root: true,
env: { browser: true, es2020: true },
extends: [
"eslint:recommended",
"plugin:react/recommended",
"plugin:react/jsx-runtime",
"plugin:react-hooks/recommended",
],
ignorePatterns: ["dist", ".eslintrc.cjs"],
parserOptions: { ecmaVersion: "latest", sourceType: "module" },
settings: { react: { version: "18.2" } },
plugins: ["react-refresh"],
rules: {
"react-refresh/only-export-components": [
"warn",
{ allowConstantExport: true },
],
"react/prop-types": "off",
},
// Test Settings
overrides: [
{
env: { jest: true },
files: ["tests/**"],
plugins: ["vitest"],
extends: ["plugin:vitest/recommended"],
},
],
};
5 changes: 4 additions & 1 deletion frontend/jsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
{
"compilerOptions": {
"checkJs": true,
"jsx": "react-jsx"
"jsx": "react-jsx",
"module": "es2022",
"moduleResolution": "Node",
"types": ["vite/client"]
},
"exclude": ["node_modules", "**/node_modules/*"]
}
92 changes: 92 additions & 0 deletions frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion frontend/src/socket.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import { io } from "socket.io-client";
// const SOCKET_URL = import.meta.env.SOCKET_BACKEND_URL;

const SOCKET_URL = import.meta.env.VITE_SOCKET_BACKEND_URL;
console.log("SOCKET_URL",SOCKET_URL)

export const socket = io("http://localhost:3001")
5 changes: 3 additions & 2 deletions frontend/vite.config.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'

// https://vitejs.dev/config/

export default defineConfig({
plugins: [react()],
test: {globals: true,
test: {
globals: true,
environment: "jsdom"
}
})

0 comments on commit c123fb9

Please sign in to comment.