Skip to content

Commit

Permalink
run format on all files
Browse files Browse the repository at this point in the history
  • Loading branch information
jakewheeler committed Oct 24, 2024
1 parent 4f3a2b5 commit f4a4f22
Show file tree
Hide file tree
Showing 20 changed files with 100 additions and 103 deletions.
7 changes: 2 additions & 5 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,8 @@
"plugin:@typescript-eslint/recommended",
"prettier"
],
"plugins": [
"react",
"@typescript-eslint"
],
"plugins": ["react", "@typescript-eslint"],
"rules": {
"react/react-in-jsx-scope": "off"
}
}
}
4 changes: 2 additions & 2 deletions .github/workflows/lighthouse.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: "18"
node-version: '18'
cache: ${{ steps.detect-package-manager.outputs.manager }}
- name: Setup Pages
uses: actions/configure-pages@v2
Expand Down Expand Up @@ -61,7 +61,7 @@ jobs:
- name: Audit URLs using Lighthouse
uses: treosh/lighthouse-ci-action@v9
with:
configPath: "./lighthouserc.yml"
configPath: './lighthouserc.yml'
uploadArtifacts: false # save results as an action artifacts
temporaryPublicStorage: false # upload lighthouse report to the temporary storage

6 changes: 3 additions & 3 deletions .github/workflows/pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ name: Deploy Next.js site to Pages
on:
# Runs on pushes targeting the default branch
push:
branches: ["main"]
branches: ['main']

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
Expand All @@ -20,7 +20,7 @@ permissions:

# Allow one concurrent deployment
concurrency:
group: "pages"
group: 'pages'
cancel-in-progress: true

jobs:
Expand Down Expand Up @@ -50,7 +50,7 @@ jobs:
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: "18"
node-version: '18'
cache: ${{ steps.detect-package-manager.outputs.manager }}
- name: Setup Pages
uses: actions/configure-pages@v2
Expand Down
12 changes: 6 additions & 6 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"semi": true,
"trailingComma": "all",
"singleQuote": true,
"printWidth": 80,
"tabWidth": 2,
"plugins": ["prettier-plugin-tailwindcss"]
"semi": true,
"trailingComma": "all",
"singleQuote": true,
"printWidth": 80,
"tabWidth": 2,
"plugins": ["prettier-plugin-tailwindcss"]
}
4 changes: 2 additions & 2 deletions akamai-loader.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const normalizeSrc = (src) => (src[0] === "/" ? src.slice(1) : src);
const normalizeSrc = (src) => (src[0] === '/' ? src.slice(1) : src);
export default function akamaiLoader({ src, width, quality }) {
return "/" + normalizeSrc(src) + "?imwidth=" + width;
return '/' + normalizeSrc(src) + '?imwidth=' + width;
}
2 changes: 1 addition & 1 deletion lighthouserc.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
ci:
collect:
staticDistDir: "./out"
staticDistDir: './out'
assert:
assertions:
categories:accessibility: [error, { minScore: 1 }]
Expand Down
14 changes: 7 additions & 7 deletions next.config.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
const path = require("path");
const path = require('path');

/**
* @type {import('next').NextConfig}
*/
const nextConfig = {
output: "export",
output: 'export',
reactStrictMode: true,
swcMinify: true,
images: {
loader: "custom",
loaderFile: "./akamai-loader.js",
loader: 'custom',
loaderFile: './akamai-loader.js',
},
basePath: "/dibbs-site",
assetPrefix: "/dibbs-site",
basePath: '/dibbs-site',
assetPrefix: '/dibbs-site',
sassOptions: {
includePaths: [path.join(__dirname, "styles")],
includePaths: [path.join(__dirname, 'styles')],
},
};

Expand Down
18 changes: 9 additions & 9 deletions src/app/components/Footer.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
"use client";
import { Header, PrimaryNav } from "@trussworks/react-uswds";
import Link from "next/link";
import Image from "next/image";
import React from "react";
import styles from "../styles/Home.module.scss";
import { NavigationLink } from "./Header";
'use client';
import { Header, PrimaryNav } from '@trussworks/react-uswds';
import Link from 'next/link';
import Image from 'next/image';
import React from 'react';
import styles from '../styles/Home.module.scss';
import { NavigationLink } from './Header';

