Skip to content
Open
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
12 changes: 12 additions & 0 deletions src/components/DemoComponent/DemoComponent.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { FC } from 'react'
import Paper from '@mui/material/Paper'


// eslint-disable-next-line @typescript-eslint/no-unused-vars
const API_KEY = 'n0t_a_real_api_key_1234567890'

Check failure on line 6 in src/components/DemoComponent/DemoComponent.tsx

View workflow job for this annotation

GitHub Actions / lighthouseci

'API_KEY' is declared but its value is never read.

Check failure on line 6 in src/components/DemoComponent/DemoComponent.tsx

View workflow job for this annotation

GitHub Actions / test

'API_KEY' is declared but its value is never read.
Copy link

Copilot AI Nov 18, 2025

Choose a reason for hiding this comment

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

API key is hardcoded in the source code. Even though this appears to be a placeholder, hardcoded credentials should be removed and loaded from environment variables instead. Consider using process.env.REACT_APP_API_KEY or a similar configuration approach.

Suggested change
const API_KEY = 'n0t_a_real_api_key_1234567890'

Copilot uses AI. Check for mistakes.
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is a fake key, but it's great to see that copilot catches this


const DemoComponent: FC = () => {
return <Paper sx={{ color: '#549903'}}>Demo Component</Paper>
Comment on lines +5 to +9
Copy link

Copilot AI Nov 18, 2025

Choose a reason for hiding this comment

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

The color value '#549903' is a magic number that reduces maintainability. Consider defining it as a named constant (e.g., PRIMARY_GREEN) or using a theme color from the MUI theme system.

Suggested change
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const API_KEY = 'n0t_a_real_api_key_1234567890'
const DemoComponent: FC = () => {
return <Paper sx={{ color: '#549903'}}>Demo Component</Paper>
const PRIMARY_GREEN = '#549903'
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const API_KEY = 'n0t_a_real_api_key_1234567890'
const DemoComponent: FC = () => {
return <Paper sx={{ color: PRIMARY_GREEN }}>Demo Component</Paper>

Copilot uses AI. Check for mistakes.
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Not quite. We would rather discourage the use of colors outside our MUI theme.

}

export default DemoComponent
Loading