diff --git a/.eslintrc.json b/.eslintrc.json index afa46f122..5699fb6cf 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -4,14 +4,6 @@ "plugin:storybook/recommended", "plugin:storybook/recommended" ], - "plugins": [ - "prettier", - "simple-import-sort", - "eslint-plugin-import" - ], - "ignorePatterns": [ - "dist", - "node_modules", - ".sanity" - ] + "plugins": ["prettier", "simple-import-sort", "eslint-plugin-import"], + "ignorePatterns": ["dist", "node_modules", ".sanity"] } diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 969acf8b4..bc5b7e3bd 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -8,7 +8,7 @@ Please provide a brief summary of the changes you’ve made. Explain the purpose If applicable, please include screenshots or a short video showcasing the changes you have made. -*Insert images or videos here.* +_Insert images or videos here._ --- @@ -24,4 +24,4 @@ Please ensure that you’ve completed the following checkpoints before submittin ## Additional Notes -Other comments relevant to this pull request. \ No newline at end of file +Other comments relevant to this pull request. diff --git a/next.config.mjs b/next.config.mjs index 8f31fcbd9..8fc8a53d6 100644 --- a/next.config.mjs +++ b/next.config.mjs @@ -1,6 +1,6 @@ /** @type {import('next').NextConfig} */ const nextConfig = { - images: { + images: { remotePatterns: [ { protocol: "https", @@ -13,4 +13,4 @@ const nextConfig = { }, }; -export default nextConfig; \ No newline at end of file +export default nextConfig; diff --git a/src/app/(main)/legal/[id]/page.tsx b/src/app/(main)/legal/[id]/page.tsx index 813c211c3..4929a0321 100644 --- a/src/app/(main)/legal/[id]/page.tsx +++ b/src/app/(main)/legal/[id]/page.tsx @@ -22,7 +22,7 @@ async function Page({ params }: Props) { const initialDocument = await loadQuery( LEGAL_DOCUMENT_SLUG_QUERY, { slug: id }, - { perspective } + { perspective }, ); if (!initialDocument) { diff --git a/src/app/(main)/page.tsx b/src/app/(main)/page.tsx index acb3c83e0..bdb3885b5 100644 --- a/src/app/(main)/page.tsx +++ b/src/app/(main)/page.tsx @@ -38,7 +38,7 @@ const Home = async () => { const { data: landingId } = await loadQuery( LANDING_QUERY, {}, - { perspective } + { perspective }, ); if (!landingId) { @@ -54,7 +54,7 @@ const Home = async () => { const initialLandingPage = await loadQuery( PAGE_QUERY, { id: landingId }, - { perspective } + { perspective }, ); if (!initialLandingPage.data) { diff --git a/src/app/api/contactForm/route.ts b/src/app/api/contactForm/route.ts index 49ffa7598..4b05b451c 100644 --- a/src/app/api/contactForm/route.ts +++ b/src/app/api/contactForm/route.ts @@ -47,7 +47,7 @@ export async function POST(req: Request) { { error: "Form was not sent due to a technical error. Please try again.", }, - { status: 500 } + { status: 500 }, ); } } diff --git a/src/app/api/fetchData/route.ts b/src/app/api/fetchData/route.ts index 22d78422d..27cd41572 100644 --- a/src/app/api/fetchData/route.ts +++ b/src/app/api/fetchData/route.ts @@ -25,7 +25,7 @@ export async function POST(req: Request) { console.error("Error fetching data:", error); return NextResponse.json( { error: "Failed to fetch data" }, - { status: 500 } + { status: 500 }, ); } } diff --git a/src/blog/Blog.tsx b/src/blog/Blog.tsx index 822ef37b8..871f2b873 100644 --- a/src/blog/Blog.tsx +++ b/src/blog/Blog.tsx @@ -22,11 +22,11 @@ export const Blog = ({ blog, initialPosts, slug }: BlogProps) => { const { tabListRef, selectedTabIndex } = useTabs(); const postCategories = new Set( - initialPosts.map((post) => post.category).filter((category) => category) + initialPosts.map((post) => post.category).filter((category) => category), ); const filteredCategories = blog?.categories.filter((category) => - postCategories.has(category.name) + postCategories.has(category.name), ); const categories = [ diff --git a/src/blog/components/legal/LegalPreview.tsx b/src/blog/components/legal/LegalPreview.tsx index 381ad6342..a1b8c11ec 100644 --- a/src/blog/components/legal/LegalPreview.tsx +++ b/src/blog/components/legal/LegalPreview.tsx @@ -12,7 +12,7 @@ export default function LegalPreview({ const { data: newDoc } = useQuery( NAV_QUERY, {}, - { initial: initialDocument } + { initial: initialDocument }, ); return newDoc && ; diff --git a/src/blog/components/postPreviewGrid/PostPreviewGrid.tsx b/src/blog/components/postPreviewGrid/PostPreviewGrid.tsx index 19d237758..bbc2950d7 100644 --- a/src/blog/components/postPreviewGrid/PostPreviewGrid.tsx +++ b/src/blog/components/postPreviewGrid/PostPreviewGrid.tsx @@ -27,7 +27,7 @@ const PostPreviewGrid = ({ (index: number) => (el: HTMLAnchorElement | null) => { postRefs.current[index] = el; }, - [] + [], ); useEffect(() => { diff --git a/src/components/forms/radioButtonGroup/components/radioButton.module.css b/src/components/forms/radioButtonGroup/components/radioButton.module.css index 512a1e7a8..715c858c1 100644 --- a/src/components/forms/radioButtonGroup/components/radioButton.module.css +++ b/src/components/forms/radioButtonGroup/components/radioButton.module.css @@ -1,52 +1,52 @@ .container { - display: flex; - gap: 1rem; - align-items: center; - } - - .label { - font-size: 1rem; - color: var(--dark-purple); - } + display: flex; + gap: 1rem; + align-items: center; +} - .disabledLabel { - color: gray; - cursor: not-allowed; - } +.label { + font-size: 1rem; + color: var(--dark-purple); +} - .input { - appearance: none; - width: 24px; - height: 24px; - border: 2px solid black; - border-radius: 50%; - transition: all 0.1s ease-in-out; - box-sizing: border-box; - background-color: white; - position: relative; - } - - .input:checked::after { - content: ""; - position: absolute; - top: 4px; - left: 4px; - width: 12px; - height: 12px; - border-radius: 50%; - background-color: var(--primary-green-dark); - } +.disabledLabel { + color: gray; + cursor: not-allowed; +} - .input:hover { - background-color: var(--primary-green-light); - outline: 2px solid var(--primary-green-light); ; - } +.input { + appearance: none; + width: 24px; + height: 24px; + border: 2px solid black; + border-radius: 50%; + transition: all 0.1s ease-in-out; + box-sizing: border-box; + background-color: white; + position: relative; +} - .input:focus { - outline: 2px solid var(--primary-green-light); - } +.input:checked::after { + content: ""; + position: absolute; + top: 4px; + left: 4px; + width: 12px; + height: 12px; + border-radius: 50%; + background-color: var(--primary-green-dark); +} - .input[disabled]{ - cursor: not-allowed; - border-color: grey; - } \ No newline at end of file +.input:hover { + background-color: var(--primary-green-light); + outline: 2px solid var(--primary-green-light); +} + +.input:focus { + outline: 2px solid var(--primary-green-light); +} + +.input[disabled] { + cursor: not-allowed; + border-color: grey; +} diff --git a/src/components/forms/radioButtonGroup/radioButtonGroup.module.css b/src/components/forms/radioButtonGroup/radioButtonGroup.module.css index fc95242ef..db43fa211 100644 --- a/src/components/forms/radioButtonGroup/radioButtonGroup.module.css +++ b/src/components/forms/radioButtonGroup/radioButtonGroup.module.css @@ -1,9 +1,9 @@ - .fieldset{ - border: 0 none; - } +.fieldset { + border: 0 none; +} - .wrapper { - display: flex; - flex-direction: column; - gap: 0.5rem; - } \ No newline at end of file +.wrapper { + display: flex; + flex-direction: column; + gap: 0.5rem; +} diff --git a/src/components/navigation/footer/Footer.tsx b/src/components/navigation/footer/Footer.tsx index f9c71246f..2389aaf4a 100644 --- a/src/components/navigation/footer/Footer.tsx +++ b/src/components/navigation/footer/Footer.tsx @@ -28,7 +28,7 @@ const Footer = ({ legalData, }: IFooter) => { const renderedLogo = useConvertSanityImageToNextImage( - siteSettings.brandAssets?.secondaryLogo + siteSettings.brandAssets?.secondaryLogo, ); const currentYear = new Date().getFullYear(); @@ -78,7 +78,7 @@ const renderLinks = (data: Navigation) => {
  • - )) + )), ) ); }; @@ -92,14 +92,14 @@ const renderSoMe = (data: Navigation, soMeData: SocialMediaProfiles) => {
  • - )) + )), ) ); }; const filterSectionsByType = ( data: Navigation, - type: "content" | "socialMedia" + type: "content" | "socialMedia", ) => data.footer?.filter((section) => section.sectionType === type); const renderList = (children: ReactNode) => ( diff --git a/src/components/navigation/footer/FooterPreview.tsx b/src/components/navigation/footer/FooterPreview.tsx index dc32aa49c..d77864b67 100644 --- a/src/components/navigation/footer/FooterPreview.tsx +++ b/src/components/navigation/footer/FooterPreview.tsx @@ -10,7 +10,7 @@ import { SOMEPROFILES_QUERY } from "studio/lib/queries/socialMediaProfiles"; function useInitialData( query: string, - initialData: QueryResponseInitial + initialData: QueryResponseInitial, ): T | null { const { data } = useQuery(query, {}, { initial: initialData }); return data; @@ -28,7 +28,7 @@ export default function FooterPreview({ const newNav = useInitialData(NAV_QUERY, initialNav); const newSiteSettings = useInitialData( SITESETTINGS_QUERY, - initialSiteSetting + initialSiteSetting, ); const newSoMedata = useInitialData(SOMEPROFILES_QUERY, initialSoMe); // TODO: add legal preview diff --git a/src/components/navigation/header/Header.tsx b/src/components/navigation/header/Header.tsx index 9f95a3b1f..07a134899 100644 --- a/src/components/navigation/header/Header.tsx +++ b/src/components/navigation/header/Header.tsx @@ -111,7 +111,7 @@ export const Header = ({ data, assets }: IHeader) => { export const renderPageLinks = ( links: ILink[], isMobile: boolean, - pathname: string + pathname: string, ) => (
      {links?.map((link: ILink) => { diff --git a/src/components/navigation/header/HeaderPreview.tsx b/src/components/navigation/header/HeaderPreview.tsx index 84d66edfa..57fa2d98c 100644 --- a/src/components/navigation/header/HeaderPreview.tsx +++ b/src/components/navigation/header/HeaderPreview.tsx @@ -16,12 +16,12 @@ export default function HeaderPreview({ const { data: newNav } = useQuery( NAV_QUERY, {}, - { initial: initialNav } + { initial: initialNav }, ); const { data: newSiteSettings } = useQuery( SITESETTINGS_QUERY, {}, - { initial: initialSiteSetting } + { initial: initialSiteSetting }, ); return ( diff --git a/src/components/sections/article/Article.tsx b/src/components/sections/article/Article.tsx index 53138a5a4..737019034 100644 --- a/src/components/sections/article/Article.tsx +++ b/src/components/sections/article/Article.tsx @@ -12,7 +12,7 @@ interface ArticleProps { const Article = ({ article }: ArticleProps) => { const renderedImage = useConvertSanityImageToNextImage( - article?.imageExtended + article?.imageExtended, ); return ( diff --git a/src/components/sections/article/mockData.ts b/src/components/sections/article/mockData.ts index d70ef1a66..126fbd5dc 100644 --- a/src/components/sections/article/mockData.ts +++ b/src/components/sections/article/mockData.ts @@ -45,7 +45,7 @@ const commonLink = { const createArticleSection = ( imageAlignment: ImageAlignment, includeLink: boolean, - tag?: string + tag?: string, ): ArticleSection => ({ _key: "286f87152fce", _type: "article", @@ -65,16 +65,16 @@ const createArticleSection = ( export const extendedArticleLargeLeftMock = createArticleSection( ImageAlignment.Left, true, - "Measure" + "Measure", ); export const extendedArticleLargeRightMock = createArticleSection( ImageAlignment.Right, true, - "Measure" + "Measure", ); export const articleLeftMock = createArticleSection(ImageAlignment.Left, false); export const articleRightMock = createArticleSection( ImageAlignment.Right, - false + false, ); diff --git a/src/components/sections/callToAction/CallToActionPreview.tsx b/src/components/sections/callToAction/CallToActionPreview.tsx index dd44de485..c4fa1b1a4 100644 --- a/src/components/sections/callToAction/CallToActionPreview.tsx +++ b/src/components/sections/callToAction/CallToActionPreview.tsx @@ -14,17 +14,17 @@ export default function CallToActionPreview({ const { data: newData } = useQuery( PAGE_QUERY, { id: initialData.data._id }, - { initial: initialData } + { initial: initialData }, ); const callToActionSection = newData ? (newData.sections.find( (section, index) => - section._type === "ctaSection" && index === sectionIndex + section._type === "ctaSection" && index === sectionIndex, ) as CallToActionSection) : (initialData.data.sections.find( (section, index) => - section._type === "ctaSection" && index === sectionIndex + section._type === "ctaSection" && index === sectionIndex, ) as CallToActionSection); return ( diff --git a/src/components/sections/callout/CalloutPreview.tsx b/src/components/sections/callout/CalloutPreview.tsx index 71958d0df..cf6aafdab 100644 --- a/src/components/sections/callout/CalloutPreview.tsx +++ b/src/components/sections/callout/CalloutPreview.tsx @@ -14,17 +14,17 @@ export default function CalloutPreview({ const { data: newData } = useQuery( PAGE_QUERY, { id: initialData.data._id }, - { initial: initialData } + { initial: initialData }, ); const calloutSection = newData ? (newData.sections.find( (section, index) => - section._type === "callout" && index === sectionIndex + section._type === "callout" && index === sectionIndex, ) as CalloutSection) : (initialData.data.sections.find( (section, index) => - section._type === "callout" && index === sectionIndex + section._type === "callout" && index === sectionIndex, ) as CalloutSection); return ( diff --git a/src/components/sections/contactForm/ContactForm.tsx b/src/components/sections/contactForm/ContactForm.tsx index e6fcdba52..e962aae57 100644 --- a/src/components/sections/contactForm/ContactForm.tsx +++ b/src/components/sections/contactForm/ContactForm.tsx @@ -35,7 +35,7 @@ const ContactForm: React.FC = ({ data }) => { const handleChange = ( name: keyof ContactData | "privacyPolicy", - value: string | boolean + value: string | boolean, ) => { if (name === "privacyPolicy" && typeof value === "boolean") { setIsChecked(value); diff --git a/src/components/sections/grid/GridPreview.tsx b/src/components/sections/grid/GridPreview.tsx index 5dda57b05..830593398 100644 --- a/src/components/sections/grid/GridPreview.tsx +++ b/src/components/sections/grid/GridPreview.tsx @@ -14,15 +14,15 @@ export default function GridPreview({ const { data: newData } = useQuery( PAGE_QUERY, { id: initialData.data._id }, - { initial: initialData } + { initial: initialData }, ); const grid = newData ? (newData.sections.find( - (section, index) => section._type === "grid" && index === sectionIndex + (section, index) => section._type === "grid" && index === sectionIndex, ) as GridSection) : (initialData.data.sections.find( - (section, index) => section._type === "grid" && index === sectionIndex + (section, index) => section._type === "grid" && index === sectionIndex, ) as GridSection); return ( diff --git a/src/components/sections/hero/HeroPreview.tsx b/src/components/sections/hero/HeroPreview.tsx index fcb99e230..3b4dd472a 100644 --- a/src/components/sections/hero/HeroPreview.tsx +++ b/src/components/sections/hero/HeroPreview.tsx @@ -19,15 +19,15 @@ export default function HeroPreview({ const { data: newData } = useQuery( PAGE_QUERY, { id: initialData.data._id }, - { initial: initialData } + { initial: initialData }, ); const heroSection = newData ? (newData.sections.find( - (section, index) => section._type === "hero" && index === sectionIndex + (section, index) => section._type === "hero" && index === sectionIndex, ) as HeroSection) : (initialData.data.sections.find( - (section, index) => section._type === "hero" && index === sectionIndex + (section, index) => section._type === "hero" && index === sectionIndex, ) as HeroSection); return ( diff --git a/src/components/sections/imageSection/ImageSectionComponentPreview.tsx b/src/components/sections/imageSection/ImageSectionComponentPreview.tsx index ce2e05850..9eda15c2d 100644 --- a/src/components/sections/imageSection/ImageSectionComponentPreview.tsx +++ b/src/components/sections/imageSection/ImageSectionComponentPreview.tsx @@ -17,17 +17,17 @@ export default function ImageSectionComponentPreview({ const { data: newData } = useQuery( PAGE_QUERY, { id: initialData.data._id }, - { initial: initialData } + { initial: initialData }, ); const testimonialsSection = newData ? (newData.sections.find( (section, index) => - section._type === "imageSection" && index === sectionIndex + section._type === "imageSection" && index === sectionIndex, ) as ImageSection) : (initialData.data.sections.find( (section, index) => - section._type === "imageSection" && index === sectionIndex + section._type === "imageSection" && index === sectionIndex, ) as ImageSection); return ( diff --git a/src/components/sections/logoSalad/LogoSalad.tsx b/src/components/sections/logoSalad/LogoSalad.tsx index 2a91d1504..ae9a0bae2 100644 --- a/src/components/sections/logoSalad/LogoSalad.tsx +++ b/src/components/sections/logoSalad/LogoSalad.tsx @@ -32,7 +32,7 @@ export const LogoSalad = ({ logoSalad }: LogoSaladProps) => {
    • - ) + ), )}
    )} diff --git a/src/components/sections/logoSalad/LogoSaladPreview.tsx b/src/components/sections/logoSalad/LogoSaladPreview.tsx index b7c690a67..d09d4fb27 100644 --- a/src/components/sections/logoSalad/LogoSaladPreview.tsx +++ b/src/components/sections/logoSalad/LogoSaladPreview.tsx @@ -14,17 +14,17 @@ export default function LogoSaladPreview({ const { data: newData } = useQuery( PAGE_QUERY, { id: initialData.data._id }, - { initial: initialData } + { initial: initialData }, ); const logoSaladSection = newData ? (newData.sections.find( (section, index) => - section._type === "logoSalad" && index === sectionIndex + section._type === "logoSalad" && index === sectionIndex, ) as LogoSaladSection) : (initialData.data.sections.find( (section, index) => - section._type === "logoSalad" && index === sectionIndex + section._type === "logoSalad" && index === sectionIndex, ) as LogoSaladSection); return ( diff --git a/src/components/sections/logoSalad/logoSalad.module.css b/src/components/sections/logoSalad/logoSalad.module.css index 914cdbe72..dd8542baa 100644 --- a/src/components/sections/logoSalad/logoSalad.module.css +++ b/src/components/sections/logoSalad/logoSalad.module.css @@ -88,4 +88,4 @@ object-fit: contain; } } -} \ No newline at end of file +} diff --git a/src/components/sections/testimonials/Testimonials.tsx b/src/components/sections/testimonials/Testimonials.tsx index 1db1d3de1..ed1d02d0b 100644 --- a/src/components/sections/testimonials/Testimonials.tsx +++ b/src/components/sections/testimonials/Testimonials.tsx @@ -80,7 +80,7 @@ export const Testimonials = ({ testimonials }: TestimonialsProps) => { > - ) + ), )} diff --git a/src/components/sections/testimonials/TestimonialsPreview.tsx b/src/components/sections/testimonials/TestimonialsPreview.tsx index ccda0d41f..cb14ab394 100644 --- a/src/components/sections/testimonials/TestimonialsPreview.tsx +++ b/src/components/sections/testimonials/TestimonialsPreview.tsx @@ -14,17 +14,17 @@ export default function TestimonialsPreview({ const { data: newData } = useQuery( PAGE_QUERY, { id: initialData.data._id }, - { initial: initialData } + { initial: initialData }, ); const testimonialsSection = newData ? (newData.sections.find( (section, index) => - section._type === "testimonials" && index === sectionIndex + section._type === "testimonials" && index === sectionIndex, ) as TestimonialsSection) : (initialData.data.sections.find( (section, index) => - section._type === "testimonials" && index === sectionIndex + section._type === "testimonials" && index === sectionIndex, ) as TestimonialsSection); return ( diff --git a/src/salaryAndBenefits/salaryAndBenefits.module.css b/src/salaryAndBenefits/salaryAndBenefits.module.css index c53fdbc23..f057485d6 100644 --- a/src/salaryAndBenefits/salaryAndBenefits.module.css +++ b/src/salaryAndBenefits/salaryAndBenefits.module.css @@ -1,19 +1,19 @@ .wrapper { - display: flex; - flex-direction: column; - padding: 10rem 5rem; - gap: 5rem; + display: flex; + flex-direction: column; + padding: 10rem 5rem; + gap: 5rem; } .benefits { - display: flex; - flex-direction: column; - gap: 5rem; - max-width: var(--max-content-width-medium); + display: flex; + flex-direction: column; + gap: 5rem; + max-width: var(--max-content-width-medium); } .benefitWrapper { - display: flex; - flex-direction: column; - gap: 1rem; -} \ No newline at end of file + display: flex; + flex-direction: column; + gap: 1rem; +} diff --git a/src/stories/Colors/colors.module.css b/src/stories/Colors/colors.module.css index f33231bef..ecd57bbcf 100644 --- a/src/stories/Colors/colors.module.css +++ b/src/stories/Colors/colors.module.css @@ -1,27 +1,27 @@ .colorGrid { - display: grid; - gap: 10px; + display: grid; + gap: 10px; } .colorBox { - display: flex; - gap: 20px; - justify-content: space-between; - align-items: end; + display: flex; + gap: 20px; + justify-content: space-between; + align-items: end; - p { - margin: 0; - padding: 0; - } + p { + margin: 0; + padding: 0; + } - &>div { - width: 300px; - } + & > div { + width: 300px; + } } .color { - flex: 2; - height: 100px; - border-radius: 12px; - border: 1px solid #ccc; -} \ No newline at end of file + flex: 2; + height: 100px; + border-radius: 12px; + border: 1px solid #ccc; +} diff --git a/src/utils/api.ts b/src/utils/api.ts index 4f94b53fc..9f44e87fe 100644 --- a/src/utils/api.ts +++ b/src/utils/api.ts @@ -13,7 +13,7 @@ interface FetchResult { export const fetchCategorizedPosts = async ( category: string | null, start = 0, - end = 11 + end = 11, ): Promise => { try { const data = await client.fetch(CATEGORIZED_POSTS_QUERY, { @@ -29,7 +29,7 @@ export const fetchCategorizedPosts = async ( }; export const fetchPostCount = async ( - category?: string | null + category?: string | null, ): Promise => { try { const count = await client.fetch(COUNT_POSTS_QUERY, { category }); diff --git a/src/utils/extractLeadText.ts b/src/utils/extractLeadText.ts index 0934332af..4b51f0e68 100644 --- a/src/utils/extractLeadText.ts +++ b/src/utils/extractLeadText.ts @@ -51,7 +51,7 @@ export function extractLeadText(blocks: PortableTextBlock[]): ExtractedText { // Split the block to fit the MAX_LENGTH without breaking words const splitIndex = blockText.lastIndexOf( " ", - MAX_LENGTH - accumulatedLength + MAX_LENGTH - accumulatedLength, ); leadText += blockText.substring(0, splitIndex) + " "; leftoverText = blockText.substring(splitIndex + 1); diff --git a/src/utils/hooks/useConvertImage.tsx b/src/utils/hooks/useConvertImage.tsx index 0c73224ef..a85f85e04 100644 --- a/src/utils/hooks/useConvertImage.tsx +++ b/src/utils/hooks/useConvertImage.tsx @@ -45,7 +45,7 @@ const SanityImage = ({ image }: { image: IImage }) => { // Custom hook for converting an image from Sanity to Next.js image component export function useConvertSanityImageToNextImage( - image: IImage | undefined + image: IImage | undefined, ): JSX.Element | null { // Return mockData.image for stories in Storybook if (image?.src) { diff --git a/src/utils/hooks/useFetchPosts.ts b/src/utils/hooks/useFetchPosts.ts index a15b67b4e..93019d6d4 100644 --- a/src/utils/hooks/useFetchPosts.ts +++ b/src/utils/hooks/useFetchPosts.ts @@ -46,7 +46,7 @@ export const useFetchPosts = ({ const { data, error } = await fetchCategorizedPosts( category, start, - end + end, ); const count = await fetchPostCount(category); @@ -68,7 +68,7 @@ export const useFetchPosts = ({ } }, // eslint-disable-next-line react-hooks/exhaustive-deps - [selectedTabIndex] + [selectedTabIndex], ); return { posts, postsCount, fetchPosts }; diff --git a/src/utils/hooks/useTabs.ts b/src/utils/hooks/useTabs.ts index ebe286530..7ba1f51a2 100644 --- a/src/utils/hooks/useTabs.ts +++ b/src/utils/hooks/useTabs.ts @@ -50,7 +50,7 @@ const useTabs = () => { // Show the selected panel const controlledPanel = tabGroup.querySelector( - `#${targetTab.getAttribute("aria-controls")}` + `#${targetTab.getAttribute("aria-controls")}`, ); controlledPanel?.removeAttribute("aria-hidden"); }; diff --git a/src/utils/renderSection.tsx b/src/utils/renderSection.tsx index 482639ae0..09371a6b6 100644 --- a/src/utils/renderSection.tsx +++ b/src/utils/renderSection.tsx @@ -44,7 +44,7 @@ const renderHeroSection = ( sectionIndex: number, isDraftMode: boolean, initialData: QueryResponseInitial, - isLandingPage: boolean + isLandingPage: boolean, ) => { return isDraftMode ? ( + initialData: QueryResponseInitial, ) => { return isDraftMode ? ( @@ -74,7 +74,7 @@ const renderArticleSection = ( section: ArticleSection, sectionIndex: number, isDraftMode: boolean, - initialData: QueryResponseInitial + initialData: QueryResponseInitial, ) => { return isDraftMode ? ( @@ -87,7 +87,7 @@ const renderCalloutSection = ( section: CalloutSection, sectionIndex: number, isDraftMode: boolean, - initialData: QueryResponseInitial + initialData: QueryResponseInitial, ) => { return isDraftMode ? ( @@ -100,7 +100,7 @@ const renderCallToActionSection = ( section: CallToActionSection, sectionIndex: number, isDraftMode: boolean, - initialData: QueryResponseInitial + initialData: QueryResponseInitial, ) => { return isDraftMode ? ( + initialData: QueryResponseInitial, ) => { return isDraftMode ? ( + initialData: QueryResponseInitial, ) => { return isDraftMode ? ( + initialData: QueryResponseInitial, ) => { return isDraftMode ? ( @@ -161,7 +161,7 @@ const renderContactFormSection = ( section: ContactFormSection, sectionIndex: number, isDraftMode: boolean, - initialData: QueryResponseInitial + initialData: QueryResponseInitial, ) => { return isDraftMode ?
    : ; }; @@ -180,63 +180,63 @@ const SectionRenderer = ({ sectionIndex, isDraftMode, initialData, - isLandingPage + isLandingPage, ); case "logoSalad": return renderLogoSaladSection( section as LogoSaladSection, sectionIndex, isDraftMode, - initialData + initialData, ); case "article": return renderArticleSection( section as ArticleSection, sectionIndex, isDraftMode, - initialData + initialData, ); case "callout": return renderCalloutSection( section as CalloutSection, sectionIndex, isDraftMode, - initialData + initialData, ); case "ctaSection": return renderCallToActionSection( section as CallToActionSection, sectionIndex, isDraftMode, - initialData + initialData, ); case "testimonials": return renderTestimonialsSection( section as TestimonialsSection, sectionIndex, isDraftMode, - initialData + initialData, ); case "imageSection": return renderImageSection( section as ImageSection, sectionIndex, isDraftMode, - initialData + initialData, ); case "grid": return renderGridSection( section as GridSection, sectionIndex, isDraftMode, - initialData + initialData, ); case "contactForm": return renderContactFormSection( section as ContactFormSection, sectionIndex, isDraftMode, - initialData + initialData, ); default: return null; diff --git a/src/utils/seo.ts b/src/utils/seo.ts index 3739e70b4..4a12770c4 100644 --- a/src/utils/seo.ts +++ b/src/utils/seo.ts @@ -30,7 +30,7 @@ type SiteSettings = { export async function fetchSeoData( query: string, - variables?: any + variables?: any, ): Promise { try { const { data } = await loadQuery(query, variables); @@ -43,7 +43,7 @@ export async function fetchSeoData( export async function fetchPostSeoData( query: string, - variables?: any + variables?: any, ): Promise { try { const { data } = await loadQuery(query, variables); @@ -76,7 +76,7 @@ export async function fetchSiteSettings(): Promise { } export async function generateMetadataFromSeo( - seo: SeoData | null + seo: SeoData | null, ): Promise { const siteSettings = await fetchSiteSettings(); @@ -90,7 +90,7 @@ export async function generateMetadataFromSeo( const faviconUrl = favicon ? urlFor(favicon).url() : ""; const icons = [faviconUrl ? { rel: "icon", url: faviconUrl } : null].filter( - (icon): icon is NonNullable => icon !== null + (icon): icon is NonNullable => icon !== null, ); return { diff --git a/studio/components/AnchorSelect.tsx b/studio/components/AnchorSelect.tsx index 60211637c..15208d3a5 100644 --- a/studio/components/AnchorSelect.tsx +++ b/studio/components/AnchorSelect.tsx @@ -58,7 +58,7 @@ const AnchorSelect = ({ value, onChange, path }: AnchorSelectProps) => { basicTitle: title, value: `#${section._key}`, }; - } + }, ); setListItems(formattedResponseToListItems); diff --git a/studio/components/CategorySelect.tsx b/studio/components/CategorySelect.tsx index 5497ebaad..4d2dafdba 100644 --- a/studio/components/CategorySelect.tsx +++ b/studio/components/CategorySelect.tsx @@ -21,7 +21,7 @@ const CategorySelector = React.forwardRef< useEffect(() => { async function fetchCategories() { const result = await fetchWithToken( - `*[_type == "blog"][0].categories` + `*[_type == "blog"][0].categories`, ); setCategories(result || []); diff --git a/studio/components/ClearLinkFieldsButton.tsx b/studio/components/ClearLinkFieldsButton.tsx index 377a3a18f..5bca0f07a 100644 --- a/studio/components/ClearLinkFieldsButton.tsx +++ b/studio/components/ClearLinkFieldsButton.tsx @@ -11,13 +11,13 @@ const ClearLinkFieldsButton = ({ path }: ClearLinkFieldsButtonProps) => { const documentId = useFormValue(["_id"]) as string; const isObjectWithKey = ( - item: string | { _key: string } + item: string | { _key: string }, ): item is { _key: string } => { return typeof item === "object" && "_key" in item; }; const constructFieldPath = ( - path: Array + path: Array, ): string => { if (!isObjectWithKey(path[1])) return ""; diff --git a/studio/components/ReferenceSlugInput.tsx b/studio/components/ReferenceSlugInput.tsx index a60306372..2d5143951 100644 --- a/studio/components/ReferenceSlugInput.tsx +++ b/studio/components/ReferenceSlugInput.tsx @@ -58,8 +58,10 @@ const ReferenceSlugInput: React.FC = (props) => { setSlug(event.currentTarget.value); onChange( PatchEvent.from( - event.currentTarget.value ? set(event.currentTarget.value) : unset() - ) + event.currentTarget.value + ? set(event.currentTarget.value) + : unset(), + ), ); }} /> diff --git a/studio/components/SoMeInputs.tsx b/studio/components/SoMeInputs.tsx index 4657be9ac..b5970906c 100644 --- a/studio/components/SoMeInputs.tsx +++ b/studio/components/SoMeInputs.tsx @@ -32,7 +32,7 @@ const SoMeInputs: React.FC>> = ({ setPlatform(detectedPlatform); if (onChange) { onChange( - PatchEvent.from([set({ ...value, url, platform: detectedPlatform })]) + PatchEvent.from([set({ ...value, url, platform: detectedPlatform })]), ); } }, [url, onChange]); @@ -43,13 +43,13 @@ const SoMeInputs: React.FC>> = ({ }; const handlePlatformChange = ( - event: React.ChangeEvent + event: React.ChangeEvent, ) => { const newPlatform = event.target.value; setPlatform(newPlatform); if (onChange) { onChange( - PatchEvent.from([set({ ...value, url, platform: newPlatform })]) + PatchEvent.from([set({ ...value, url, platform: newPlatform })]), ); } }; diff --git a/studio/env.ts b/studio/env.ts index 67cf4d648..a7656499f 100644 --- a/studio/env.ts +++ b/studio/env.ts @@ -5,12 +5,12 @@ export const apiVersion = export const dataset = assertValue( process.env.NEXT_PUBLIC_SANITY_DATASET, - "Missing environment variable: NEXT_PUBLIC_SANITY_DATASET" + "Missing environment variable: NEXT_PUBLIC_SANITY_DATASET", ); export const projectId = assertValue( process.env.NEXT_PUBLIC_SANITY_PROJECT_ID, - "Missing environment variable: NEXT_PUBLIC_SANITY_PROJECT_ID" + "Missing environment variable: NEXT_PUBLIC_SANITY_PROJECT_ID", ); export const useCdn = process.env.NODE_ENV === "production"; diff --git a/studio/lib/fetchWithToken.ts b/studio/lib/fetchWithToken.ts index 33236626d..c101c8b79 100644 --- a/studio/lib/fetchWithToken.ts +++ b/studio/lib/fetchWithToken.ts @@ -20,7 +20,7 @@ */ export const fetchWithToken = async ( query: string, - params?: Record + params?: Record, ): Promise => { const response = await fetch("/api/fetchData", { method: "POST", diff --git a/studio/lib/payloads/global.ts b/studio/lib/payloads/global.ts index 303dd118a..445bf15f9 100644 --- a/studio/lib/payloads/global.ts +++ b/studio/lib/payloads/global.ts @@ -1,4 +1,4 @@ export interface Slug { _type: string; current: string; -} \ No newline at end of file +} diff --git a/studio/lib/token.ts b/studio/lib/token.ts index 3013bc6c2..24a9ff676 100644 --- a/studio/lib/token.ts +++ b/studio/lib/token.ts @@ -12,12 +12,12 @@ if (!token) { throw new Error( `Missing SANITY_API_TOKEN for ${ process.env.NODE_ENV === "development" ? "development" : "production" - } environment` + } environment`, ); } experimental_taintUniqueValue( "Do not pass the sanity API read token to the client.", process, - token + token, ); diff --git a/studio/schema.ts b/studio/schema.ts index 4b4036fa1..cae9dd39e 100644 --- a/studio/schema.ts +++ b/studio/schema.ts @@ -11,8 +11,8 @@ import blog from "./schemas/documents/blog"; import posts from "./schemas/documents/post"; import categories from "./schemas/fields/categories"; import legalDocument from "./schemas/documents/legalDocuments"; -import benefit from './schemas/documents/benefit'; -import salaryAndBenefits from './schemas/documents/salaryAndBenefits'; +import benefit from "./schemas/documents/benefit"; +import salaryAndBenefits from "./schemas/documents/salaryAndBenefits"; export const schema: { types: SchemaTypeDefinition[] } = { types: [ @@ -29,6 +29,6 @@ export const schema: { types: SchemaTypeDefinition[] } = { categories, legalDocument, salaryAndBenefits, - benefit + benefit, ], }; diff --git a/studio/schemas/documents/navigationManager.ts b/studio/schemas/documents/navigationManager.ts index 852f35779..24f5c3560 100644 --- a/studio/schemas/documents/navigationManager.ts +++ b/studio/schemas/documents/navigationManager.ts @@ -40,7 +40,7 @@ const navigationManager = defineType({ Rule.custom((links) => { if (!Array.isArray(links)) return true; const ctaCount = links.filter( - (link) => link._type === callToActionFieldID + (link) => link._type === callToActionFieldID, ).length; return ctaCount <= 2 || "You can only have two Call to Action links"; }), diff --git a/studio/schemas/objects/link.ts b/studio/schemas/objects/link.ts index 5f0dc4272..d18095797 100644 --- a/studio/schemas/objects/link.ts +++ b/studio/schemas/objects/link.ts @@ -58,7 +58,11 @@ export const link = defineField({ title: "Internal Link", description: "Select the page you want to link to", type: "reference", - to: [{ type: lazyPageBuilderID() }, { type: lazyBlogID() }, { type: lazySalaryAndBenefitsID() }], + to: [ + { type: lazyPageBuilderID() }, + { type: lazyBlogID() }, + { type: lazySalaryAndBenefitsID() }, + ], validation: (Rule: any) => Rule.custom((value: any, context: any) => { const parent = context.parent as Parent; diff --git a/studio/schemas/objects/seo.ts b/studio/schemas/objects/seo.ts index ffceb4876..af7189e7f 100644 --- a/studio/schemas/objects/seo.ts +++ b/studio/schemas/objects/seo.ts @@ -37,10 +37,10 @@ const seo = defineField({ "An optional but recommended short description to boost visitor engagement from social media and search engines. Try to keep it between 70-160 characters.", validation: (Rule) => [ Rule.min(70).warning( - "A description of at least 70 characters has a higher chance of converting visitors" + "A description of at least 70 characters has a higher chance of converting visitors", ), Rule.max(160).warning( - "A description of more than 160 characters has a lower chance of converting visitors" + "A description of more than 160 characters has a lower chance of converting visitors", ), ], }), diff --git a/studio/utils/validations.ts b/studio/utils/validations.ts index 43b0549c7..8c24b304f 100644 --- a/studio/utils/validations.ts +++ b/studio/utils/validations.ts @@ -7,7 +7,7 @@ export interface Link { export const isFieldVisible = ( link: Link, linkTypeField: string, - expectedType: string + expectedType: string, ): boolean => { return link[linkTypeField] === expectedType; }; diff --git a/tsconfig.json b/tsconfig.json index 32d7682fb..93df8a5e2 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,10 +1,6 @@ { "compilerOptions": { - "lib": [ - "dom", - "dom.iterable", - "esnext" - ], + "lib": ["dom", "dom.iterable", "esnext"], "allowJs": true, "skipLibCheck": true, "strict": true, @@ -32,7 +28,5 @@ "src/stories/Typography.mdx", "src/stories/Colors/ColorBox" ], - "exclude": [ - "node_modules" - ] -} \ No newline at end of file + "exclude": ["node_modules"] +}