diff --git a/.changeset/evil-results-nail.md b/.changeset/evil-results-nail.md new file mode 100644 index 000000000..616d26815 --- /dev/null +++ b/.changeset/evil-results-nail.md @@ -0,0 +1,40 @@ +--- +'@o2s/blocks.featured-service-list': patch +'@o2s/blocks.feature-section-grid': patch +'@o2s/blocks.notification-details': patch +'@o2s/blocks.notification-summary': patch +'@o2s/blocks.notification-list': patch +'@o2s/blocks.payments-history': patch +'@o2s/blocks.payments-summary': patch +'@o2s/blocks.feature-section': patch +'@o2s/blocks.pricing-section': patch +'@o2s/blocks.service-details': patch +'@o2s/blocks.article-search': patch +'@o2s/blocks.orders-summary': patch +'@o2s/blocks.ticket-details': patch +'@o2s/blocks.ticket-summary': patch +'@o2s/blocks.category-list': patch +'@o2s/blocks.document-list': patch +'@o2s/blocks.media-section': patch +'@o2s/blocks.order-details': patch +'@o2s/blocks.surveyjs-form': patch +'@o2s/blocks.ticket-recent': patch +'@o2s/configs.integrations': patch +'@o2s/blocks.article-list': patch +'@o2s/blocks.hero-section': patch +'@o2s/blocks.invoice-list': patch +'@o2s/blocks.product-list': patch +'@o2s/blocks.service-list': patch +'@o2s/blocks.user-account': patch +'@o2s/blocks.cta-section': patch +'@o2s/blocks.quick-links': patch +'@o2s/blocks.ticket-list': patch +'@o2s/blocks.bento-grid': patch +'@o2s/blocks.order-list': patch +'@o2s/modules.surveyjs': patch +'@o2s/blocks.category': patch +'@o2s/blocks.article': patch +'@o2s/blocks.faq': patch +--- + +reworked data fetching a little to overcome ESlint warnings diff --git a/apps/docs/eslint.config.mjs b/apps/docs/eslint.config.mjs new file mode 100644 index 000000000..55c4d16ff --- /dev/null +++ b/apps/docs/eslint.config.mjs @@ -0,0 +1,25 @@ +import { config } from '@o2s/eslint-config/frontend'; + +/** @type {import("eslint").Linter.Config} */ +export default [ + ...config, + { + rules: { + // Disable Next.js image rule since Docusaurus doesn't use next/image + '@next/next/no-img-element': 'off', + // Allow unescaped entities (apostrophes) in documentation text + 'react/no-unescaped-entities': 'off', + // Allow require() imports (Docusaurus may need them) + '@typescript-eslint/no-require-imports': 'off', + // Allow unused vars if they start with underscore + '@typescript-eslint/no-unused-vars': [ + 'warn', + { + argsIgnorePattern: '^_', + varsIgnorePattern: '^_', + caughtErrorsIgnorePattern: '^_', + }, + ], + }, + }, +]; diff --git a/apps/docs/package.json b/apps/docs/package.json index 38f3f729d..662d10111 100644 --- a/apps/docs/package.json +++ b/apps/docs/package.json @@ -13,7 +13,7 @@ "write-translations": "docusaurus write-translations", "write-heading-ids": "docusaurus write-heading-ids", "typecheck": "tsc", - "lint": "tsc --noEmit", + "lint": "tsc --noEmit && eslint \"src/**/*.{ts,tsx}\" --fix --max-warnings=0", "format": "prettier --write \"src/**/*.{js,jsx,ts,tsx,css,scss,json}\"" }, "dependencies": { diff --git a/apps/docs/src/components/BenefitsSection/index.tsx b/apps/docs/src/components/BenefitsSection/index.tsx index eea9bfba6..f7b4871df 100644 --- a/apps/docs/src/components/BenefitsSection/index.tsx +++ b/apps/docs/src/components/BenefitsSection/index.tsx @@ -29,7 +29,6 @@ export interface BenefitCardProps { export const BenefitCard: React.FC = ({ team, icon, - iconPosition = 'right', title, description, link, diff --git a/apps/docs/src/components/CookieConsent/index.tsx b/apps/docs/src/components/CookieConsent/index.tsx index 2c3a3b8da..f0d9efd17 100644 --- a/apps/docs/src/components/CookieConsent/index.tsx +++ b/apps/docs/src/components/CookieConsent/index.tsx @@ -4,7 +4,7 @@ import 'vanilla-cookieconsent/dist/cookieconsent.css'; import pluginConfig from '@site/src/components/CookieConsent/config'; -import styles from '../../css/cookie-consent.css'; +// import styles from '../../css/cookie-consent.css'; const CookieConsentComponent = () => { useEffect(() => { diff --git a/apps/docs/src/components/DXPComplexPlatformsSection/index.tsx b/apps/docs/src/components/DXPComplexPlatformsSection/index.tsx index c6984562c..0d9e91300 100644 --- a/apps/docs/src/components/DXPComplexPlatformsSection/index.tsx +++ b/apps/docs/src/components/DXPComplexPlatformsSection/index.tsx @@ -28,7 +28,7 @@ export function DXPComplexPlatformsSection() {

While this architecture is more complex than a direct CMS integration, - it's future-proof and scalable — perfect when you know your project will grow. + it's future-proof and scalable — perfect when you know your project will grow.

diff --git a/apps/docs/src/components/DXPFeaturesSection/index.tsx b/apps/docs/src/components/DXPFeaturesSection/index.tsx index f549fd4bd..a4730e7cd 100644 --- a/apps/docs/src/components/DXPFeaturesSection/index.tsx +++ b/apps/docs/src/components/DXPFeaturesSection/index.tsx @@ -59,8 +59,8 @@ const FeatureCard: React.FC = ({ title, icon, features, - buttonText, - buttonUrl, + // buttonText, + // buttonUrl, borderColor = 'blue', }) => { return ( diff --git a/apps/docs/src/components/GetStartedButtons/index.tsx b/apps/docs/src/components/GetStartedButtons/index.tsx index 558bcbbf0..2c5de64ea 100644 --- a/apps/docs/src/components/GetStartedButtons/index.tsx +++ b/apps/docs/src/components/GetStartedButtons/index.tsx @@ -1,22 +1,26 @@ import clsx from 'clsx'; -import React, { useState } from 'react'; +import React from 'react'; import GithubActiveIcon from '@site/src/assets/icons/github-active.svg'; import GithubIcon from '@site/src/assets/icons/github.svg'; -import { Body } from '@site/src/components/Typography'; const GetStartedButtons = () => { return (
- + See our demo app diff --git a/apps/docs/src/components/HomepageArchitectureSection/index.tsx b/apps/docs/src/components/HomepageArchitectureSection/index.tsx index f6e97f283..8c5474d41 100644 --- a/apps/docs/src/components/HomepageArchitectureSection/index.tsx +++ b/apps/docs/src/components/HomepageArchitectureSection/index.tsx @@ -1,12 +1,10 @@ import React from 'react'; import Link from '@docusaurus/Link'; -import useDocusaurusContext from '@docusaurus/useDocusaurusContext'; import { Body, H2 } from '../Typography'; export function HomepageArchitectureSection() { - const { siteConfig } = useDocusaurusContext(); return (
diff --git a/apps/docs/src/components/HomepageFeatures/index.tsx b/apps/docs/src/components/HomepageFeatures/index.tsx index 93d9e07f8..1f78c5e9f 100644 --- a/apps/docs/src/components/HomepageFeatures/index.tsx +++ b/apps/docs/src/components/HomepageFeatures/index.tsx @@ -1,6 +1,10 @@ import clsx from 'clsx'; import type { ReactNode } from 'react'; +import DocusaurusMountain from '@site/static/img/undraw_docusaurus_mountain.svg'; +import DocusaurusReact from '@site/static/img/undraw_docusaurus_react.svg'; +import DocusaurusTree from '@site/static/img/undraw_docusaurus_tree.svg'; + import Heading from '@theme/Heading'; import styles from './styles.module.css'; @@ -14,7 +18,7 @@ type FeatureItem = { const FeatureList: FeatureItem[] = [ { title: 'Easy to Use', - Svg: require('@site/static/img/undraw_docusaurus_mountain.svg').default, + Svg: DocusaurusMountain, description: ( <> Docusaurus was designed from the ground up to be easily installed and used to get your website up and @@ -24,7 +28,7 @@ const FeatureList: FeatureItem[] = [ }, { title: 'Focus on What Matters', - Svg: require('@site/static/img/undraw_docusaurus_tree.svg').default, + Svg: DocusaurusTree, description: ( <> Docusaurus lets you focus on your docs, and we'll do the chores. Go ahead and move your docs into @@ -34,7 +38,7 @@ const FeatureList: FeatureItem[] = [ }, { title: 'Powered by React', - Svg: require('@site/static/img/undraw_docusaurus_react.svg').default, + Svg: DocusaurusReact, description: ( <> Extend or customize your website layout by reusing React. Docusaurus can be extended while reusing the diff --git a/apps/docs/src/components/HomepageFeaturesSection/index.tsx b/apps/docs/src/components/HomepageFeaturesSection/index.tsx index c76a54271..d78783b00 100644 --- a/apps/docs/src/components/HomepageFeaturesSection/index.tsx +++ b/apps/docs/src/components/HomepageFeaturesSection/index.tsx @@ -2,14 +2,9 @@ import React from 'react'; import Link from '@docusaurus/Link'; -import BlocksIcon from '@site/src/assets/icons/Blocks.svg'; -import UserIcon from '@site/src/assets/icons/CircleUser.svg'; -import FileSearchIcon from '@site/src/assets/icons/FileSearch.svg'; -import TicketIcon from '@site/src/assets/icons/TicketX.svg'; -import WalletIcon from '@site/src/assets/icons/Wallet.svg'; import CircleCheckIcon from '@site/src/assets/icons/circle-check.svg'; -import { Body, H2, H3, H4 } from '../Typography'; +import { Body, H2, H3 } from '../Typography'; interface FeatureItemProps { text: string; @@ -24,18 +19,6 @@ const FeatureItem: React.FC = ({ text, icon, textClassName = '
); -interface BuildingBlockCardProps { - title: string; - icon: React.ReactNode; -} - -const BuildingBlockCard: React.FC = ({ title, icon }) => ( -
-
{icon}
-

{title}

-
-); - export function HomepageFeaturesSection() { const developersFeatures = [ 'Performance-first, modern stack', @@ -53,29 +36,6 @@ export function HomepageFeaturesSection() { 'UX optimized for efficient customer self-service', ]; - const buildingBlocks = [ - { - title: 'User authentication & profile management', - icon: , - }, - { - title: 'Ticketing and customer support workflows', - icon: , - }, - { - title: 'Payments, invoices, orders', - icon: , - }, - { - title: 'Knowledge base and content search', - icon: , - }, - { - title: 'CMS-powered landing pages and sections', - icon: , - }, - ]; - return (

diff --git a/apps/docs/src/components/HomepageJoinTheWaitlistSection/index.tsx b/apps/docs/src/components/HomepageJoinTheWaitlistSection/index.tsx index 6347d81ee..d1e3716b0 100644 --- a/apps/docs/src/components/HomepageJoinTheWaitlistSection/index.tsx +++ b/apps/docs/src/components/HomepageJoinTheWaitlistSection/index.tsx @@ -32,7 +32,7 @@ export default function HomepageJoinTheWaitlistSection(): ReactNode {
@@ -42,6 +42,7 @@ export default function HomepageJoinTheWaitlistSection(): ReactNode { className="text-white! underline" href="https://hycom.digital/privacy-policy" target="_blank" + rel="noreferrer" > Privacy Policy {' '} diff --git a/apps/docs/src/components/HubspotForm/index.tsx b/apps/docs/src/components/HubspotForm/index.tsx index 0e0b01902..d75f85f86 100644 --- a/apps/docs/src/components/HubspotForm/index.tsx +++ b/apps/docs/src/components/HubspotForm/index.tsx @@ -222,7 +222,7 @@ const HubspotForm: React.FC = ({ url.searchParams.append('success', 'false'); window.history.replaceState(null, null, url); } - } catch (error) { + } catch (_error) { setStatus({ type: 'error', message: 'An unexpected error occurred. Please try again later.' }); setIsSubmitting(false); diff --git a/apps/docs/src/components/SubscribeSection/index.tsx b/apps/docs/src/components/SubscribeSection/index.tsx index 13dd5c3e0..f2260d673 100644 --- a/apps/docs/src/components/SubscribeSection/index.tsx +++ b/apps/docs/src/components/SubscribeSection/index.tsx @@ -97,7 +97,7 @@ export const SubscribeSection: React.FC = ({ portalId, fo url.searchParams.append('success', 'false'); window.history.replaceState(null, null, url); } - } catch (error) { + } catch (_error) { setStatus({ type: 'error', message: 'An unexpected error occurred. Please try again later.', diff --git a/apps/docs/src/components/WaitlistForm/index.tsx b/apps/docs/src/components/WaitlistForm/index.tsx index cdf18958a..acf208d33 100644 --- a/apps/docs/src/components/WaitlistForm/index.tsx +++ b/apps/docs/src/components/WaitlistForm/index.tsx @@ -70,7 +70,7 @@ const WaitlistForm = ({ inputId }) => { }); setIsSubmitting(false); } - } catch (error) { + } catch (_error) { setStatus({ type: 'error', message: 'An unexpected error occurred. Please try again.', diff --git a/apps/docs/src/pages/contact/index.tsx b/apps/docs/src/pages/contact/index.tsx index 21b9d25a5..6d506394d 100644 --- a/apps/docs/src/pages/contact/index.tsx +++ b/apps/docs/src/pages/contact/index.tsx @@ -43,7 +43,10 @@ const Contact = () => { formId={formId} title="Contact us" description={ - <>Fill out the form below and we'll get back to you as soon as possible. + <> + Fill out the form below and we'll get back to you as soon as + possible. + } pageName="Contact - Open Self Service" fields={[ diff --git a/apps/docs/src/pages/dxp/index.tsx b/apps/docs/src/pages/dxp/index.tsx index ff7fc964d..10ce6b5ce 100644 --- a/apps/docs/src/pages/dxp/index.tsx +++ b/apps/docs/src/pages/dxp/index.tsx @@ -1,7 +1,5 @@ import React, { ReactNode } from 'react'; -import useDocusaurusContext from '@docusaurus/useDocusaurusContext'; - import GithubIcon from '@site/src/assets/icons/github.svg'; import { BenefitCardProps, BenefitsSection } from '@site/src/components/BenefitsSection'; import { DXPArchitectureSection } from '@site/src/components/DXPArchitectureSection'; @@ -42,8 +40,6 @@ const benefits: Array = [ ]; export default function DXPStarter(): ReactNode { - const { siteConfig } = useDocusaurusContext(); - return (
diff --git a/apps/docs/src/pages/index.tsx b/apps/docs/src/pages/index.tsx index 91c61690a..fb786fbdc 100644 --- a/apps/docs/src/pages/index.tsx +++ b/apps/docs/src/pages/index.tsx @@ -12,14 +12,11 @@ import OrangeEnergia from '@site/src/assets/logos/OrangeEnergia.svg'; import Osadkowski from '@site/src/assets/logos/Osadkowski.svg'; import { ClientsSection } from '@site/src/components/ClientsSection'; import { HeroBannerSection } from '@site/src/components/HeroBannerSection'; -import { HomepageAboutSection } from '@site/src/components/HomepageAboutSection'; import { HomepageArchitectureSection } from '@site/src/components/HomepageArchitectureSection'; -import { HomepageBenefitsSection } from '@site/src/components/HomepageBenefitsSection'; import { HomepageFeaturesSection } from '@site/src/components/HomepageFeaturesSection'; import { HomepageStartersSection } from '@site/src/components/HomepageStartersSection'; -import { HomepageUseCases } from '@site/src/components/HomepageUseCases'; import { SubscribeSection } from '@site/src/components/SubscribeSection'; -import { Body, BodyBold } from '@site/src/components/Typography'; +import { Body } from '@site/src/components/Typography'; import Layout from '@theme/Layout'; diff --git a/apps/docs/src/pages/product/features.tsx b/apps/docs/src/pages/product/features.tsx index 77e3008d7..c87fef764 100644 --- a/apps/docs/src/pages/product/features.tsx +++ b/apps/docs/src/pages/product/features.tsx @@ -286,8 +286,8 @@ export default function ProductFeatures() { } description={ - Here's a breakdown of what the framework enables — both for business outcomes - and developer experience. + Here's a breakdown of what the framework enables — both for business + outcomes and developer experience. } /> diff --git a/apps/docs/src/pages/product/integrations.tsx b/apps/docs/src/pages/product/integrations.tsx index 3571a2896..4164ab745 100644 --- a/apps/docs/src/pages/product/integrations.tsx +++ b/apps/docs/src/pages/product/integrations.tsx @@ -268,8 +268,8 @@ export default function ProductIntegrations() { <> Open Self Service is composable by design. We believe in backend-agnostic - architecture. That's why every integration is decoupled and modular — so you - can swap or extend data sources without rebuilding your frontend. + architecture. That's why every integration is decoupled and modular — + so you can swap or extend data sources without rebuilding your frontend. Below is a list of available and upcoming integrations. diff --git a/apps/docs/src/pages/product/starters.tsx b/apps/docs/src/pages/product/starters.tsx index cabb95b1c..3f2bf9b65 100644 --- a/apps/docs/src/pages/product/starters.tsx +++ b/apps/docs/src/pages/product/starters.tsx @@ -3,12 +3,6 @@ import React from 'react'; import RefreshCwIcon from '@site/src/assets/icons/RefreshCw.svg'; import RocketIcon from '@site/src/assets/icons/Rocket.svg'; import CircleCheckIcon from '@site/src/assets/icons/circle-check.svg'; -import BadgeIcon from '@site/src/assets/icons/o2s-icon-badge.svg'; -import ContactIcon from '@site/src/assets/icons/o2s-icon-contact.svg'; -import LoopIcon from '@site/src/assets/icons/o2s-icon-loop.svg'; -import RoadmapIcon from '@site/src/assets/icons/o2s-icon-roadmap.svg'; -import SupportIcon from '@site/src/assets/icons/o2s-icon-support.svg'; -import { type BenefitCardProps, BenefitsSection } from '@site/src/components/BenefitsSection'; import { DXPFeaturesSection } from '@site/src/components/DXPFeaturesSection'; import { FooterSection } from '@site/src/components/FooterSection'; import { HeroBannerSection } from '@site/src/components/HeroBannerSection'; @@ -19,33 +13,33 @@ import Layout from '@theme/Layout'; import styles from './product.module.scss'; -const benefits: Array = [ - { - icon: , - title: 'Theming with Tailwind', - borderColor: 'transparent', - }, - { - icon: , - title: 'Override or extend components', - borderColor: 'transparent', - }, - { - icon: , - title: 'Add custom blocks (frontend + BFF logic)', - borderColor: 'transparent', - }, - { - icon: , - title: 'CMS schema and layout control', - borderColor: 'transparent', - }, - { - icon: , - title: 'Lighthouse 90+ scores (Performance, SEO, A11y)', - borderColor: 'transparent', - }, -]; +// const benefits: Array = [ +// { +// icon: , +// title: 'Theming with Tailwind', +// borderColor: 'transparent', +// }, +// { +// icon: , +// title: 'Override or extend components', +// borderColor: 'transparent', +// }, +// { +// icon: , +// title: 'Add custom blocks (frontend + BFF logic)', +// borderColor: 'transparent', +// }, +// { +// icon: , +// title: 'CMS schema and layout control', +// borderColor: 'transparent', +// }, +// { +// icon: , +// title: 'Lighthouse 90+ scores (Performance, SEO, A11y)', +// borderColor: 'transparent', +// }, +// ]; const digitalPortalStarter: StarterInfoSectionProps = { links: [ diff --git a/apps/docs/src/pages/support/developers.tsx b/apps/docs/src/pages/support/developers.tsx index 9030dfa55..b0d341d6e 100644 --- a/apps/docs/src/pages/support/developers.tsx +++ b/apps/docs/src/pages/support/developers.tsx @@ -1,7 +1,5 @@ import React, { ReactNode } from 'react'; -import useDocusaurusContext from '@docusaurus/useDocusaurusContext'; - import Icon_Discord2 from '@site/src/assets/icons/Discord2.svg'; import Icon_FolderOpenDot from '@site/src/assets/icons/FolderOpenDot.svg'; import Icon_Github2 from '@site/src/assets/icons/Github2.svg'; @@ -88,8 +86,6 @@ const offer: Array = [ ]; export default function SupportStandard(): ReactNode { - const { siteConfig } = useDocusaurusContext(); - return (
diff --git a/apps/docs/src/theme/Blog/Components/Author/index.tsx b/apps/docs/src/theme/Blog/Components/Author/index.tsx index f1582ff99..a3011fde2 100644 --- a/apps/docs/src/theme/Blog/Components/Author/index.tsx +++ b/apps/docs/src/theme/Blog/Components/Author/index.tsx @@ -4,7 +4,6 @@ import React, { type ReactNode } from 'react'; import Link, { type Props as LinkProps } from '@docusaurus/Link'; import type { Props } from '@theme/Blog/Components/Author'; -import AuthorSocials from '@theme/Blog/Components/Author/Socials'; import Heading from '@theme/Heading'; import styles from './styles.module.css'; diff --git a/apps/docs/src/theme/BlogPostItem/Header/Info/index.tsx b/apps/docs/src/theme/BlogPostItem/Header/Info/index.tsx index 1a2fef1af..8b8a2798c 100644 --- a/apps/docs/src/theme/BlogPostItem/Header/Info/index.tsx +++ b/apps/docs/src/theme/BlogPostItem/Header/Info/index.tsx @@ -4,7 +4,6 @@ import React, { type ReactNode } from 'react'; import { translate } from '@docusaurus/Translate'; import { useBlogPost } from '@docusaurus/plugin-content-blog/client'; -import type { Props } from '@theme/BlogPostItem/Header/Info'; import TagsListInline from '@theme/TagsListInline'; import styles from './styles.module.css'; diff --git a/apps/docs/src/theme/Footer/Copyright/index.tsx b/apps/docs/src/theme/Footer/Copyright/index.tsx index 44b6cdfea..8abf4669f 100644 --- a/apps/docs/src/theme/Footer/Copyright/index.tsx +++ b/apps/docs/src/theme/Footer/Copyright/index.tsx @@ -7,7 +7,6 @@ export default function FooterCopyright({ copyright }: Props): ReactNode {
); diff --git a/apps/docs/src/theme/Footer/Layout/index.tsx b/apps/docs/src/theme/Footer/Layout/index.tsx index 5c15aa1d4..234445691 100644 --- a/apps/docs/src/theme/Footer/Layout/index.tsx +++ b/apps/docs/src/theme/Footer/Layout/index.tsx @@ -1,6 +1,5 @@ import clsx from 'clsx'; import React, { type ReactNode } from 'react'; -import FooterJoinTheWhitelistSection from 'src/components/HomepageJoinTheWaitlistSection'; import type { Props } from '@theme/Footer/Layout'; diff --git a/apps/docs/src/theme/Footer/Links/MultiColumn/index.tsx b/apps/docs/src/theme/Footer/Links/MultiColumn/index.tsx index 26a22a3ee..d3c248da6 100644 --- a/apps/docs/src/theme/Footer/Links/MultiColumn/index.tsx +++ b/apps/docs/src/theme/Footer/Links/MultiColumn/index.tsx @@ -12,7 +12,7 @@ function ColumnLinkItem({ item }: { item: ColumnItemType }) {
  • ) : ( diff --git a/apps/docs/src/theme/Footer/Links/Simple/index.tsx b/apps/docs/src/theme/Footer/Links/Simple/index.tsx index 3b9fa3933..63b87fc35 100644 --- a/apps/docs/src/theme/Footer/Links/Simple/index.tsx +++ b/apps/docs/src/theme/Footer/Links/Simple/index.tsx @@ -13,7 +13,7 @@ function SimpleLinkItem({ item }: { item: Props['links'][number] }) { ) : ( diff --git a/apps/docs/src/theme/Footer/index.tsx b/apps/docs/src/theme/Footer/index.tsx index 8a599d0f8..b3944d36a 100644 --- a/apps/docs/src/theme/Footer/index.tsx +++ b/apps/docs/src/theme/Footer/index.tsx @@ -1,6 +1,5 @@ import React, { type ReactNode } from 'react'; -import { useLocation } from '@docusaurus/router'; import { useThemeConfig } from '@docusaurus/theme-common'; import FooterCopyright from '@theme/Footer/Copyright'; @@ -10,11 +9,6 @@ import FooterLogo from '@theme/Footer/Logo'; function Footer(): ReactNode { const { footer } = useThemeConfig(); - const location = useLocation(); - - // if (!footer || location.pathname === '/') { - // return null; - // } const { copyright, links, logo, style } = footer; diff --git a/apps/docs/src/theme/NavbarItem/DropdownNavbarItem/index.tsx b/apps/docs/src/theme/NavbarItem/DropdownNavbarItem/index.tsx index 77fd057c4..2edd25806 100644 --- a/apps/docs/src/theme/NavbarItem/DropdownNavbarItem/index.tsx +++ b/apps/docs/src/theme/NavbarItem/DropdownNavbarItem/index.tsx @@ -40,7 +40,7 @@ function DropdownNavbarItemDesktop({ items, position, className, - onClick, + onClick: _onClick, linkMore, ...props }: DesktopOrMobileNavBarItemPropsExpanded) { @@ -121,7 +121,7 @@ function DropdownNavbarItemDesktop({ function DropdownNavbarItemMobile({ items, className, - position, // Need to destructure position from props so that it doesn't get passed on. + position: _position, // Need to destructure position from props so that it doesn't get passed on. onClick, ...props }: DesktopOrMobileNavBarItemProps) { diff --git a/apps/frontend/package.json b/apps/frontend/package.json index b005ee05f..e1ed6f8e4 100644 --- a/apps/frontend/package.json +++ b/apps/frontend/package.json @@ -9,7 +9,7 @@ "build": "next build", "postbuild": "shx cp -r public .next/standalone/apps/frontend && shx cp -r .next/static .next/standalone/apps/frontend/.next/", "start": "node .next/standalone/apps/frontend/server.js", - "lint": "tsc --noEmit && eslint \"src/**/*.{ts,tsx}\" --fix", + "lint": "tsc --noEmit && eslint \"src/**/*.{ts,tsx}\" --fix --max-warnings=0", "format": "prettier --write \"src/**/*.{js,jsx,ts,tsx,css,scss,json}\"", "generate:component": "turbo gen web-component" }, @@ -92,4 +92,4 @@ "@types/react": "19.2.7", "@types/react-dom": "19.2.3" } -} \ No newline at end of file +} diff --git a/package.json b/package.json index 1ccdd28d0..1c3fd8005 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ "build": "turbo build", "start": "turbo start", "format": "turbo format", - "lint": "turbo lint", + "lint": "turbo lint -- --max-warnings=0", "test": "turbo test && vitest run --project=storybook", "generate": "turbo gen", "eject-block": "ts-node ./scripts/cli.ts eject-block", diff --git a/packages/blocks/article-list/package.json b/packages/blocks/article-list/package.json index 820d84d52..c9d80cb25 100644 --- a/packages/blocks/article-list/package.json +++ b/packages/blocks/article-list/package.json @@ -16,7 +16,7 @@ "scripts": { "build": "tsc --build tsconfig.json --preserveWatchOutput && tsc-alias", "test": "vitest run", - "lint": "tsc --noEmit && eslint \"src/**/*.{ts,tsx}\" --fix", + "lint": "tsc --noEmit && eslint \"src/**/*.{ts,tsx}\" --fix --max-warnings=0", "format": "prettier --write \"src/**/*.{js,jsx,ts,tsx,css,scss,json}\"" }, "dependencies": { diff --git a/packages/blocks/article-list/src/frontend/ArticleList.server.tsx b/packages/blocks/article-list/src/frontend/ArticleList.server.tsx index fd530610a..831123c3a 100644 --- a/packages/blocks/article-list/src/frontend/ArticleList.server.tsx +++ b/packages/blocks/article-list/src/frontend/ArticleList.server.tsx @@ -1,6 +1,7 @@ import dynamic from 'next/dynamic'; import React from 'react'; +import type { Model } from '../api-harmonization/article-list.client'; import { sdk } from '../sdk'; import { ArticleListProps } from './ArticleList.types'; @@ -17,8 +18,9 @@ export const ArticleList: React.FC = async ({ hasPriority, isDraftModeEnabled, }) => { + let data: Model.ArticleListBlock; try { - const data = await sdk.blocks.getArticleList( + data = await sdk.blocks.getArticleList( { id, preview: isDraftModeEnabled, @@ -26,17 +28,18 @@ export const ArticleList: React.FC = async ({ { 'x-locale': locale }, accessToken, ); - return ( - - ); } catch (_error) { return null; } + + return ( + + ); }; diff --git a/packages/blocks/article-list/src/frontend/ArticleList.types.ts b/packages/blocks/article-list/src/frontend/ArticleList.types.ts index a0ca99fb5..e17f74658 100644 --- a/packages/blocks/article-list/src/frontend/ArticleList.types.ts +++ b/packages/blocks/article-list/src/frontend/ArticleList.types.ts @@ -1,6 +1,6 @@ import { defineRouting } from 'next-intl/routing'; -import { Model } from '../api-harmonization/article-list.client'; +import type { Model } from '../api-harmonization/article-list.client'; export interface ArticleListProps { id: string; diff --git a/packages/blocks/article-search/package.json b/packages/blocks/article-search/package.json index f79774354..03724d541 100644 --- a/packages/blocks/article-search/package.json +++ b/packages/blocks/article-search/package.json @@ -16,7 +16,7 @@ "scripts": { "build": "tsc --build tsconfig.json --preserveWatchOutput && tsc-alias", "test": "vitest run", - "lint": "tsc --noEmit && eslint \"src/**/*.{ts,tsx}\" --fix", + "lint": "tsc --noEmit && eslint \"src/**/*.{ts,tsx}\" --fix --max-warnings=0", "format": "prettier --write \"src/**/*.{js,jsx,ts,tsx,css,scss,json}\"" }, "dependencies": { diff --git a/packages/blocks/article-search/src/frontend/ArticleSearch.client.tsx b/packages/blocks/article-search/src/frontend/ArticleSearch.client.tsx index 508a33448..26e28c88b 100644 --- a/packages/blocks/article-search/src/frontend/ArticleSearch.client.tsx +++ b/packages/blocks/article-search/src/frontend/ArticleSearch.client.tsx @@ -13,7 +13,7 @@ import { Container } from '@o2s/ui/components/Container'; import { Typography } from '@o2s/ui/elements/typography'; -import { Model } from '../api-harmonization/article-search.client'; +import type { Model } from '../api-harmonization/article-search.client'; import { sdk } from '../sdk'; import { ArticleSearchPureProps } from './ArticleSearch.types'; diff --git a/packages/blocks/article-search/src/frontend/ArticleSearch.server.tsx b/packages/blocks/article-search/src/frontend/ArticleSearch.server.tsx index 604e67277..24c0cd26c 100644 --- a/packages/blocks/article-search/src/frontend/ArticleSearch.server.tsx +++ b/packages/blocks/article-search/src/frontend/ArticleSearch.server.tsx @@ -1,6 +1,7 @@ import dynamic from 'next/dynamic'; import React from 'react'; +import type { Model } from '../api-harmonization/article-search.client'; import { sdk } from '../sdk'; import { ArticleSearchProps } from './ArticleSearch.types'; @@ -16,26 +17,27 @@ export const ArticleSearch: React.FC = async ({ routing, hasPriority, }) => { + let data: Model.ArticleSearchBlock; try { - const data = await sdk.blocks.getArticleSearch( + data = await sdk.blocks.getArticleSearch( { id, }, { 'x-locale': locale }, accessToken, ); - - return ( - - ); } catch (_error) { return null; } + + return ( + + ); }; diff --git a/packages/blocks/article-search/src/frontend/ArticleSearch.types.ts b/packages/blocks/article-search/src/frontend/ArticleSearch.types.ts index b14e7148d..d052ee57b 100644 --- a/packages/blocks/article-search/src/frontend/ArticleSearch.types.ts +++ b/packages/blocks/article-search/src/frontend/ArticleSearch.types.ts @@ -1,6 +1,6 @@ import { defineRouting } from 'next-intl/routing'; -import { Model } from '../api-harmonization/article-search.client'; +import type { Model } from '../api-harmonization/article-search.client'; export interface ArticleSearchProps { id: string; diff --git a/packages/blocks/article/package.json b/packages/blocks/article/package.json index ddd002a0b..d56e5c997 100644 --- a/packages/blocks/article/package.json +++ b/packages/blocks/article/package.json @@ -16,7 +16,7 @@ "scripts": { "build": "tsc --build tsconfig.json --preserveWatchOutput && tsc-alias", "test": "vitest run", - "lint": "tsc --noEmit && eslint \"src/**/*.{ts,tsx}\" --fix", + "lint": "tsc --noEmit && eslint \"src/**/*.{ts,tsx}\" --fix --max-warnings=0", "format": "prettier --write \"src/**/*.{js,jsx,ts,tsx,css,scss,json}\"" }, "dependencies": { diff --git a/packages/blocks/article/src/frontend/Article.server.tsx b/packages/blocks/article/src/frontend/Article.server.tsx index 3f1d0b158..f67b085f7 100644 --- a/packages/blocks/article/src/frontend/Article.server.tsx +++ b/packages/blocks/article/src/frontend/Article.server.tsx @@ -1,6 +1,7 @@ import dynamic from 'next/dynamic'; import React from 'react'; +import type { Model } from '../api-harmonization/article.client'; import { sdk } from '../sdk'; import { ArticleProps } from './Article.types'; @@ -8,26 +9,27 @@ import { ArticleProps } from './Article.types'; export const ArticleDynamic = dynamic(() => import('./Article.client').then((module) => module.ArticlePure)); export const Article: React.FC = async ({ slug, accessToken, locale, routing, hasPriority }) => { + let data: Model.ArticleBlock; try { - const data = await sdk.blocks.getArticle( + data = await sdk.blocks.getArticle( { slug, }, { 'x-locale': locale }, accessToken, ); - - return ( - - ); } catch (_error) { return null; } + + return ( + + ); }; diff --git a/packages/blocks/article/src/frontend/Article.types.ts b/packages/blocks/article/src/frontend/Article.types.ts index 49f565bfb..bc2ce4369 100644 --- a/packages/blocks/article/src/frontend/Article.types.ts +++ b/packages/blocks/article/src/frontend/Article.types.ts @@ -1,6 +1,6 @@ import { defineRouting } from 'next-intl/routing'; -import { Model } from '../api-harmonization/article.client'; +import type { Model } from '../api-harmonization/article.client'; export interface ArticleProps { id: string; diff --git a/packages/blocks/bento-grid/src/frontend/BentoGrid.server.tsx b/packages/blocks/bento-grid/src/frontend/BentoGrid.server.tsx index cbddc181f..263499b0a 100644 --- a/packages/blocks/bento-grid/src/frontend/BentoGrid.server.tsx +++ b/packages/blocks/bento-grid/src/frontend/BentoGrid.server.tsx @@ -1,6 +1,7 @@ import dynamic from 'next/dynamic'; import React from 'react'; +import type { Model } from '../api-harmonization/bento-grid.client'; import { sdk } from '../sdk'; import { BentoGridProps } from './BentoGrid.types'; @@ -8,18 +9,19 @@ import { BentoGridProps } from './BentoGrid.types'; export const BentoGridDynamic = dynamic(() => import('./BentoGrid.client').then((module) => module.BentoGridPure)); export const BentoGrid: React.FC = async ({ id, accessToken, locale, routing }) => { + let data: Model.BentoGridBlock; try { - const data = await sdk.blocks.getBentoGrid( + data = await sdk.blocks.getBentoGrid( { id, }, { 'x-locale': locale }, accessToken, ); - - return ; } catch (error) { console.error('Error fetching BentoGrid block', error); return null; } + + return ; }; diff --git a/packages/blocks/bento-grid/src/frontend/BentoGrid.types.ts b/packages/blocks/bento-grid/src/frontend/BentoGrid.types.ts index e01f6d934..b93d07c12 100644 --- a/packages/blocks/bento-grid/src/frontend/BentoGrid.types.ts +++ b/packages/blocks/bento-grid/src/frontend/BentoGrid.types.ts @@ -1,6 +1,6 @@ import { defineRouting } from 'next-intl/routing'; -import { Model } from '../api-harmonization/bento-grid.client'; +import type { Model } from '../api-harmonization/bento-grid.client'; export interface BentoGridProps { id: string; diff --git a/packages/blocks/category-list/package.json b/packages/blocks/category-list/package.json index 35aa312e4..db79b5d68 100644 --- a/packages/blocks/category-list/package.json +++ b/packages/blocks/category-list/package.json @@ -16,7 +16,7 @@ "scripts": { "build": "tsc --build tsconfig.json --preserveWatchOutput && tsc-alias", "test": "vitest run", - "lint": "tsc --noEmit && eslint \"src/**/*.{ts,tsx}\" --fix", + "lint": "tsc --noEmit && eslint \"src/**/*.{ts,tsx}\" --fix --max-warnings=0", "format": "prettier --write \"src/**/*.{js,jsx,ts,tsx,css,scss,json}\"" }, "dependencies": { diff --git a/packages/blocks/category-list/src/frontend/CategoryList.server.tsx b/packages/blocks/category-list/src/frontend/CategoryList.server.tsx index 129c472d7..571179760 100644 --- a/packages/blocks/category-list/src/frontend/CategoryList.server.tsx +++ b/packages/blocks/category-list/src/frontend/CategoryList.server.tsx @@ -1,6 +1,7 @@ import dynamic from 'next/dynamic'; import React from 'react'; +import type { Model } from '../api-harmonization/category-list.client'; import { sdk } from '../sdk'; import { CategoryListProps } from './CategoryList.types'; @@ -17,7 +18,7 @@ export const CategoryList: React.FC = async ({ hasPriority, isDraftModeEnabled, }) => { - let data; + let data: Model.CategoryListBlock; try { data = await sdk.blocks.getCategoryList( { diff --git a/packages/blocks/category-list/src/frontend/CategoryList.types.ts b/packages/blocks/category-list/src/frontend/CategoryList.types.ts index 32a283afd..8e407cdd4 100644 --- a/packages/blocks/category-list/src/frontend/CategoryList.types.ts +++ b/packages/blocks/category-list/src/frontend/CategoryList.types.ts @@ -1,6 +1,6 @@ import { defineRouting } from 'next-intl/routing'; -import { Model } from '../api-harmonization/category-list.client'; +import type { Model } from '../api-harmonization/category-list.client'; export interface CategoryListProps { id: string; diff --git a/packages/blocks/category/package.json b/packages/blocks/category/package.json index 9e773046c..2567ba705 100644 --- a/packages/blocks/category/package.json +++ b/packages/blocks/category/package.json @@ -16,7 +16,7 @@ "scripts": { "build": "tsc --build tsconfig.json --preserveWatchOutput && tsc-alias", "test": "vitest run", - "lint": "tsc --noEmit && eslint \"src/**/*.{ts,tsx}\" --fix", + "lint": "tsc --noEmit && eslint \"src/**/*.{ts,tsx}\" --fix --max-warnings=0", "format": "prettier --write \"src/**/*.{js,jsx,ts,tsx,css,scss,json}\"" }, "dependencies": { diff --git a/packages/blocks/category/src/frontend/Category.server.tsx b/packages/blocks/category/src/frontend/Category.server.tsx index 5fb2cfaa9..11640640f 100644 --- a/packages/blocks/category/src/frontend/Category.server.tsx +++ b/packages/blocks/category/src/frontend/Category.server.tsx @@ -1,6 +1,7 @@ import dynamic from 'next/dynamic'; import React from 'react'; +import type { Model } from '../api-harmonization/category.client'; import { sdk } from '../sdk'; import { CategoryProps } from './Category.types'; @@ -17,29 +18,30 @@ export const Category: React.FC = async ({ renderBlocks, hasPriority, }) => { + let data: Model.CategoryBlock; try { - const data = await sdk.blocks.getCategory( + data = await sdk.blocks.getCategory( { id, }, { 'x-locale': locale }, accessToken, ); - - return ( - } - renderBlocks={renderBlocks} - hasPriority={hasPriority} - /> - ); } catch (_error) { return null; } + + return ( + } + renderBlocks={renderBlocks} + hasPriority={hasPriority} + /> + ); }; diff --git a/packages/blocks/category/src/frontend/Category.types.ts b/packages/blocks/category/src/frontend/Category.types.ts index 00b45224a..eaf94247e 100644 --- a/packages/blocks/category/src/frontend/Category.types.ts +++ b/packages/blocks/category/src/frontend/Category.types.ts @@ -3,7 +3,7 @@ import React from 'react'; import { CMS } from '@o2s/framework/modules'; -import { Model } from '../api-harmonization/category.client'; +import type { Model } from '../api-harmonization/category.client'; export interface CategoryProps { id: string; diff --git a/packages/blocks/cta-section/src/frontend/CtaSection.server.tsx b/packages/blocks/cta-section/src/frontend/CtaSection.server.tsx index 526d3ed5d..9152974e6 100644 --- a/packages/blocks/cta-section/src/frontend/CtaSection.server.tsx +++ b/packages/blocks/cta-section/src/frontend/CtaSection.server.tsx @@ -1,6 +1,7 @@ import dynamic from 'next/dynamic'; import React from 'react'; +import type { Model } from '../api-harmonization/cta-section.client'; import { sdk } from '../sdk'; import { CtaSectionProps } from './CtaSection.types'; @@ -8,18 +9,19 @@ import { CtaSectionProps } from './CtaSection.types'; export const CtaSectionDynamic = dynamic(() => import('./CtaSection.client').then((module) => module.CtaSectionPure)); export const CtaSection: React.FC = async ({ id, accessToken, locale, routing }) => { + let data: Model.CtaSectionBlock; try { - const data = await sdk.blocks.getCtaSection( + data = await sdk.blocks.getCtaSection( { id, }, { 'x-locale': locale }, accessToken, ); - - return ; } catch (error) { console.error('Error fetching CtaSection block', error); return null; } + + return ; }; diff --git a/packages/blocks/cta-section/src/frontend/CtaSection.types.ts b/packages/blocks/cta-section/src/frontend/CtaSection.types.ts index 5d3fedc8f..e88c22c22 100644 --- a/packages/blocks/cta-section/src/frontend/CtaSection.types.ts +++ b/packages/blocks/cta-section/src/frontend/CtaSection.types.ts @@ -1,6 +1,6 @@ import { defineRouting } from 'next-intl/routing'; -import { Model } from '../api-harmonization/cta-section.client'; +import type { Model } from '../api-harmonization/cta-section.client'; export interface CtaSectionProps { id: string; diff --git a/packages/blocks/document-list/src/frontend/DocumentList.server.tsx b/packages/blocks/document-list/src/frontend/DocumentList.server.tsx index 4a4bce856..4d57b4903 100644 --- a/packages/blocks/document-list/src/frontend/DocumentList.server.tsx +++ b/packages/blocks/document-list/src/frontend/DocumentList.server.tsx @@ -1,6 +1,7 @@ import dynamic from 'next/dynamic'; import React from 'react'; +import type { Model } from '../api-harmonization/document-list.client'; import { sdk } from '../sdk'; import { DocumentListProps } from './DocumentList.types'; @@ -10,27 +11,28 @@ export const DocumentListDynamic = dynamic(() => ); export const DocumentList: React.FC = async ({ id, accessToken, locale, routing, hasPriority }) => { + let data: Model.DocumentListBlock; try { - const data = await sdk.blocks.getDocumentList( + data = await sdk.blocks.getDocumentList( { id, }, { 'x-locale': locale }, accessToken, ); - - return ( - - ); } catch (error) { console.error('Error fetching DocumentList block', error); return null; } + + return ( + + ); }; diff --git a/packages/blocks/document-list/src/frontend/DocumentList.types.ts b/packages/blocks/document-list/src/frontend/DocumentList.types.ts index b48411975..3e8a92b63 100644 --- a/packages/blocks/document-list/src/frontend/DocumentList.types.ts +++ b/packages/blocks/document-list/src/frontend/DocumentList.types.ts @@ -1,6 +1,6 @@ import { defineRouting } from 'next-intl/routing'; -import { Model } from '../api-harmonization/document-list.client'; +import type { Model } from '../api-harmonization/document-list.client'; export interface DocumentListProps { id: string; diff --git a/packages/blocks/faq/package.json b/packages/blocks/faq/package.json index 8528feee0..35df0ed15 100644 --- a/packages/blocks/faq/package.json +++ b/packages/blocks/faq/package.json @@ -16,7 +16,7 @@ "scripts": { "build": "tsc --build tsconfig.json --preserveWatchOutput && tsc-alias", "test": "vitest run", - "lint": "tsc --noEmit && eslint \"src/**/*.{ts,tsx}\" --fix", + "lint": "tsc --noEmit && eslint \"src/**/*.{ts,tsx}\" --fix --max-warnings=0", "format": "prettier --write \"src/**/*.{js,jsx,ts,tsx,css,scss,json}\"" }, "dependencies": { diff --git a/packages/blocks/faq/src/frontend/Faq.server.tsx b/packages/blocks/faq/src/frontend/Faq.server.tsx index e8aaf5af7..7eba1e178 100644 --- a/packages/blocks/faq/src/frontend/Faq.server.tsx +++ b/packages/blocks/faq/src/frontend/Faq.server.tsx @@ -1,6 +1,7 @@ import dynamic from 'next/dynamic'; import React from 'react'; +import type { Model } from '../api-harmonization/faq.client'; import { sdk } from '../sdk'; import { FaqProps } from './Faq.types'; @@ -15,8 +16,9 @@ export const Faq: React.FC = async ({ hasPriority, isDraftModeEnabled, }) => { + let data: Model.FaqBlock; try { - const data = await sdk.blocks.getFaq( + data = await sdk.blocks.getFaq( { id, preview: isDraftModeEnabled, @@ -24,18 +26,18 @@ export const Faq: React.FC = async ({ { 'x-locale': locale }, accessToken, ); - - return ( - - ); } catch (_error) { return null; } + + return ( + + ); }; diff --git a/packages/blocks/faq/src/frontend/Faq.types.ts b/packages/blocks/faq/src/frontend/Faq.types.ts index 6a80a553e..378f32c4d 100644 --- a/packages/blocks/faq/src/frontend/Faq.types.ts +++ b/packages/blocks/faq/src/frontend/Faq.types.ts @@ -1,6 +1,6 @@ import { defineRouting } from 'next-intl/routing'; -import { Model } from '../api-harmonization/faq.client'; +import type { Model } from '../api-harmonization/faq.client'; export interface FaqProps { id: string; diff --git a/packages/blocks/feature-section-grid/src/frontend/FeatureSectionGrid.server.tsx b/packages/blocks/feature-section-grid/src/frontend/FeatureSectionGrid.server.tsx index dcb90ce0d..da4b23844 100644 --- a/packages/blocks/feature-section-grid/src/frontend/FeatureSectionGrid.server.tsx +++ b/packages/blocks/feature-section-grid/src/frontend/FeatureSectionGrid.server.tsx @@ -1,6 +1,7 @@ import dynamic from 'next/dynamic'; import React from 'react'; +import type { Model } from '../api-harmonization/feature-section-grid.client'; import { sdk } from '../sdk'; import { FeatureSectionGridProps } from './FeatureSectionGrid.types'; @@ -10,20 +11,19 @@ export const FeatureSectionGridDynamic = dynamic(() => ); export const FeatureSectionGrid: React.FC = async ({ id, accessToken, locale, routing }) => { + let data: Model.FeatureSectionGridBlock; try { - const data = await sdk.blocks.getFeatureSectionGrid( + data = await sdk.blocks.getFeatureSectionGrid( { id, }, { 'x-locale': locale }, accessToken, ); - - return ( - - ); } catch (error) { console.error('Error fetching FeatureSectionGrid block', error); return null; } + + return ; }; diff --git a/packages/blocks/feature-section-grid/src/frontend/FeatureSectionGrid.types.ts b/packages/blocks/feature-section-grid/src/frontend/FeatureSectionGrid.types.ts index 9880c09fe..544eda2ac 100644 --- a/packages/blocks/feature-section-grid/src/frontend/FeatureSectionGrid.types.ts +++ b/packages/blocks/feature-section-grid/src/frontend/FeatureSectionGrid.types.ts @@ -1,6 +1,6 @@ import { defineRouting } from 'next-intl/routing'; -import { Model } from '../api-harmonization/feature-section-grid.client'; +import type { Model } from '../api-harmonization/feature-section-grid.client'; export interface FeatureSectionGridProps { id: string; diff --git a/packages/blocks/feature-section/src/frontend/FeatureSection.server.tsx b/packages/blocks/feature-section/src/frontend/FeatureSection.server.tsx index 3ebe389cb..6e9121021 100644 --- a/packages/blocks/feature-section/src/frontend/FeatureSection.server.tsx +++ b/packages/blocks/feature-section/src/frontend/FeatureSection.server.tsx @@ -1,6 +1,7 @@ import dynamic from 'next/dynamic'; import React from 'react'; +import type { Model } from '../api-harmonization/feature-section.client'; import { sdk } from '../sdk'; import { FeatureSectionProps } from './FeatureSection.types'; @@ -10,18 +11,19 @@ export const FeatureSectionDynamic = dynamic(() => ); export const FeatureSection: React.FC = async ({ id, accessToken, locale, routing }) => { + let data: Model.FeatureSectionBlock; try { - const data = await sdk.blocks.getFeatureSection( + data = await sdk.blocks.getFeatureSection( { id, }, { 'x-locale': locale }, accessToken, ); - - return ; } catch (error) { console.error('Error fetching FeatureSection block', error); return null; } + + return ; }; diff --git a/packages/blocks/feature-section/src/frontend/FeatureSection.types.ts b/packages/blocks/feature-section/src/frontend/FeatureSection.types.ts index 25d5bb4c3..16fe75f9b 100644 --- a/packages/blocks/feature-section/src/frontend/FeatureSection.types.ts +++ b/packages/blocks/feature-section/src/frontend/FeatureSection.types.ts @@ -1,6 +1,6 @@ import { defineRouting } from 'next-intl/routing'; -import { Model } from '../api-harmonization/feature-section.client'; +import type { Model } from '../api-harmonization/feature-section.client'; export interface FeatureSectionProps { id: string; diff --git a/packages/blocks/featured-service-list/package.json b/packages/blocks/featured-service-list/package.json index dead46f5b..aab160eb9 100644 --- a/packages/blocks/featured-service-list/package.json +++ b/packages/blocks/featured-service-list/package.json @@ -16,7 +16,7 @@ "scripts": { "build": "tsc --build tsconfig.json --preserveWatchOutput && tsc-alias", "test": "vitest run", - "lint": "tsc --noEmit && eslint \"src/**/*.{ts,tsx}\" --fix", + "lint": "tsc --noEmit && eslint \"src/**/*.{ts,tsx}\" --fix --max-warnings=0", "format": "prettier --write \"src/**/*.{js,jsx,ts,tsx,css,scss,json}\"" }, "dependencies": { diff --git a/packages/blocks/featured-service-list/src/frontend/FeaturedServiceList.renderer.tsx b/packages/blocks/featured-service-list/src/frontend/FeaturedServiceList.renderer.tsx index 6481ec960..abebcfb83 100644 --- a/packages/blocks/featured-service-list/src/frontend/FeaturedServiceList.renderer.tsx +++ b/packages/blocks/featured-service-list/src/frontend/FeaturedServiceList.renderer.tsx @@ -1,5 +1,4 @@ import { useLocale } from 'next-intl'; -import { createNavigation } from 'next-intl/navigation'; import React, { Suspense } from 'react'; import { Loading } from '@o2s/ui/components/Loading'; @@ -7,13 +6,7 @@ import { Loading } from '@o2s/ui/components/Loading'; import { FeaturedServiceList } from './FeaturedServiceList.server'; import { FeaturedServiceListRendererProps } from './FeaturedServiceList.types'; -export const Renderer: React.FC = ({ - id, - accessToken, - slug, - routing, - hasPriority, -}) => { +export const Renderer: React.FC = ({ id, accessToken, routing, hasPriority }) => { const locale = useLocale(); return ( diff --git a/packages/blocks/featured-service-list/src/frontend/FeaturedServiceList.server.tsx b/packages/blocks/featured-service-list/src/frontend/FeaturedServiceList.server.tsx index c290b73c2..489152bd6 100644 --- a/packages/blocks/featured-service-list/src/frontend/FeaturedServiceList.server.tsx +++ b/packages/blocks/featured-service-list/src/frontend/FeaturedServiceList.server.tsx @@ -1,6 +1,7 @@ import dynamic from 'next/dynamic'; import React from 'react'; +import type { Model } from '../api-harmonization/featured-service-list.client'; import { sdk } from '../sdk'; import { FeaturedServiceListProps } from './FeaturedServiceList.types'; @@ -16,26 +17,27 @@ export const FeaturedServiceList: React.FC = async ({ routing, hasPriority, }) => { + let data: Model.FeaturedServiceListBlock; try { - const data = await sdk.blocks.getFeaturedServiceList( + data = await sdk.blocks.getFeaturedServiceList( { id, }, { 'x-locale': locale }, accessToken, ); - - return ( - - ); } catch (_error) { return null; } + + return ( + + ); }; diff --git a/packages/blocks/featured-service-list/src/frontend/FeaturedServiceList.types.ts b/packages/blocks/featured-service-list/src/frontend/FeaturedServiceList.types.ts index 93f10df43..10a79ebc7 100644 --- a/packages/blocks/featured-service-list/src/frontend/FeaturedServiceList.types.ts +++ b/packages/blocks/featured-service-list/src/frontend/FeaturedServiceList.types.ts @@ -1,6 +1,6 @@ import { defineRouting } from 'next-intl/routing'; -import { Model } from '../api-harmonization/featured-service-list.client'; +import type { Model } from '../api-harmonization/featured-service-list.client'; export interface FeaturedServiceListProps { id: string; diff --git a/packages/blocks/hero-section/src/frontend/HeroSection.server.tsx b/packages/blocks/hero-section/src/frontend/HeroSection.server.tsx index 55d12ad63..00a392673 100644 --- a/packages/blocks/hero-section/src/frontend/HeroSection.server.tsx +++ b/packages/blocks/hero-section/src/frontend/HeroSection.server.tsx @@ -1,6 +1,7 @@ import dynamic from 'next/dynamic'; import React from 'react'; +import type { Model } from '../api-harmonization/hero-section.client'; import { sdk } from '../sdk'; import { HeroSectionProps } from './HeroSection.types'; @@ -10,27 +11,28 @@ export const HeroSectionDynamic = dynamic(() => ); export const HeroSection: React.FC = async ({ id, accessToken, locale, routing, hasPriority }) => { + let data: Model.HeroSectionBlock; try { - const data = await sdk.blocks.getHeroSection( + data = await sdk.blocks.getHeroSection( { id, }, { 'x-locale': locale }, accessToken, ); - - return ( - - ); } catch (error) { console.error('Error fetching HeroSection block', error); return null; } + + return ( + + ); }; diff --git a/packages/blocks/hero-section/src/frontend/HeroSection.types.ts b/packages/blocks/hero-section/src/frontend/HeroSection.types.ts index 7ff59b36d..cb18ec850 100644 --- a/packages/blocks/hero-section/src/frontend/HeroSection.types.ts +++ b/packages/blocks/hero-section/src/frontend/HeroSection.types.ts @@ -1,6 +1,6 @@ import { defineRouting } from 'next-intl/routing'; -import { Model } from '../api-harmonization/hero-section.client'; +import type { Model } from '../api-harmonization/hero-section.client'; export interface HeroSectionProps { id: string; diff --git a/packages/blocks/invoice-list/package.json b/packages/blocks/invoice-list/package.json index 75c5b0944..bf51ca514 100644 --- a/packages/blocks/invoice-list/package.json +++ b/packages/blocks/invoice-list/package.json @@ -16,7 +16,7 @@ "scripts": { "build": "tsc --build tsconfig.json --preserveWatchOutput && tsc-alias", "test": "vitest run", - "lint": "tsc --noEmit && eslint \"src/**/*.{ts,tsx}\" --fix", + "lint": "tsc --noEmit && eslint \"src/**/*.{ts,tsx}\" --fix --max-warnings=0", "format": "prettier --write \"src/**/*.{js,jsx,ts,tsx,css,scss,json}\"" }, "dependencies": { diff --git a/packages/blocks/invoice-list/src/frontend/InvoiceList.renderer.tsx b/packages/blocks/invoice-list/src/frontend/InvoiceList.renderer.tsx index ee39ed670..9b32050d6 100644 --- a/packages/blocks/invoice-list/src/frontend/InvoiceList.renderer.tsx +++ b/packages/blocks/invoice-list/src/frontend/InvoiceList.renderer.tsx @@ -1,7 +1,6 @@ import { useLocale } from 'next-intl'; import React, { Suspense } from 'react'; -import { Container } from '@o2s/ui/components/Container'; import { Loading } from '@o2s/ui/components/Loading'; import { InvoiceListServer } from './InvoiceList.server'; diff --git a/packages/blocks/invoice-list/src/frontend/InvoiceList.server.tsx b/packages/blocks/invoice-list/src/frontend/InvoiceList.server.tsx index 28465ac26..f32505376 100644 --- a/packages/blocks/invoice-list/src/frontend/InvoiceList.server.tsx +++ b/packages/blocks/invoice-list/src/frontend/InvoiceList.server.tsx @@ -1,6 +1,7 @@ import dynamic from 'next/dynamic'; import React from 'react'; +import type { Model } from '../api-harmonization/invoice-list.client'; import { sdk } from '../sdk'; import { InvoiceListProps } from './InvoiceList.types'; @@ -16,26 +17,27 @@ export const InvoiceListServer: React.FC = async ({ routing, hasPriority, }) => { + let data: Model.InvoiceListBlock; try { - const data = await sdk.blocks.getInvoiceList( + data = await sdk.blocks.getInvoiceList( { id, }, { 'x-locale': locale }, accessToken, ); - - return ( - - ); } catch (_error) { return null; } + + return ( + + ); }; diff --git a/packages/blocks/invoice-list/src/frontend/InvoiceList.types.ts b/packages/blocks/invoice-list/src/frontend/InvoiceList.types.ts index 911279c12..10446b0c9 100644 --- a/packages/blocks/invoice-list/src/frontend/InvoiceList.types.ts +++ b/packages/blocks/invoice-list/src/frontend/InvoiceList.types.ts @@ -1,6 +1,6 @@ import { defineRouting } from 'next-intl/routing'; -import { Model } from '../api-harmonization/invoice-list.client'; +import type { Model } from '../api-harmonization/invoice-list.client'; export interface InvoiceListProps { id: string; diff --git a/packages/blocks/media-section/src/frontend/MediaSection.server.tsx b/packages/blocks/media-section/src/frontend/MediaSection.server.tsx index bd042c2ba..a22817952 100644 --- a/packages/blocks/media-section/src/frontend/MediaSection.server.tsx +++ b/packages/blocks/media-section/src/frontend/MediaSection.server.tsx @@ -1,6 +1,7 @@ import dynamic from 'next/dynamic'; import React from 'react'; +import type { Model } from '../api-harmonization/media-section.client'; import { sdk } from '../sdk'; import { MediaSectionProps } from './MediaSection.types'; @@ -10,18 +11,19 @@ export const MediaSectionDynamic = dynamic(() => ); export const MediaSection: React.FC = async ({ id, accessToken, locale, routing }) => { + let data: Model.MediaSectionBlock; try { - const data = await sdk.blocks.getMediaSection( + data = await sdk.blocks.getMediaSection( { id, }, { 'x-locale': locale }, accessToken, ); - - return ; } catch (error) { console.error('Error fetching MediaSection block', error); return null; } + + return ; }; diff --git a/packages/blocks/media-section/src/frontend/MediaSection.types.ts b/packages/blocks/media-section/src/frontend/MediaSection.types.ts index d3e6da1cc..d4fb95104 100644 --- a/packages/blocks/media-section/src/frontend/MediaSection.types.ts +++ b/packages/blocks/media-section/src/frontend/MediaSection.types.ts @@ -1,6 +1,6 @@ import { defineRouting } from 'next-intl/routing'; -import { Model } from '../api-harmonization/media-section.client'; +import type { Model } from '../api-harmonization/media-section.client'; export interface MediaSectionProps { id: string; diff --git a/packages/blocks/notification-details/package.json b/packages/blocks/notification-details/package.json index 74f29a8f4..b4dec5bc8 100644 --- a/packages/blocks/notification-details/package.json +++ b/packages/blocks/notification-details/package.json @@ -16,7 +16,7 @@ "scripts": { "build": "tsc --build tsconfig.json --preserveWatchOutput && tsc-alias", "test": "vitest run", - "lint": "tsc --noEmit && eslint \"src/**/*.{ts,tsx}\" --fix", + "lint": "tsc --noEmit && eslint \"src/**/*.{ts,tsx}\" --fix --max-warnings=0", "format": "prettier --write \"src/**/*.{js,jsx,ts,tsx,css,scss,json}\"" }, "dependencies": { diff --git a/packages/blocks/notification-details/src/frontend/NotificationDetails.server.tsx b/packages/blocks/notification-details/src/frontend/NotificationDetails.server.tsx index 2f968a816..60633ac66 100644 --- a/packages/blocks/notification-details/src/frontend/NotificationDetails.server.tsx +++ b/packages/blocks/notification-details/src/frontend/NotificationDetails.server.tsx @@ -1,6 +1,7 @@ import dynamic from 'next/dynamic'; import React from 'react'; +import type { Model } from '../api-harmonization/notification-details.client'; import { sdk } from '../sdk'; import { NotificationDetailsProps } from './NotificationDetails.types'; @@ -17,8 +18,9 @@ export const NotificationDetails: React.FC = async ({ routing, hasPriority, }) => { + let data: Model.NotificationDetailsBlock; try { - const data = await sdk.blocks.getNotificationDetails( + data = await sdk.blocks.getNotificationDetails( { id: notificationId, }, @@ -28,19 +30,19 @@ export const NotificationDetails: React.FC = async ({ { 'x-locale': locale }, accessToken, ); - - return ( - - ); } catch (_error) { return null; } + + return ( + + ); }; diff --git a/packages/blocks/notification-details/src/frontend/NotificationDetails.types.ts b/packages/blocks/notification-details/src/frontend/NotificationDetails.types.ts index a71ab3b2c..3d5067cf1 100644 --- a/packages/blocks/notification-details/src/frontend/NotificationDetails.types.ts +++ b/packages/blocks/notification-details/src/frontend/NotificationDetails.types.ts @@ -1,6 +1,6 @@ import { defineRouting } from 'next-intl/routing'; -import { Model } from '../api-harmonization/notification-details.client'; +import type { Model } from '../api-harmonization/notification-details.client'; export interface NotificationDetailsProps { id: string; diff --git a/packages/blocks/notification-list/package.json b/packages/blocks/notification-list/package.json index fbb0d6aae..d8d422a65 100644 --- a/packages/blocks/notification-list/package.json +++ b/packages/blocks/notification-list/package.json @@ -16,7 +16,7 @@ "scripts": { "build": "tsc --build tsconfig.json --preserveWatchOutput && tsc-alias", "test": "vitest run", - "lint": "tsc --noEmit && eslint \"src/**/*.{ts,tsx}\" --fix", + "lint": "tsc --noEmit && eslint \"src/**/*.{ts,tsx}\" --fix --max-warnings=0", "format": "prettier --write \"src/**/*.{js,jsx,ts,tsx,css,scss,json}\"" }, "dependencies": { diff --git a/packages/blocks/notification-list/src/frontend/NotificationList.server.tsx b/packages/blocks/notification-list/src/frontend/NotificationList.server.tsx index 03d925e29..07d25aaba 100644 --- a/packages/blocks/notification-list/src/frontend/NotificationList.server.tsx +++ b/packages/blocks/notification-list/src/frontend/NotificationList.server.tsx @@ -1,6 +1,7 @@ import dynamic from 'next/dynamic'; import React from 'react'; +import type { Model } from '../api-harmonization/notification-list.client'; import { sdk } from '../sdk'; import { NotificationListProps } from './NotificationList.types'; @@ -16,26 +17,27 @@ export const NotificationListServer: React.FC = async ({ routing, hasPriority, }) => { + let data: Model.NotificationListBlock; try { - const data = await sdk.blocks.getNotificationList( + data = await sdk.blocks.getNotificationList( { id, }, { 'x-locale': locale }, accessToken, ); - - return ( - - ); } catch (_error) { return null; } + + return ( + + ); }; diff --git a/packages/blocks/notification-list/src/frontend/NotificationList.types.ts b/packages/blocks/notification-list/src/frontend/NotificationList.types.ts index 0a3705b26..4699faed9 100644 --- a/packages/blocks/notification-list/src/frontend/NotificationList.types.ts +++ b/packages/blocks/notification-list/src/frontend/NotificationList.types.ts @@ -1,6 +1,6 @@ import { defineRouting } from 'next-intl/routing'; -import { Model } from '../api-harmonization/notification-list.client'; +import type { Model } from '../api-harmonization/notification-list.client'; export interface NotificationListProps { id: string; diff --git a/packages/blocks/notification-summary/package.json b/packages/blocks/notification-summary/package.json index 6a3c51555..2163d4523 100644 --- a/packages/blocks/notification-summary/package.json +++ b/packages/blocks/notification-summary/package.json @@ -16,7 +16,7 @@ "scripts": { "build": "tsc --build tsconfig.json --preserveWatchOutput && tsc-alias", "test": "vitest run", - "lint": "tsc --noEmit && eslint \"src/**/*.{ts,tsx}\" --fix", + "lint": "tsc --noEmit && eslint \"src/**/*.{ts,tsx}\" --fix --max-warnings=0", "format": "prettier --write \"src/**/*.{js,jsx,ts,tsx,css,scss,json}\"" }, "dependencies": { diff --git a/packages/blocks/notification-summary/src/frontend/NotificationSummary.server.tsx b/packages/blocks/notification-summary/src/frontend/NotificationSummary.server.tsx index 8d9e4ef3a..c5b24055b 100644 --- a/packages/blocks/notification-summary/src/frontend/NotificationSummary.server.tsx +++ b/packages/blocks/notification-summary/src/frontend/NotificationSummary.server.tsx @@ -1,6 +1,7 @@ import dynamic from 'next/dynamic'; import React from 'react'; +import type { Model } from '../api-harmonization/notification-summary.client'; import { sdk } from '../sdk'; import { NotificationSummaryProps } from './NotificationSummary.types'; @@ -10,20 +11,19 @@ export const NotificationSummaryDynamic = dynamic(() => ); export const NotificationSummary: React.FC = async ({ id, accessToken, locale, routing }) => { + let data: Model.NotificationSummaryBlock; try { - const data = await sdk.blocks.getNotificationSummary( + data = await sdk.blocks.getNotificationSummary( { id, }, { 'x-locale': locale }, accessToken, ); - - return ( - - ); } catch (error) { console.error('Error fetching NotificationSummary block', error); return null; } + + return ; }; diff --git a/packages/blocks/notification-summary/src/frontend/NotificationSummary.types.ts b/packages/blocks/notification-summary/src/frontend/NotificationSummary.types.ts index 4ec2c0620..19beba1f8 100644 --- a/packages/blocks/notification-summary/src/frontend/NotificationSummary.types.ts +++ b/packages/blocks/notification-summary/src/frontend/NotificationSummary.types.ts @@ -1,6 +1,6 @@ import { defineRouting } from 'next-intl/routing'; -import { Model } from '../api-harmonization/notification-summary.client'; +import type { Model } from '../api-harmonization/notification-summary.client'; export interface NotificationSummaryProps { id: string; diff --git a/packages/blocks/order-details/package.json b/packages/blocks/order-details/package.json index 1321a9d3e..5961f3c8e 100644 --- a/packages/blocks/order-details/package.json +++ b/packages/blocks/order-details/package.json @@ -16,7 +16,7 @@ "scripts": { "build": "tsc --build tsconfig.json --preserveWatchOutput && tsc-alias", "test": "vitest run", - "lint": "tsc --noEmit && eslint \"src/**/*.{ts,tsx}\" --fix", + "lint": "tsc --noEmit && eslint \"src/**/*.{ts,tsx}\" --fix --max-warnings=0", "format": "prettier --write \"src/**/*.{js,jsx,ts,tsx,css,scss,json}\"" }, "dependencies": { diff --git a/packages/blocks/order-details/src/frontend/OrderDetails.server.tsx b/packages/blocks/order-details/src/frontend/OrderDetails.server.tsx index 66ae12d30..fcd7fa556 100644 --- a/packages/blocks/order-details/src/frontend/OrderDetails.server.tsx +++ b/packages/blocks/order-details/src/frontend/OrderDetails.server.tsx @@ -1,6 +1,7 @@ import dynamic from 'next/dynamic'; import React from 'react'; +import type { Model } from '../api-harmonization/order-details.client'; import { Request } from '../api-harmonization/order-details.client'; import { sdk } from '../sdk'; @@ -18,8 +19,9 @@ export const OrderDetails: React.FC = async ({ routing, hasPriority, }) => { + let data: Model.OrderDetailsBlock; try { - const data = await sdk.blocks.getOrderDetails( + data = await sdk.blocks.getOrderDetails( { id: orderId, }, @@ -29,19 +31,19 @@ export const OrderDetails: React.FC = async ({ { 'x-locale': locale }, accessToken, ); - - return ( - - ); } catch (_error) { return null; } + + return ( + + ); }; diff --git a/packages/blocks/order-details/src/frontend/OrderDetails.types.ts b/packages/blocks/order-details/src/frontend/OrderDetails.types.ts index 5dde7653d..78b955c88 100644 --- a/packages/blocks/order-details/src/frontend/OrderDetails.types.ts +++ b/packages/blocks/order-details/src/frontend/OrderDetails.types.ts @@ -1,6 +1,6 @@ import { defineRouting } from 'next-intl/routing'; -import { Model } from '../api-harmonization/order-details.client'; +import type { Model } from '../api-harmonization/order-details.client'; export interface OrderDetailsProps { id: string; diff --git a/packages/blocks/order-list/package.json b/packages/blocks/order-list/package.json index e29cc424e..f858d55d0 100644 --- a/packages/blocks/order-list/package.json +++ b/packages/blocks/order-list/package.json @@ -16,7 +16,7 @@ "scripts": { "build": "tsc --build tsconfig.json --preserveWatchOutput && tsc-alias", "test": "vitest run", - "lint": "tsc --noEmit && eslint \"src/**/*.{ts,tsx}\" --fix", + "lint": "tsc --noEmit && eslint \"src/**/*.{ts,tsx}\" --fix --max-warnings=0", "format": "prettier --write \"src/**/*.{js,jsx,ts,tsx,css,scss,json}\"" }, "dependencies": { diff --git a/packages/blocks/order-list/src/frontend/OrderList.server.tsx b/packages/blocks/order-list/src/frontend/OrderList.server.tsx index 1c180de86..9a210e41e 100644 --- a/packages/blocks/order-list/src/frontend/OrderList.server.tsx +++ b/packages/blocks/order-list/src/frontend/OrderList.server.tsx @@ -1,6 +1,7 @@ import dynamic from 'next/dynamic'; import React from 'react'; +import type { Model } from '../api-harmonization/order-list.client'; import { sdk } from '../sdk'; import { OrderListProps } from './OrderList.types'; @@ -8,26 +9,27 @@ import { OrderListProps } from './OrderList.types'; export const OrderListDynamic = dynamic(() => import('./OrderList.client').then((module) => module.OrderListPure)); export const OrderList: React.FC = async ({ id, accessToken, locale, routing, hasPriority }) => { + let data: Model.OrderListBlock; try { - const data = await sdk.blocks.getOrderList( + data = await sdk.blocks.getOrderList( { id, }, { 'x-locale': locale }, accessToken, ); - - return ( - - ); } catch (_error) { return null; } + + return ( + + ); }; diff --git a/packages/blocks/order-list/src/frontend/OrderList.types.ts b/packages/blocks/order-list/src/frontend/OrderList.types.ts index d145e1949..b77e2e8f0 100644 --- a/packages/blocks/order-list/src/frontend/OrderList.types.ts +++ b/packages/blocks/order-list/src/frontend/OrderList.types.ts @@ -1,6 +1,6 @@ import { defineRouting } from 'next-intl/routing'; -import { Model } from '../api-harmonization/order-list.client'; +import type { Model } from '../api-harmonization/order-list.client'; export interface OrderListProps { id: string; diff --git a/packages/blocks/orders-summary/package.json b/packages/blocks/orders-summary/package.json index a5fe6f4ee..db4ed8065 100644 --- a/packages/blocks/orders-summary/package.json +++ b/packages/blocks/orders-summary/package.json @@ -16,7 +16,7 @@ "scripts": { "build": "tsc --build tsconfig.json --preserveWatchOutput && tsc-alias", "test": "vitest run", - "lint": "tsc --noEmit && eslint \"src/**/*.{ts,tsx}\" --fix", + "lint": "tsc --noEmit && eslint \"src/**/*.{ts,tsx}\" --fix --max-warnings=0", "format": "prettier --write \"src/**/*.{js,jsx,ts,tsx,css,scss,json}\"" }, "dependencies": { diff --git a/packages/blocks/orders-summary/src/frontend/OrdersSummary.server.tsx b/packages/blocks/orders-summary/src/frontend/OrdersSummary.server.tsx index 5e5d8b6e2..7aa8b5783 100644 --- a/packages/blocks/orders-summary/src/frontend/OrdersSummary.server.tsx +++ b/packages/blocks/orders-summary/src/frontend/OrdersSummary.server.tsx @@ -2,6 +2,7 @@ import dayjs from 'dayjs'; import dynamic from 'next/dynamic'; import React from 'react'; +import type { Model } from '../api-harmonization/orders-summary.client'; import { Request } from '../api-harmonization/orders-summary.client'; import { sdk } from '../sdk'; @@ -18,8 +19,9 @@ export const OrdersSummary: React.FC = async ({ routing, hasPriority, }) => { + let data: Model.OrdersSummaryBlock; try { - const data = await sdk.blocks.getOrdersSummary( + data = await sdk.blocks.getOrdersSummary( { id, dateFrom: dayjs().subtract(6, 'months').toISOString(), @@ -29,19 +31,19 @@ export const OrdersSummary: React.FC = async ({ { 'x-locale': locale }, accessToken, ); - - return ( - - ); } catch (_error) { console.error(_error); return null; } + + return ( + + ); }; diff --git a/packages/blocks/orders-summary/src/frontend/OrdersSummary.types.ts b/packages/blocks/orders-summary/src/frontend/OrdersSummary.types.ts index f623485d0..8ec09d52b 100644 --- a/packages/blocks/orders-summary/src/frontend/OrdersSummary.types.ts +++ b/packages/blocks/orders-summary/src/frontend/OrdersSummary.types.ts @@ -1,6 +1,6 @@ import { defineRouting } from 'next-intl/routing'; -import { Model } from '../api-harmonization/orders-summary.client'; +import type { Model } from '../api-harmonization/orders-summary.client'; export interface OrdersSummaryProps { id: string; diff --git a/packages/blocks/payments-history/package.json b/packages/blocks/payments-history/package.json index 282ac6eb9..5a2e4749f 100644 --- a/packages/blocks/payments-history/package.json +++ b/packages/blocks/payments-history/package.json @@ -16,7 +16,7 @@ "scripts": { "build": "tsc --build tsconfig.json --preserveWatchOutput && tsc-alias", "test": "vitest run", - "lint": "tsc --noEmit && eslint \"src/**/*.{ts,tsx}\" --fix", + "lint": "tsc --noEmit && eslint \"src/**/*.{ts,tsx}\" --fix --max-warnings=0", "format": "prettier --write \"src/**/*.{js,jsx,ts,tsx,css,scss,json}\"" }, "dependencies": { diff --git a/packages/blocks/payments-history/src/frontend/PaymentsHistory.server.tsx b/packages/blocks/payments-history/src/frontend/PaymentsHistory.server.tsx index c3751b2d3..dd13177aa 100644 --- a/packages/blocks/payments-history/src/frontend/PaymentsHistory.server.tsx +++ b/packages/blocks/payments-history/src/frontend/PaymentsHistory.server.tsx @@ -1,6 +1,7 @@ import dynamic from 'next/dynamic'; import React from 'react'; +import type { Model } from '../api-harmonization/payments-history.client'; import { sdk } from '../sdk'; import { PaymentsHistoryProps } from './PaymentsHistory.types'; @@ -10,8 +11,9 @@ export const PaymentsHistoryDynamic = dynamic(() => ); export const PaymentsHistory: React.FC = async ({ id, accessToken, locale, hasPriority }) => { + let data: Model.PaymentsHistoryBlock; try { - const data = await sdk.blocks.getPaymentsHistory( + data = await sdk.blocks.getPaymentsHistory( { id, offset: 0, @@ -20,17 +22,11 @@ export const PaymentsHistory: React.FC = async ({ id, acce { 'x-locale': locale }, accessToken, ); - - return ( - - ); } catch (_error) { return null; } + + return ( + + ); }; diff --git a/packages/blocks/payments-history/src/frontend/PaymentsHistory.types.ts b/packages/blocks/payments-history/src/frontend/PaymentsHistory.types.ts index d533ed8a6..635363f3d 100644 --- a/packages/blocks/payments-history/src/frontend/PaymentsHistory.types.ts +++ b/packages/blocks/payments-history/src/frontend/PaymentsHistory.types.ts @@ -1,4 +1,4 @@ -import { Model } from '../api-harmonization/payments-history.client'; +import type { Model } from '../api-harmonization/payments-history.client'; export interface PaymentsHistoryProps { id: string; diff --git a/packages/blocks/payments-summary/package.json b/packages/blocks/payments-summary/package.json index b23985c70..cad0ab1d4 100644 --- a/packages/blocks/payments-summary/package.json +++ b/packages/blocks/payments-summary/package.json @@ -16,7 +16,7 @@ "scripts": { "build": "tsc --build tsconfig.json --preserveWatchOutput && tsc-alias", "test": "vitest run", - "lint": "tsc --noEmit && eslint \"src/**/*.{ts,tsx}\" --fix", + "lint": "tsc --noEmit && eslint \"src/**/*.{ts,tsx}\" --fix --max-warnings=0", "format": "prettier --write \"src/**/*.{js,jsx,ts,tsx,css,scss,json}\"" }, "dependencies": { diff --git a/packages/blocks/payments-summary/src/frontend/PaymentsSummary.server.tsx b/packages/blocks/payments-summary/src/frontend/PaymentsSummary.server.tsx index 56cf0bf00..7e206669a 100644 --- a/packages/blocks/payments-summary/src/frontend/PaymentsSummary.server.tsx +++ b/packages/blocks/payments-summary/src/frontend/PaymentsSummary.server.tsx @@ -1,6 +1,7 @@ import dynamic from 'next/dynamic'; import React from 'react'; +import type { Model } from '../api-harmonization/payments-summary.client'; import { sdk } from '../sdk'; import { PaymentsSummaryProps } from './PaymentsSummary.types'; @@ -16,8 +17,9 @@ export const PaymentsSummary: React.FC = async ({ routing, hasPriority, }) => { + let data: Model.PaymentsSummaryBlock; try { - const data = await sdk.blocks.getPaymentsSummary( + data = await sdk.blocks.getPaymentsSummary( { id, limit: 1000, @@ -26,18 +28,18 @@ export const PaymentsSummary: React.FC = async ({ { 'x-locale': locale }, accessToken, ); - - return ( - - ); } catch (_error) { return null; } + + return ( + + ); }; diff --git a/packages/blocks/payments-summary/src/frontend/PaymentsSummary.types.ts b/packages/blocks/payments-summary/src/frontend/PaymentsSummary.types.ts index 9ed26cc42..8804d0c31 100644 --- a/packages/blocks/payments-summary/src/frontend/PaymentsSummary.types.ts +++ b/packages/blocks/payments-summary/src/frontend/PaymentsSummary.types.ts @@ -1,6 +1,6 @@ import { defineRouting } from 'next-intl/routing'; -import { Model } from '../api-harmonization/payments-summary.client'; +import type { Model } from '../api-harmonization/payments-summary.client'; export interface PaymentsSummaryProps { id: string; diff --git a/packages/blocks/pricing-section/src/frontend/PricingSection.server.tsx b/packages/blocks/pricing-section/src/frontend/PricingSection.server.tsx index 3a51dbb86..6334077d7 100644 --- a/packages/blocks/pricing-section/src/frontend/PricingSection.server.tsx +++ b/packages/blocks/pricing-section/src/frontend/PricingSection.server.tsx @@ -1,6 +1,7 @@ import dynamic from 'next/dynamic'; import React from 'react'; +import type { Model } from '../api-harmonization/pricing-section.client'; import { sdk } from '../sdk'; import { PricingSectionProps } from './PricingSection.types'; @@ -16,27 +17,28 @@ export const PricingSection: React.FC = async ({ routing, hasPriority, }) => { + let data: Model.PricingSectionBlock; try { - const data = await sdk.blocks.getPricingSection( + data = await sdk.blocks.getPricingSection( { id, }, { 'x-locale': locale }, accessToken, ); - - return ( - - ); } catch (error) { console.error('Error fetching PricingSection block', error); return null; } + + return ( + + ); }; diff --git a/packages/blocks/pricing-section/src/frontend/PricingSection.types.ts b/packages/blocks/pricing-section/src/frontend/PricingSection.types.ts index 22bb275a4..f9e96cad6 100644 --- a/packages/blocks/pricing-section/src/frontend/PricingSection.types.ts +++ b/packages/blocks/pricing-section/src/frontend/PricingSection.types.ts @@ -1,6 +1,6 @@ import { defineRouting } from 'next-intl/routing'; -import { Model } from '../api-harmonization/pricing-section.client'; +import type { Model } from '../api-harmonization/pricing-section.client'; export interface PricingSectionProps { id: string; diff --git a/packages/blocks/product-list/package.json b/packages/blocks/product-list/package.json index 5f043e13b..a5c120064 100644 --- a/packages/blocks/product-list/package.json +++ b/packages/blocks/product-list/package.json @@ -16,7 +16,7 @@ "scripts": { "build": "tsc --build tsconfig.json --preserveWatchOutput && tsc-alias", "test": "vitest run", - "lint": "tsc --noEmit && eslint \"src/**/*.{ts,tsx}\" --fix", + "lint": "tsc --noEmit && eslint \"src/**/*.{ts,tsx}\" --fix --max-warnings=0", "format": "prettier --write \"src/**/*.{js,jsx,ts,tsx,css,scss,json}\"" }, "dependencies": { diff --git a/packages/blocks/product-list/src/frontend/ProductList.client.tsx b/packages/blocks/product-list/src/frontend/ProductList.client.tsx index dde283d38..4b3ae5d5f 100644 --- a/packages/blocks/product-list/src/frontend/ProductList.client.tsx +++ b/packages/blocks/product-list/src/frontend/ProductList.client.tsx @@ -16,7 +16,7 @@ import { LoadingOverlay } from '@o2s/ui/elements/loading-overlay'; import { Separator } from '@o2s/ui/elements/separator'; import { ToggleGroup, ToggleGroupItem } from '@o2s/ui/elements/toggle-group'; -import { Model } from '../api-harmonization/product-list.client'; +import type { Model } from '../api-harmonization/product-list.client'; import { sdk } from '../sdk'; import { ProductListPureProps } from './ProductList.types'; diff --git a/packages/blocks/product-list/src/frontend/ProductList.server.tsx b/packages/blocks/product-list/src/frontend/ProductList.server.tsx index c4577fc3f..12d1a7dc5 100644 --- a/packages/blocks/product-list/src/frontend/ProductList.server.tsx +++ b/packages/blocks/product-list/src/frontend/ProductList.server.tsx @@ -1,6 +1,7 @@ import dynamic from 'next/dynamic'; import React from 'react'; +import type { Model } from '../api-harmonization/product-list.client'; import { sdk } from '../sdk'; import { ProductListProps } from './ProductList.types'; @@ -10,17 +11,18 @@ export const ProductListDynamic = dynamic(() => ); export const ProductList: React.FC = async ({ id, accessToken, locale, routing }) => { + let data: Model.ProductListBlock; try { - const data = await sdk.blocks.getProductList( + data = await sdk.blocks.getProductList( { id, }, { 'x-locale': locale }, accessToken, ); - - return ; } catch (_error) { return null; } + + return ; }; diff --git a/packages/blocks/product-list/src/frontend/ProductList.types.ts b/packages/blocks/product-list/src/frontend/ProductList.types.ts index 4e9699024..8c7fc2d98 100644 --- a/packages/blocks/product-list/src/frontend/ProductList.types.ts +++ b/packages/blocks/product-list/src/frontend/ProductList.types.ts @@ -1,6 +1,6 @@ import { defineRouting } from 'next-intl/routing'; -import { Model } from '../api-harmonization/product-list.client'; +import type { Model } from '../api-harmonization/product-list.client'; export interface ProductListProps { id: string; diff --git a/packages/blocks/quick-links/package.json b/packages/blocks/quick-links/package.json index 9aa921817..e68ecd35a 100644 --- a/packages/blocks/quick-links/package.json +++ b/packages/blocks/quick-links/package.json @@ -16,7 +16,7 @@ "scripts": { "build": "tsc --build tsconfig.json --preserveWatchOutput && tsc-alias", "test": "vitest run", - "lint": "tsc --noEmit && eslint \"src/**/*.{ts,tsx}\" --fix", + "lint": "tsc --noEmit && eslint \"src/**/*.{ts,tsx}\" --fix --max-warnings=0", "format": "prettier --write \"src/**/*.{js,jsx,ts,tsx,css,scss,json}\"" }, "dependencies": { diff --git a/packages/blocks/quick-links/src/frontend/QuickLinks.server.tsx b/packages/blocks/quick-links/src/frontend/QuickLinks.server.tsx index 388988f1f..d6c9dd407 100644 --- a/packages/blocks/quick-links/src/frontend/QuickLinks.server.tsx +++ b/packages/blocks/quick-links/src/frontend/QuickLinks.server.tsx @@ -1,6 +1,7 @@ import dynamic from 'next/dynamic'; import React from 'react'; +import type { Model } from '../api-harmonization/quick-links.client'; import { sdk } from '../sdk'; import { QuickLinksProps } from './QuickLinks.types'; @@ -15,7 +16,7 @@ export const QuickLinks: React.FC = async ({ hasPriority, isDraftModeEnabled, }) => { - let data; + let data: Model.QuickLinksBlock; try { data = await sdk.blocks.getQuickLinks( { diff --git a/packages/blocks/quick-links/src/frontend/QuickLinks.types.ts b/packages/blocks/quick-links/src/frontend/QuickLinks.types.ts index 155c0a009..c3e526f33 100644 --- a/packages/blocks/quick-links/src/frontend/QuickLinks.types.ts +++ b/packages/blocks/quick-links/src/frontend/QuickLinks.types.ts @@ -1,6 +1,6 @@ import { defineRouting } from 'next-intl/routing'; -import { Model } from '../api-harmonization/quick-links.client'; +import type { Model } from '../api-harmonization/quick-links.client'; export interface QuickLinksProps { id: string; diff --git a/packages/blocks/service-details/package.json b/packages/blocks/service-details/package.json index 72c92737a..829b98e48 100644 --- a/packages/blocks/service-details/package.json +++ b/packages/blocks/service-details/package.json @@ -16,7 +16,7 @@ "scripts": { "build": "tsc --build tsconfig.json --preserveWatchOutput && tsc-alias", "test": "vitest run", - "lint": "tsc --noEmit && eslint \"src/**/*.{ts,tsx}\" --fix", + "lint": "tsc --noEmit && eslint \"src/**/*.{ts,tsx}\" --fix --max-warnings=0", "format": "prettier --write \"src/**/*.{js,jsx,ts,tsx,css,scss,json}\"" }, "dependencies": { diff --git a/packages/blocks/service-details/src/frontend/ServiceDetails.server.tsx b/packages/blocks/service-details/src/frontend/ServiceDetails.server.tsx index 9302df1cb..7e7e5d937 100644 --- a/packages/blocks/service-details/src/frontend/ServiceDetails.server.tsx +++ b/packages/blocks/service-details/src/frontend/ServiceDetails.server.tsx @@ -1,6 +1,7 @@ import dynamic from 'next/dynamic'; import React from 'react'; +import type { Model } from '../api-harmonization/service-details.client'; import { sdk } from '../sdk'; import { ServiceDetailsProps } from './ServiceDetails.types'; @@ -17,8 +18,9 @@ export const ServiceDetails: React.FC = async ({ routing, hasPriority, }) => { + let data: Model.ServiceDetailsBlock; try { - const data = await sdk.blocks.getServiceDetails( + data = await sdk.blocks.getServiceDetails( { id: serviceId, }, @@ -28,19 +30,19 @@ export const ServiceDetails: React.FC = async ({ { 'x-locale': locale }, accessToken, ); - - return ( - - ); } catch (_error) { return null; } + + return ( + + ); }; diff --git a/packages/blocks/service-details/src/frontend/ServiceDetails.types.ts b/packages/blocks/service-details/src/frontend/ServiceDetails.types.ts index 23c0574a3..4edf79524 100644 --- a/packages/blocks/service-details/src/frontend/ServiceDetails.types.ts +++ b/packages/blocks/service-details/src/frontend/ServiceDetails.types.ts @@ -1,6 +1,6 @@ import { defineRouting } from 'next-intl/routing'; -import { Model } from '../api-harmonization/service-details.client'; +import type { Model } from '../api-harmonization/service-details.client'; export interface ServiceDetailsProps { id: string; diff --git a/packages/blocks/service-list/package.json b/packages/blocks/service-list/package.json index de862efd6..3342b5fee 100644 --- a/packages/blocks/service-list/package.json +++ b/packages/blocks/service-list/package.json @@ -16,7 +16,7 @@ "scripts": { "build": "tsc --build tsconfig.json --preserveWatchOutput && tsc-alias", "test": "vitest run", - "lint": "tsc --noEmit && eslint \"src/**/*.{ts,tsx}\" --fix", + "lint": "tsc --noEmit && eslint \"src/**/*.{ts,tsx}\" --fix --max-warnings=0", "format": "prettier --write \"src/**/*.{js,jsx,ts,tsx,css,scss,json}\"" }, "dependencies": { diff --git a/packages/blocks/service-list/src/frontend/ServiceList.server.tsx b/packages/blocks/service-list/src/frontend/ServiceList.server.tsx index 81ad7362f..739a09902 100644 --- a/packages/blocks/service-list/src/frontend/ServiceList.server.tsx +++ b/packages/blocks/service-list/src/frontend/ServiceList.server.tsx @@ -1,6 +1,7 @@ import dynamic from 'next/dynamic'; import React from 'react'; +import type { Model } from '../api-harmonization/service-list.client'; import { sdk } from '../sdk'; import { ServiceListProps } from './ServiceList.types'; @@ -10,25 +11,27 @@ export const ServiceListDynamic = dynamic(() => ); export const ServiceList: React.FC = async ({ id, accessToken, locale, routing, hasPriority }) => { + let data: Model.ServiceListBlock; try { - const data = await sdk.blocks.getServiceList( + data = await sdk.blocks.getServiceList( { id, }, { 'x-locale': locale }, accessToken, ); - return ( - - ); } catch (_error) { return null; } + + return ( + + ); }; diff --git a/packages/blocks/service-list/src/frontend/ServiceList.types.ts b/packages/blocks/service-list/src/frontend/ServiceList.types.ts index c793d19ed..0351d62fc 100644 --- a/packages/blocks/service-list/src/frontend/ServiceList.types.ts +++ b/packages/blocks/service-list/src/frontend/ServiceList.types.ts @@ -1,6 +1,6 @@ import { defineRouting } from 'next-intl/routing'; -import { Model } from '../api-harmonization/service-list.client'; +import type { Model } from '../api-harmonization/service-list.client'; export interface ServiceListProps { id: string; diff --git a/packages/blocks/surveyjs-form/package.json b/packages/blocks/surveyjs-form/package.json index 5a8ddd51a..2ecae6757 100644 --- a/packages/blocks/surveyjs-form/package.json +++ b/packages/blocks/surveyjs-form/package.json @@ -16,7 +16,7 @@ "scripts": { "build": "tsc --build tsconfig.json --preserveWatchOutput && tsc-alias", "test": "vitest run", - "lint": "tsc --noEmit && eslint \"src/**/*.{ts,tsx}\" --fix", + "lint": "tsc --noEmit && eslint \"src/**/*.{ts,tsx}\" --fix --max-warnings=0", "format": "prettier --write \"src/**/*.{js,jsx,ts,tsx,css,scss,json}\"" }, "dependencies": { diff --git a/packages/blocks/surveyjs-form/src/frontend/SurveyJs.server.tsx b/packages/blocks/surveyjs-form/src/frontend/SurveyJs.server.tsx index 0ede0b4a3..caf2ec89c 100644 --- a/packages/blocks/surveyjs-form/src/frontend/SurveyJs.server.tsx +++ b/packages/blocks/surveyjs-form/src/frontend/SurveyJs.server.tsx @@ -1,6 +1,7 @@ import dynamic from 'next/dynamic'; import React from 'react'; +import type { Model } from '../api-harmonization/surveyjs.client'; import { sdk } from '../sdk'; import { SurveyJsFormProps } from './SurveyJs.types'; @@ -14,26 +15,27 @@ export const SurveyJsServer: React.FC = async ({ routing, hasPriority, }) => { + let data: Model.SurveyjsBlock; try { - const data = await sdk.blocks.getSurveyjsBlock( + data = await sdk.blocks.getSurveyjsBlock( { id, }, { 'x-locale': locale }, accessToken, ); - - return ( - - ); } catch (_error) { return null; } + + return ( + + ); }; diff --git a/packages/blocks/surveyjs-form/src/frontend/SurveyJs.types.ts b/packages/blocks/surveyjs-form/src/frontend/SurveyJs.types.ts index 924029884..b89c9686f 100644 --- a/packages/blocks/surveyjs-form/src/frontend/SurveyJs.types.ts +++ b/packages/blocks/surveyjs-form/src/frontend/SurveyJs.types.ts @@ -1,6 +1,6 @@ import { defineRouting } from 'next-intl/routing'; -import { Model } from '../api-harmonization/surveyjs.client'; +import type { Model } from '../api-harmonization/surveyjs.client'; export interface SurveyJsFormProps { id: string; diff --git a/packages/blocks/ticket-details/package.json b/packages/blocks/ticket-details/package.json index 26b368a7f..e8de63c87 100644 --- a/packages/blocks/ticket-details/package.json +++ b/packages/blocks/ticket-details/package.json @@ -16,7 +16,7 @@ "scripts": { "build": "tsc --build tsconfig.json --preserveWatchOutput && tsc-alias", "test": "vitest run", - "lint": "tsc --noEmit && eslint \"src/**/*.{ts,tsx}\" --fix", + "lint": "tsc --noEmit && eslint \"src/**/*.{ts,tsx}\" --fix --max-warnings=0", "format": "prettier --write \"src/**/*.{js,jsx,ts,tsx,css,scss,json}\"" }, "dependencies": { diff --git a/packages/blocks/ticket-details/src/frontend/TicketDetails.server.tsx b/packages/blocks/ticket-details/src/frontend/TicketDetails.server.tsx index 13f4c1bd0..15df04c58 100644 --- a/packages/blocks/ticket-details/src/frontend/TicketDetails.server.tsx +++ b/packages/blocks/ticket-details/src/frontend/TicketDetails.server.tsx @@ -1,6 +1,7 @@ import dynamic from 'next/dynamic'; import React from 'react'; +import type { Model } from '../api-harmonization/ticket-details.client'; import { sdk } from '../sdk'; import { TicketDetailsProps } from './TicketDetails.types'; @@ -17,8 +18,9 @@ export const TicketDetails: React.FC = async ({ routing, hasPriority, }) => { + let data: Model.TicketDetailsBlock; try { - const data = await sdk.blocks.getTicketDetails( + data = await sdk.blocks.getTicketDetails( { id: ticketId, }, @@ -28,19 +30,19 @@ export const TicketDetails: React.FC = async ({ { 'x-locale': locale }, accessToken, ); - - return ( - - ); } catch (_error) { return null; } + + return ( + + ); }; diff --git a/packages/blocks/ticket-details/src/frontend/TicketDetails.types.ts b/packages/blocks/ticket-details/src/frontend/TicketDetails.types.ts index 0dbe0f611..855e73fe9 100644 --- a/packages/blocks/ticket-details/src/frontend/TicketDetails.types.ts +++ b/packages/blocks/ticket-details/src/frontend/TicketDetails.types.ts @@ -1,6 +1,6 @@ import { defineRouting } from 'next-intl/routing'; -import { Model } from '../api-harmonization/ticket-details.client'; +import type { Model } from '../api-harmonization/ticket-details.client'; export interface TicketDetailsProps { id: string; diff --git a/packages/blocks/ticket-list/package.json b/packages/blocks/ticket-list/package.json index fd74e8179..b5fb2cf6e 100644 --- a/packages/blocks/ticket-list/package.json +++ b/packages/blocks/ticket-list/package.json @@ -16,7 +16,7 @@ "scripts": { "build": "tsc --build tsconfig.json --preserveWatchOutput && tsc-alias", "test": "vitest run", - "lint": "tsc --noEmit && eslint \"src/**/*.{ts,tsx}\" --fix", + "lint": "tsc --noEmit && eslint \"src/**/*.{ts,tsx}\" --fix --max-warnings=0", "format": "prettier --write \"src/**/*.{js,jsx,ts,tsx,css,scss,json}\"" }, "dependencies": { diff --git a/packages/blocks/ticket-list/src/frontend/TicketList.server.tsx b/packages/blocks/ticket-list/src/frontend/TicketList.server.tsx index 8551ea7b0..d9057b10b 100644 --- a/packages/blocks/ticket-list/src/frontend/TicketList.server.tsx +++ b/packages/blocks/ticket-list/src/frontend/TicketList.server.tsx @@ -1,6 +1,7 @@ import dynamic from 'next/dynamic'; import React from 'react'; +import type { Model } from '../api-harmonization/ticket-list.client'; import { sdk } from '../sdk'; import { TicketListProps } from './TicketList.types'; @@ -15,7 +16,7 @@ export const TicketListServer: React.FC = async ({ hasPriority, isDraftModeEnabled, }) => { - let data; + let data: Model.TicketListBlock; try { data = await sdk.blocks.getTicketList( { diff --git a/packages/blocks/ticket-list/src/frontend/TicketList.types.ts b/packages/blocks/ticket-list/src/frontend/TicketList.types.ts index 2c6813235..5a2e9488a 100644 --- a/packages/blocks/ticket-list/src/frontend/TicketList.types.ts +++ b/packages/blocks/ticket-list/src/frontend/TicketList.types.ts @@ -1,6 +1,6 @@ import { defineRouting } from 'next-intl/routing'; -import { Model } from '../api-harmonization/ticket-list.client'; +import type { Model } from '../api-harmonization/ticket-list.client'; export interface TicketListProps { id: string; diff --git a/packages/blocks/ticket-recent/package.json b/packages/blocks/ticket-recent/package.json index 25e71de5d..b6557d07a 100644 --- a/packages/blocks/ticket-recent/package.json +++ b/packages/blocks/ticket-recent/package.json @@ -16,7 +16,7 @@ "scripts": { "build": "tsc --build tsconfig.json --preserveWatchOutput && tsc-alias", "test": "vitest run", - "lint": "tsc --noEmit && eslint \"src/**/*.{ts,tsx}\" --fix", + "lint": "tsc --noEmit && eslint \"src/**/*.{ts,tsx}\" --fix --max-warnings=0", "format": "prettier --write \"src/**/*.{js,jsx,ts,tsx,css,scss,json}\"" }, "dependencies": { diff --git a/packages/blocks/ticket-recent/src/frontend/TicketRecent.renderer.tsx b/packages/blocks/ticket-recent/src/frontend/TicketRecent.renderer.tsx index 64ba4ceab..c20dbeb31 100644 --- a/packages/blocks/ticket-recent/src/frontend/TicketRecent.renderer.tsx +++ b/packages/blocks/ticket-recent/src/frontend/TicketRecent.renderer.tsx @@ -1,7 +1,6 @@ import { useLocale } from 'next-intl'; import React, { Suspense } from 'react'; -import { Container } from '@o2s/ui/components/Container'; import { Loading } from '@o2s/ui/components/Loading'; import { TicketRecent } from './TicketRecent.server'; diff --git a/packages/blocks/ticket-recent/src/frontend/TicketRecent.server.tsx b/packages/blocks/ticket-recent/src/frontend/TicketRecent.server.tsx index 0dd1ed75b..ccf773400 100644 --- a/packages/blocks/ticket-recent/src/frontend/TicketRecent.server.tsx +++ b/packages/blocks/ticket-recent/src/frontend/TicketRecent.server.tsx @@ -1,6 +1,7 @@ import dynamic from 'next/dynamic'; import React from 'react'; +import type { Model } from '../api-harmonization/ticket-recent.client'; import { sdk } from '../sdk'; import { TicketRecentProps } from './TicketRecent.types'; @@ -10,26 +11,27 @@ export const TicketRecentDynamic = dynamic(() => ); export const TicketRecent: React.FC = async ({ id, accessToken, locale, routing, hasPriority }) => { + let data: Model.TicketRecentBlock; try { - const data = await sdk.blocks.getTicketRecent( + data = await sdk.blocks.getTicketRecent( { id, }, { 'x-locale': locale }, accessToken, ); - - return ( - - ); } catch (_error) { return null; } + + return ( + + ); }; diff --git a/packages/blocks/ticket-recent/src/frontend/TicketRecent.types.ts b/packages/blocks/ticket-recent/src/frontend/TicketRecent.types.ts index 0728e2201..70dcbe391 100644 --- a/packages/blocks/ticket-recent/src/frontend/TicketRecent.types.ts +++ b/packages/blocks/ticket-recent/src/frontend/TicketRecent.types.ts @@ -1,6 +1,6 @@ import { defineRouting } from 'next-intl/routing'; -import { Model } from '../api-harmonization/ticket-recent.client'; +import type { Model } from '../api-harmonization/ticket-recent.client'; export interface TicketRecentProps { id: string; diff --git a/packages/blocks/ticket-summary/package.json b/packages/blocks/ticket-summary/package.json index 2d2b6bf62..291fa36ab 100644 --- a/packages/blocks/ticket-summary/package.json +++ b/packages/blocks/ticket-summary/package.json @@ -16,7 +16,7 @@ "scripts": { "build": "tsc --build tsconfig.json --preserveWatchOutput && tsc-alias", "test": "vitest run", - "lint": "tsc --noEmit && eslint \"src/**/*.{ts,tsx}\" --fix", + "lint": "tsc --noEmit && eslint \"src/**/*.{ts,tsx}\" --fix --max-warnings=0", "format": "prettier --write \"src/**/*.{js,jsx,ts,tsx,css,scss,json}\"" }, "dependencies": { diff --git a/packages/blocks/ticket-summary/src/frontend/TicketSummary.server.tsx b/packages/blocks/ticket-summary/src/frontend/TicketSummary.server.tsx index 4b7f3c251..0e9745f4c 100644 --- a/packages/blocks/ticket-summary/src/frontend/TicketSummary.server.tsx +++ b/packages/blocks/ticket-summary/src/frontend/TicketSummary.server.tsx @@ -1,6 +1,7 @@ import dynamic from 'next/dynamic'; import React from 'react'; +import type { Model } from '../api-harmonization/ticket-summary.client'; import { sdk } from '../sdk'; import { TicketSummaryProps } from './TicketSummary.types'; @@ -10,18 +11,19 @@ export const TicketSummaryDynamic = dynamic(() => ); export const TicketSummary: React.FC = async ({ id, accessToken, locale, routing }) => { + let data: Model.TicketSummaryBlock; try { - const data = await sdk.blocks.getTicketSummary( + data = await sdk.blocks.getTicketSummary( { id, }, { 'x-locale': locale }, accessToken, ); - - return ; } catch (error) { console.error('Error fetching TicketSummary block', error); return null; } + + return ; }; diff --git a/packages/blocks/ticket-summary/src/frontend/TicketSummary.types.ts b/packages/blocks/ticket-summary/src/frontend/TicketSummary.types.ts index aa8b7dd90..14a541331 100644 --- a/packages/blocks/ticket-summary/src/frontend/TicketSummary.types.ts +++ b/packages/blocks/ticket-summary/src/frontend/TicketSummary.types.ts @@ -1,6 +1,6 @@ import { defineRouting } from 'next-intl/routing'; -import { Model } from '../api-harmonization/ticket-summary.client'; +import type { Model } from '../api-harmonization/ticket-summary.client'; export interface TicketSummaryProps { id: string; diff --git a/packages/blocks/user-account/package.json b/packages/blocks/user-account/package.json index d160a4008..75c2e5428 100644 --- a/packages/blocks/user-account/package.json +++ b/packages/blocks/user-account/package.json @@ -16,7 +16,7 @@ "scripts": { "build": "tsc --build tsconfig.json --preserveWatchOutput && tsc-alias", "test": "vitest run", - "lint": "tsc --noEmit && eslint \"src/**/*.{ts,tsx}\" --fix", + "lint": "tsc --noEmit && eslint \"src/**/*.{ts,tsx}\" --fix --max-warnings=0", "format": "prettier --write \"src/**/*.{js,jsx,ts,tsx,css,scss,json}\"" }, "dependencies": { diff --git a/packages/blocks/user-account/src/frontend/UserAccount.server.tsx b/packages/blocks/user-account/src/frontend/UserAccount.server.tsx index 6ac0e31e1..6352bdaed 100644 --- a/packages/blocks/user-account/src/frontend/UserAccount.server.tsx +++ b/packages/blocks/user-account/src/frontend/UserAccount.server.tsx @@ -1,6 +1,7 @@ import dynamic from 'next/dynamic'; import React from 'react'; +import type { Model } from '../api-harmonization/user-account.client'; import { sdk } from '../sdk'; import { UserAccountProps } from './UserAccount.types'; @@ -22,8 +23,9 @@ export const UserAccount: React.FC = async ({ return null; } + let data: Model.UserAccountBlock; try { - const data = await sdk.blocks.getUserAccount( + data = await sdk.blocks.getUserAccount( { id, userId, @@ -31,20 +33,20 @@ export const UserAccount: React.FC = async ({ { 'x-locale': locale }, accessToken, ); - - return ( - - ); } catch (_error) { return null; } + + return ( + + ); }; diff --git a/packages/blocks/user-account/src/frontend/UserAccount.types.ts b/packages/blocks/user-account/src/frontend/UserAccount.types.ts index 1f4a01ca9..fea560b85 100644 --- a/packages/blocks/user-account/src/frontend/UserAccount.types.ts +++ b/packages/blocks/user-account/src/frontend/UserAccount.types.ts @@ -1,6 +1,6 @@ import { defineRouting } from 'next-intl/routing'; -import { Model } from '../api-harmonization/user-account.client'; +import type { Model } from '../api-harmonization/user-account.client'; export interface UserAccountProps { id: string; diff --git a/packages/configs/integrations/package.json b/packages/configs/integrations/package.json index 3bf9270d4..94b24b182 100644 --- a/packages/configs/integrations/package.json +++ b/packages/configs/integrations/package.json @@ -12,7 +12,7 @@ ], "scripts": { "build": "tsc --preserveWatchOutput && tsc-alias", - "lint": "tsc --noEmit && eslint \"src/**/*.{ts,tsx}\" --fix", + "lint": "tsc --noEmit && eslint \"src/**/*.{ts,tsx}\" --fix --max-warnings=0", "format": "prettier --write \"src/**/*.{js,jsx,ts,tsx,css,scss,json}\"" }, "dependencies": { @@ -30,4 +30,4 @@ "tsc-alias": "^1.8.16", "typescript": "^5.9.3" } -} \ No newline at end of file +} diff --git a/packages/modules/surveyjs/eslint.config.mjs b/packages/modules/surveyjs/eslint.config.mjs index 223f2af08..d01b23ed3 100644 --- a/packages/modules/surveyjs/eslint.config.mjs +++ b/packages/modules/surveyjs/eslint.config.mjs @@ -1,18 +1,18 @@ -import { config as apiConfig } from '@o2s/eslint-config/api'; -import { config as frontendConfig } from '@o2s/eslint-config/frontend-block'; -import { defineConfig } from 'eslint/config'; +import { config as apiConfig } from "@o2s/eslint-config/api"; +import { config as frontendConfig } from "@o2s/eslint-config/frontend-block"; +import { defineConfig } from "eslint/config"; export default defineConfig([ { - files: ['src/api-harmonization/**/*'], + files: ["src/api-harmonization/**/*"], extends: [apiConfig], }, { - files: ['src/frontend/**/*'], + files: ["src/frontend/**/*"], extends: [frontendConfig], }, { - files: ['src/sdk/**/*'], + files: ["src/sdk/**/*"], extends: [frontendConfig], }, ]); diff --git a/packages/modules/surveyjs/package.json b/packages/modules/surveyjs/package.json index c7e0455ef..49d0d3870 100644 --- a/packages/modules/surveyjs/package.json +++ b/packages/modules/surveyjs/package.json @@ -15,7 +15,7 @@ ], "scripts": { "build": "tsc --build tsconfig.json --preserveWatchOutput && tsc-alias", - "lint": "tsc --noEmit && eslint \"src/**/*.{ts,tsx}\" --fix", + "lint": "tsc --noEmit && eslint \"src/**/*.{ts,tsx}\" --fix --max-warnings=0", "format": "prettier --write \"src/**/*.{js,jsx,ts,tsx,css,scss,json}\"" }, "dependencies": { diff --git a/packages/modules/surveyjs/src/frontend/Questions/CustomSurveyQuestionText.tsx b/packages/modules/surveyjs/src/frontend/Questions/CustomSurveyQuestionText.tsx index 34879b76d..6c645bf67 100644 --- a/packages/modules/surveyjs/src/frontend/Questions/CustomSurveyQuestionText.tsx +++ b/packages/modules/surveyjs/src/frontend/Questions/CustomSurveyQuestionText.tsx @@ -90,6 +90,7 @@ const CustomSurveyQuestionText: React.FC = (props initialFocus id={question.inputId} onSelect={(value) => { + // eslint-disable-next-line react-hooks/immutability question.value = value?.toISOString() || null; setOpen(false); }} @@ -110,6 +111,7 @@ const CustomSurveyQuestionText: React.FC = (props placeholder={question.placeholder} disabled={question.isDisplayMode} onChange={(event) => { + // eslint-disable-next-line react-hooks/immutability question.value = event.target.value; }} aria-invalid={!!question.errors?.length} diff --git a/packages/utils/api-harmonization/package.json b/packages/utils/api-harmonization/package.json index 0fd3dea68..6897bd590 100644 --- a/packages/utils/api-harmonization/package.json +++ b/packages/utils/api-harmonization/package.json @@ -13,7 +13,7 @@ ], "scripts": { "build": "tsc --preserveWatchOutput && tsc-alias", - "lint": "tsc --noEmit && eslint \"src/**/*.{ts,tsx}\" --fix", + "lint": "tsc --noEmit && eslint \"src/**/*.{ts,tsx}\" --fix --max-warnings=0", "format": "prettier --write \"src/**/*.{ts,tsx}\"" }, "dependencies": { diff --git a/packages/utils/frontend/package.json b/packages/utils/frontend/package.json index 4d42efa92..af103dd2d 100644 --- a/packages/utils/frontend/package.json +++ b/packages/utils/frontend/package.json @@ -13,7 +13,7 @@ ], "scripts": { "build": "tsc --preserveWatchOutput && tsc-alias", - "lint": "tsc --noEmit && eslint \"src/**/*.{ts,tsx}\" --fix", + "lint": "tsc --noEmit && eslint \"src/**/*.{ts,tsx}\" --fix --max-warnings=0", "format": "prettier --write \"src/**/*.{ts,tsx}\"" }, "dependencies": { diff --git a/turbo/generators/templates/block/frontend/server.hbs b/turbo/generators/templates/block/frontend/server.hbs index 329d1b8cf..fa673e7de 100644 --- a/turbo/generators/templates/block/frontend/server.hbs +++ b/turbo/generators/templates/block/frontend/server.hbs @@ -1,28 +1,29 @@ import dynamic from 'next/dynamic'; import React from 'react'; +import type { Model } from '../api-harmonization/{{ kebabCase name }}.client'; import { sdk } from '../sdk'; import { {{ pascalCase name }}Props } from './{{ pascalCase name }}.types'; - export const {{ pascalCase name }}Dynamic = dynamic(() => import('./{{ pascalCase name }}.client').then((module) => module.{{ pascalCase name }}Pure), ); export const {{ pascalCase name }}: React.FC<{{ pascalCase name }}Props> = async ({ id, accessToken, locale, routing }) => { + let data: Model.{{ pascalCase name }}Block; try { - const data = await sdk.blocks.get{{ pascalCase name }}( + data = await sdk.blocks.get{{ pascalCase name }}( { id, }, { 'x-locale': locale }, accessToken, ); - - return <{{ pascalCase name }}Dynamic {...data} id={id} accessToken={accessToken} locale={locale} routing={routing} />; } catch (error) { console.error('Error fetching {{ pascalCase name }} block', error); return null; } + + return <{{ pascalCase name }}Dynamic {...data} id={id} accessToken={accessToken} locale={locale} routing={routing} />; }; diff --git a/turbo/generators/templates/block/frontend/types.hbs b/turbo/generators/templates/block/frontend/types.hbs index 7d94e148a..4da805baa 100644 --- a/turbo/generators/templates/block/frontend/types.hbs +++ b/turbo/generators/templates/block/frontend/types.hbs @@ -1,6 +1,6 @@ import { defineRouting } from 'next-intl/routing'; -import { Model } from '../api-harmonization/{{kebabCase name}}.client'; +import type { Model } from '../api-harmonization/{{kebabCase name}}.client'; export interface {{pascalCase name}}Props { id: string;