Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 45 additions & 1 deletion frontend/package-lock.json

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

3 changes: 2 additions & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
"ts-jest-mock-import-meta": "^1.1.0",
"ts-node": "^10.9.2",
"typescript": "^5.2.2",
"vite": "^4.5.0"
"vite": "^4.5.0",
"vite-tsconfig-paths": "^6.1.1"
Comment on lines +60 to +61

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

vite-tsconfig-paths@^6.1.1 is incompatible with vite@^4.5.0 and is unused.

Two concerns on this new dependency:

  1. Peer-dependency mismatch. vite-tsconfig-paths v6 requires Vite ≥ 5.0.0 (see the v6 release notes: "Vite >= 5.0.0 is now the minimum supported version."). This project still declares "vite": "^4.5.0" on line 60, so installs will emit peer warnings and the plugin is not guaranteed to work at runtime. Either upgrade Vite or pin vite-tsconfig-paths to a v4.x release compatible with Vite 4.

  2. Dead dependency. The plugin is never imported in frontend/vite.config.ts; the @ alias there is still resolved manually via resolve(__dirname, './src'). If the PR's "Fixed Vite alias resolution" goal was to adopt tsconfig paths, the plugin needs to be wired up; otherwise this dep should be removed.

🔧 If the intent is to use tsconfig paths, wire it up in vite.config.ts
 import react from '@vitejs/plugin-react-swc'
 import { dirname, resolve } from 'path'
 import { fileURLToPath } from 'url'
 import { defineConfig } from 'vite'
+import tsconfigPaths from 'vite-tsconfig-paths'

 const __filename = fileURLToPath(import.meta.url)
 const __dirname = dirname(__filename)

 export default defineConfig({
-  plugins: [react()],
+  plugins: [react(), tsconfigPaths()],
   resolve: {
     alias: {
       '@': resolve(__dirname, './src'),
     },
   },
 })

Note: with tsconfigPaths() handling @/* from tsconfig.json, the manual resolve.alias entry becomes redundant and can be removed.

#!/bin/bash
# Confirm the plugin is never actually imported anywhere in the frontend.
rg -nP "vite-tsconfig-paths|tsconfigPaths" -C2

# Confirm the peer-dep range declared by vite-tsconfig-paths@6.1.1.
npm view vite-tsconfig-paths@6.1.1 peerDependencies engines
# And the latest v4.x release that supports Vite 4.
npm view vite-tsconfig-paths versions --json | tail -50
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@frontend/package.json` around lines 60 - 61, The package.json adds
vite-tsconfig-paths@^6.1.1 which is incompatible with the project's vite@^4.5.0
and is unused; either downgrade the plugin to a v4.x release that supports Vite
4 or remove the dependency, and if the intent is to use tsconfig path aliases
wire the plugin into frontend/vite.config.ts by importing tsconfigPaths
(tsconfigPaths()) and removing the manual resolve alias for '@/...' so the
plugin actually handles `@/`* resolution; update package.json and vite.config.ts
accordingly and ensure no remaining imports reference vite-tsconfig-paths if you
remove it.

}
}
8 changes: 4 additions & 4 deletions frontend/tailwind.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/** @type {import('tailwindcss').Config} */
const colors = require('tailwindcss/colors');
const defaultTheme = require('tailwindcss/defaultTheme');
import colors from 'tailwindcss/colors'
import defaultTheme from 'tailwindcss/defaultTheme'

// @type {import('tailwindcss').Config}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Broken JSDoc type annotation — use block-comment form.

// @type {import('tailwindcss').Config} is not a valid JSDoc annotation; TypeScript/editors only recognize the /** ... */ block form, so type checking and intellisense on this config object are silently lost. This was likely an accidental edit during the ESM migration.

🔧 Proposed fix
-// `@type` {import('tailwindcss').Config}
+/** `@type` {import('tailwindcss').Config} */
 export default {
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
// @type {import('tailwindcss').Config}
/** `@type` {import('tailwindcss').Config} */
export default {
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@frontend/tailwind.config.js` at line 4, Replace the line-style JSDoc
annotation with a block JSDoc so editors/TypeScript pick up the Tailwind config
type: change the current comment `// `@type` {import('tailwindcss').Config}` to
the block form `/** `@type` {import('tailwindcss').Config} */` located immediately
above the exported config object (the Tailwind config declaration in this file)
so intellisense and type checking apply to the config.

export default {
content: ['./index.html', './src/**/*.{js,ts,jsx,tsx}'],
darkMode: 'class',
Expand Down Expand Up @@ -38,4 +38,4 @@ export default {
},
},
plugins: [],
};
}
15 changes: 9 additions & 6 deletions frontend/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react-swc';
import path from 'path';
import react from '@vitejs/plugin-react-swc'
import { dirname, resolve } from 'path'
import { fileURLToPath } from 'url'
import { defineConfig } from 'vite'

const __filename = fileURLToPath(import.meta.url)
const __dirname = dirname(__filename)

// https://vitejs.dev/config/
export default defineConfig({
plugins: [react()],
resolve: {
alias: {
'@': path.resolve(__dirname, './src'),
'@': resolve(__dirname, './src'),
},
},
});
})