Skip to content

Commit

Permalink
Add eslint CI step
Browse files Browse the repository at this point in the history
  • Loading branch information
Mayurifag committed Sep 13, 2024
1 parent a2f373f commit 205de31
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 2 deletions.
17 changes: 17 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,3 +76,20 @@ jobs:

- name: Run flake8
run: flake8 .

eslint:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '20'

- name: Run ESLint
working-directory: ./frontend
run: |
npm install
npm run lint
6 changes: 5 additions & 1 deletion frontend/next.config.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
/** @type {import('next').NextConfig} */
const nextConfig = {};
const nextConfig = {
images: {
domains: ['localhost'], // Allow images from localhost
},
};

export default nextConfig;
12 changes: 11 additions & 1 deletion frontend/src/app/components/RenderSticker/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { useState, useEffect } from 'react';
import axios from 'axios';
import Lottie from 'lottie-react';
import Image from 'next/image';

interface Sticker {
file_id: string;
Expand All @@ -13,6 +14,7 @@ interface RenderStickerProps {
}

export function RenderSticker({ sticker }: RenderStickerProps) {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const [animationData, setAnimationData] = useState<any>(null);
const [isLoading, setIsLoading] = useState(false);

Expand Down Expand Up @@ -55,6 +57,14 @@ export function RenderSticker({ sticker }: RenderStickerProps) {
</video>
);
} else {
return <img src={stickerUrl} className="w-full h-auto max-w-[300px] object-contain p-1" />;
return (
<Image
src={stickerUrl}
alt="Sticker image"
width={300}
height={300}
className="w-full h-auto max-w-[300px] object-contain p-1"
/>
);
}
}
1 change: 1 addition & 0 deletions makefiles/uv.mk
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,4 @@ start: start-ngrok
lint:
uvx ruff check
uvx flake8
cd frontend && npm run lint

0 comments on commit 205de31

Please sign in to comment.