Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CI] Set up ESLint CI #47

Merged
merged 3 commits into from
Mar 4, 2024
Merged
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
21 changes: 21 additions & 0 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: lint

on:
push:
branches:
- main
pull_request:
workflow_dispatch:

jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Install dependencies
run: npm ci

- name: Run ESLint
run: npm run lint
2 changes: 1 addition & 1 deletion .github/workflows/prettier.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
- main
pull_request:
workflow_dispatch:

jobs:
prettier-check:
runs-on: ubuntu-latest
Expand Down
5 changes: 1 addition & 4 deletions .lintstagedrc.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
{
"*.{ts,tsx}": [
"npm run lint",
"npm run format"
]
"*.{ts,tsx}": ["npm run lint", "npm run format"]
}
44 changes: 23 additions & 21 deletions src/components/ResultCard.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { memo } from 'react'
import { memo } from 'react';
import Button from '@mui/material/Button';
import Card from '@mui/material/Card';
import CardContent from '@mui/material/CardContent';
Expand All @@ -7,25 +7,26 @@ import ButtonGroup from '@mui/material/ButtonGroup';
import Typography from '@mui/material/Typography';
import { modalities } from '../utils/constants';

const ResultCard = memo(({
nodeName,
datasetUUID,
datasetName,
datasetTotalSubjects,
numMatchingSubjects,
imageModals,
checked,
onCheckboxChange,
}: {
nodeName: string;
datasetName: string;
datasetUUID: string;
datasetTotalSubjects: number;
numMatchingSubjects: number;
imageModals: string[];
checked: boolean;
onCheckboxChange: (id: string) => void;
}) => (
const ResultCard = memo(
({
nodeName,
datasetUUID,
datasetName,
datasetTotalSubjects,
numMatchingSubjects,
imageModals,
checked,
onCheckboxChange,
}: {
nodeName: string;
datasetName: string;
datasetUUID: string;
datasetTotalSubjects: number;
numMatchingSubjects: number;
imageModals: string[];
checked: boolean;
onCheckboxChange: (id: string) => void;
}) => (
<Card data-cy={`card-${datasetUUID}`}>
<CardContent>
<div className="grid grid-cols-12 items-center gap-2">
Expand Down Expand Up @@ -59,6 +60,7 @@ const ResultCard = memo(({
</div>
</CardContent>
</Card>
));
)
);

export default ResultCard;