export default function Footer() {
const basePath = "/dibbs-site";
const basePath = '/dibbs-site';

const [expanded, setExpanded] = React.useState(false);
const onClick = () => {
Expand Down Expand Up @@ -52,7 +52,7 @@ export default function Footer() {
width={200}
height={40}
alt=""
className={"margin-x-0"}
className={'margin-x-0'}
src={`${basePath}/images/CDC.svg`}
/>
</a>
Expand Down
24 changes: 12 additions & 12 deletions src/app/components/Header.tsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
"use client";
import { Header, PrimaryNav } from "@trussworks/react-uswds";
import Link from "next/link";
import Image from "next/image";
import { usePathname } from "next/navigation";
import React from "react";
import styles from "../styles/Home.module.scss";
import { LinkProps } from "next/link";
'use client';
import { Header, PrimaryNav } from '@trussworks/react-uswds';
import Link from 'next/link';
import Image from 'next/image';
import { usePathname } from 'next/navigation';
import React from 'react';
import styles from '../styles/Home.module.scss';
import { LinkProps } from 'next/link';

interface NavigationLinkProps extends Pick<LinkProps, "href" | "onClick"> {
interface NavigationLinkProps extends Pick<LinkProps, 'href' | 'onClick'> {
children: React.ReactNode;
}

export default function Navbar() {
const basePath = "/dibbs-site";
const basePath = '/dibbs-site';

const [expanded, setExpanded] = React.useState(false);
const onClick = () => {
Expand Down Expand Up @@ -50,7 +50,7 @@ export default function Navbar() {
width={200}
height={40}
alt=""
className={"margin-x-0"}
className={'margin-x-0'}
src={`${basePath}/images/dibbs-logo.svg`}
/>
</a>
Expand Down Expand Up @@ -82,7 +82,7 @@ export function NavigationLink({
<Link href={href} passHref className={`usa-nav__link`} onClick={onClick}>
<span
className={
(isActive && "navbar-item-active") + " " + styles.navbarItemText
(isActive && 'navbar-item-active') + ' ' + styles.navbarItemText
}
>
{children}
Expand Down
6 changes: 3 additions & 3 deletions src/app/components/MarkdownComponent.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from "react";
import ReactMarkdown from "react-markdown";
import { getMarkdownContent } from "../utils/markdown";
import React from 'react';
import ReactMarkdown from 'react-markdown';
import { getMarkdownContent } from '../utils/markdown';

export default async function MarkdownContent(fileName: string) {
const markdownContent = await getMarkdownContent(fileName);
Expand Down
12 changes: 6 additions & 6 deletions src/app/components/UsaBanner.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"use client";
import React, { useState } from "react";
'use client';
import React, { useState } from 'react';
import {
Banner,
BannerHeader,
Expand All @@ -10,10 +10,10 @@ import {
BannerFlag,
MediaBlockBody,
Icon,
} from "@trussworks/react-uswds";
} from '@trussworks/react-uswds';

export default function USABanner() {
const basePath: string = "/dibbs-site";
const basePath: string = '/dibbs-site';
const [isOpen, setIsOpen] = useState(false);
const flagImg: string = `${basePath}/images/us-flag.png`;
const dotGovIcon: string = `${basePath}/images/us-gov-icon.svg`;
Expand Down Expand Up @@ -53,10 +53,10 @@ export default function USABanner() {
<MediaBlockBody>
<p>
<strong>Secure .gov websites use HTTPS</strong>
<br />A{" "}
<br />A{' '}
<strong>
lock (<Icon.Lock aria-label="Locked padlock icon" />)
</strong>{" "}
</strong>{' '}
or <strong>https://</strong> means you&apos;ve safely connected
to the .gov website. Share sensitive information only on
official, secure websites.
Expand Down
8 changes: 4 additions & 4 deletions src/app/globals.css
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
@tailwind base;
@tailwind components;
@tailwind utilities;
@import "@trussworks/react-uswds/lib/uswds.css";
@import "@trussworks/react-uswds/lib/index.css";
@import '@trussworks/react-uswds/lib/uswds.css';
@import '@trussworks/react-uswds/lib/index.css';

:root {
--background: #ffffff;
Expand Down Expand Up @@ -69,7 +69,7 @@ h1 {
}

h1 {
font-family: "Source Sans Pro", sans-serif;
font-family: 'Source Sans Pro', sans-serif;
font-size: 40px;
font-weight: 700;
line-height: 50.28px;
Expand All @@ -78,7 +78,7 @@ h1 {

h2 {
color: #224a58;
font-family: "Source Sans Pro", sans-serif;
font-family: 'Source Sans Pro', sans-serif;
font-size: 2rem;
font-style: normal;
font-weight: 700;
Expand Down
14 changes: 7 additions & 7 deletions src/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import type { Metadata } from "next";
import "./globals.css";
import Script from "next/script";
import Navbar from "./components/Header";
import Footer from "./components/Footer";
import USABanner from "./components/UsaBanner";
import type { Metadata } from 'next';
import './globals.css';
import Script from 'next/script';
import Navbar from './components/Header';
import Footer from './components/Footer';
import USABanner from './components/UsaBanner';

export const metadata: Metadata = {
title: "DIBBS Site",
title: 'DIBBS Site',
};

export default function RootLayout({
Expand Down
10 changes: 5 additions & 5 deletions src/app/our-products/page.tsx
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
import Link from "next/link";
import Link from 'next/link';

export default function ProductDetail() {
return (
<div>
<h1>Our Products</h1>
<ul>
<li>
<Link href={"/"}>Home</Link>
<Link href={'/'}>Home</Link>
</li>
<li>
<Link href={"/our-products"}>Our products</Link>
<Link href={'/our-products'}>Our products</Link>
</li>
<li>
<Link href={"/product-detail"}>Product detail</Link>
<Link href={'/product-detail'}>Product detail</Link>
</li>
<li>
<Link href={"/resources"}>Resources</Link>
<Link href={'/resources'}>Resources</Link>
</li>
</ul>
</div>
Expand Down
16 changes: 8 additions & 8 deletions src/app/page.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import MarkdownContent from "./components/MarkdownComponent";
import { Grid } from "@trussworks/react-uswds";
import Image from "next/image";
import MarkdownContent from './components/MarkdownComponent';
import { Grid } from '@trussworks/react-uswds';
import Image from 'next/image';

export default async function Home() {
const basePath = "/dibbs-site";
const basePath = '/dibbs-site';

return (
<>
<section className="usa-graphic-list usa-section usa-section--light-blue">
<div className="grid-container">
{MarkdownContent("homepage/section_1.md")}
{MarkdownContent('homepage/section_1.md')}
</div>
</section>
<section className="usa-section">
Expand All @@ -23,14 +23,14 @@ export default async function Home() {
alt="Placeholder"
/>
</Grid>
<Grid col={7}>{MarkdownContent("homepage/section_2.md")}</Grid>
<Grid col={7}>{MarkdownContent('homepage/section_2.md')}</Grid>
</Grid>
</div>
</section>
<section className="usa-section">
<div className="grid-container">
<Grid row>
<Grid col={5}>{MarkdownContent("homepage/section_3.md")}</Grid>
<Grid col={5}>{MarkdownContent('homepage/section_3.md')}</Grid>
<Grid col={7} className="flex-vertical-center padding-x-1">
<Image
src={`${basePath}/images/placeholder.png`}
Expand All @@ -46,7 +46,7 @@ export default async function Home() {
<div className="grid-container">
<Grid row>
<Grid col={12} className="flex-center">
{MarkdownContent("homepage/section_4.md")}
{MarkdownContent('homepage/section_4.md')}
</Grid>
</Grid>
</div>
Expand Down
10 changes: 5 additions & 5 deletions src/app/product-detail/page.tsx
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
import Link from "next/link";
import Link from 'next/link';

export default function ProductDetail() {
return (
<div>
<h1>Product Detail</h1>
<ul>
<li>
<Link href={"/"}>Home</Link>
<Link href={'/'}>Home</Link>
</li>
<li>
<Link href={"/our-products"}>Our products</Link>
<Link href={'/our-products'}>Our products</Link>
</li>
<li>
<Link href={"/product-detail"}>Product detail</Link>
<Link href={'/product-detail'}>Product detail</Link>
</li>
<li>
<Link href={"/resources"}>Resources</Link>
<Link href={'/resources'}>Resources</Link>
</li>
</ul>
</div>
Expand Down
Loading

0 comments on commit f4a4f22

Please sign in to comment.