Skip to content

Commit 325d16b

Browse files
committed
null fix
1 parent 82015fb commit 325d16b

3 files changed

Lines changed: 18 additions & 1 deletion

File tree

.github/workflows/build-test.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,12 @@ jobs:
4040
- name: Run linter
4141
run: npm run lint
4242

43+
- name: SonarQube Scan
44+
uses: SonarSource/sonarqube-scan-action@v4
45+
env:
46+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
47+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
48+
4349
- name: Build production bundle
4450
run: npm run build
4551

app/components/ui/ProductCard.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ export default function ProductCard({ product, showCompare = false }: ProductCar
119119
</div>
120120

121121
{/* Small rating if available */}
122-
{product.rating > 0 && (
122+
{(product.rating ?? 0) > 0 && (
123123
<div className="flex items-center gap-1 text-xs font-medium bg-secondary/50 px-2 py-1 rounded-md">
124124
<span className="text-orange-400"></span> {product.rating}
125125
</div>

sonar-project.properties

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
sonar.projectKey=<INSERT_PROJECT_KEY>
2+
sonar.organization=<INSERT_ORGANIZATION_KEY>
3+
sonar.host.url=https://sonarcloud.io
4+
5+
# Source code
6+
sonar.sources=.
7+
sonar.exclusions=**/node_modules/**,**/.next/**,**/out/**,**/coverage/**,**/*.spec.ts,**/*.test.ts,**/*.config.js,**/*.config.ts
8+
9+
# Tests
10+
sonar.tests=.
11+
sonar.test.inclusions=**/*.spec.ts,**/*.test.ts

0 commit comments

Comments
 (0)