Skip to content

Commit

Permalink
👕 #347 以下のESLintの警告に対応
Browse files Browse the repository at this point in the history
/lgtm-cat-frontend/src/app/_components/Header.test.tsx
  31:51  warning  Use shorthand boolean attribute 'isLoggedIn'  react/prefer-shorthand-boolean
  42:51  warning  Use shorthand boolean attribute 'isLoggedIn'  react/prefer-shorthand-boolean

/lgtm-cat-frontend/src/app/_components/HeaderLogo.tsx
  21:41  warning  Use shorthand boolean attribute 'aria-hidden'  react/prefer-shorthand-boolean

/lgtm-cat-frontend/src/app/_components/LoginButton.tsx
  14:7  warning  Use shorthand boolean attribute 'showGithubIcon'  react/prefer-shorthand-boolean
  • Loading branch information
keitakn committed Oct 10, 2024
1 parent 1f69d99 commit 2128289
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/app/_components/Footer.test.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { render, screen } from '@testing-library/react';
import { expect } from 'vitest';
import { expect, it } from 'vitest';
import { Footer } from './Footer';
import '@testing-library/jest-dom';

Expand Down
4 changes: 3 additions & 1 deletion src/app/_components/Header.test.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { render, screen } from '@testing-library/react';
import { expect } from 'vitest';
import { expect, it } from 'vitest';
import { Header } from './Header';
import '@testing-library/jest-dom';

Expand Down Expand Up @@ -28,6 +28,7 @@ it('show isLoggedIn false language is en', () => {
});

it('show isLoggedIn true language is ja', () => {
// eslint-disable-next-line react/prefer-shorthand-boolean
render(<Header language="ja" currentUrlPath="/" isLoggedIn={true} />);

expect(screen.getByRole('link', { name: 'LGTMeow' })).toBeTruthy();
Expand All @@ -39,6 +40,7 @@ it('show isLoggedIn true language is ja', () => {
});

it('show isLoggedIn true language is en', () => {
// eslint-disable-next-line react/prefer-shorthand-boolean
render(<Header language="en" currentUrlPath="/" isLoggedIn={true} />);

expect(screen.getByRole('link', { name: 'LGTMeow' })).toBeTruthy();
Expand Down
1 change: 1 addition & 0 deletions src/app/_components/HeaderLogo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export function HeaderLogo({ language }: Props): JSX.Element {
className="flex h-10 w-[218px] items-center justify-center gap-0.5 bg-orange-500"
prefetch={false}
>
{/* eslint-disable-next-line react/prefer-shorthand-boolean */}
<LgtmCatIcon className="shrink-0" aria-hidden={true} />
<h1 className="text-4xl font-bold text-orange-50 no-underline">
<Text>LGTMeow</Text>
Expand Down
1 change: 1 addition & 0 deletions src/app/_components/LoginButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export function LoginButton({ language }: Props): JSX.Element {
return (
<IconButton
displayText={language === 'en' ? 'Login' : 'ログイン'}
// eslint-disable-next-line react/prefer-shorthand-boolean
showGithubIcon={true}
link={createIncludeLanguageAppPath('login', language)}
/>
Expand Down

0 comments on commit 2128289

Please sign in to comment.