diff --git a/apps/infoalloggi/biome.json b/apps/infoalloggi/biome.json index a95b5f5..8758565 100644 --- a/apps/infoalloggi/biome.json +++ b/apps/infoalloggi/biome.json @@ -1,5 +1,5 @@ { - "$schema": "https://biomejs.dev/schemas/2.2.2/schema.json", + "$schema": "https://biomejs.dev/schemas/2.3.1/schema.json", "assist": { "actions": { "source": { @@ -11,19 +11,6 @@ }, "files": { - "experimentalScannerIgnores": [ - "node_modules", - "dist", - "build", - ".next", - ".git", - "public", - ".github", - ".vscode", - "certificates", - "headers", - "schemas" - ], "ignoreUnknown": true, "includes": [ "**", @@ -52,7 +39,18 @@ "!src/i18n/comuni.ts", "!src/i18n/nazioni.ts", "!src/i18n/provincie.ts", - "!src/styles/globals.css" + "!src/styles/globals.css", + "!!**/node_modules", + "!!**/dist", + "!!**/build", + "!!**/.next", + "!!**/.git", + "!!**/public", + "!!**/.github", + "!!**/.vscode", + "!!**/certificates", + "!!**/headers", + "!!**/schemas" ] }, "formatter": { @@ -64,6 +62,11 @@ "quoteStyle": "double" } }, + "css": { + "parser": { + "tailwindDirectives": true + } + }, "linter": { "domains": { "next": "recommended", @@ -85,7 +88,9 @@ "noUndeclaredVariables": "on", "useExhaustiveDependencies": "off", "useHookAtTopLevel": "off", - "useParseIntRadix": "off" + "useParseIntRadix": "off", + "noChildrenProp": "error", + "noReactPropAssignments": "error" }, "nursery": { "useExhaustiveSwitchCases": "on", @@ -111,7 +116,7 @@ "useThrowOnlyError": "on" }, "suspicious": { - "noArrayIndexKey": "off", + "noArrayIndexKey": "info", "noDocumentImportInPage": "on", "noHeadImportInDocument": "on", "noUnknownAtRules": "off", diff --git a/apps/infoalloggi/emails/onboarding-servizio.tsx b/apps/infoalloggi/emails/onboarding-servizio.tsx index 83ff622..c7c2378 100644 --- a/apps/infoalloggi/emails/onboarding-servizio.tsx +++ b/apps/infoalloggi/emails/onboarding-servizio.tsx @@ -54,12 +54,12 @@ const OnboardingServizio = ({
- {annunci?.map((annuncio, index) => ( + {annunci?.map((annuncio) => ( <> Annunci selezionati per te: -
+
{`Annuncio - {allAnnunci.map((ann, i) => ( -
  • {ann.codice}
  • + {allAnnunci.map((ann) => ( +
  • {ann.codice}
  • ))} ); diff --git a/apps/infoalloggi/src/components/accordionComp.tsx b/apps/infoalloggi/src/components/accordionComp.tsx index 7bb809f..da021a0 100644 --- a/apps/infoalloggi/src/components/accordionComp.tsx +++ b/apps/infoalloggi/src/components/accordionComp.tsx @@ -40,6 +40,7 @@ export const AccordionComp = forwardRef( > {texts.map((text, index) => ( + // biome-ignore lint/suspicious/noArrayIndexKey: {text.title} diff --git a/apps/infoalloggi/src/components/acquisto_receipt.tsx b/apps/infoalloggi/src/components/acquisto_receipt.tsx index 5e2d701..aad2c03 100644 --- a/apps/infoalloggi/src/components/acquisto_receipt.tsx +++ b/apps/infoalloggi/src/components/acquisto_receipt.tsx @@ -130,8 +130,8 @@ function Receipt({ data }: ReceiptProps) { - {data.items.map((item, idx) => ( - + {data.items.map((item) => ( + {item.description} {formatCurrency(item.price)} diff --git a/apps/infoalloggi/src/components/annuncio_card.tsx b/apps/infoalloggi/src/components/annuncio_card.tsx index 056e930..55d454a 100644 --- a/apps/infoalloggi/src/components/annuncio_card.tsx +++ b/apps/infoalloggi/src/components/annuncio_card.tsx @@ -89,7 +89,7 @@ export const CardAnnuncio = ({ {images?.map((img, idx) => ( - + ))} - {videos?.map((video, idx) => { + {videos?.map((video) => { if (!video) return null; if (video.includes("youtu")) { return null; @@ -123,7 +123,7 @@ export const CardAnnuncio = ({ ? `/storage-api/get/${images[0].img}?image=true` : "" } - key={`videoplayer-${idx}`} + key={`videoplayer-${video}`} videoSrc={video} /> @@ -268,7 +268,7 @@ export const CarouselAnnuncio = ({ ? "" : !single && "md:basis-1/2 lg:basis-1/3", )} - key={`${img}-${idx}-cF`} + key={`${img}-cF`} > {immagini?.map((img, idx) => ( - + {`carousel-img-${idx}`} { {data.map((email, index) => ( diff --git a/apps/infoalloggi/src/components/chat/chat-list.tsx b/apps/infoalloggi/src/components/chat/chat-list.tsx index 6af9be4..254469f 100644 --- a/apps/infoalloggi/src/components/chat/chat-list.tsx +++ b/apps/infoalloggi/src/components/chat/chat-list.tsx @@ -309,7 +309,7 @@ const Typers = ({ }) => { return ( <> - {currentTypers.map((typer, index) => { + {currentTypers.map((typer) => { if (typer.userId === userId) return null; const variant = "received"; @@ -319,7 +319,7 @@ const Typers = ({ className="flex flex-col gap-2 py-2" exit={{ opacity: 0, scale: 1, x: 0, y: 1 }} initial={{ opacity: 0, scale: 1, x: 0, y: 50 }} - key={`typers${messageLenght}${index}`} + key={`typers${messageLenght}${typer.userId}`} layout style={{ originX: 0.5, originY: 0.5 }} transition={{ diff --git a/apps/infoalloggi/src/components/chat/chat-topbar.tsx b/apps/infoalloggi/src/components/chat/chat-topbar.tsx index d6f8aea..b9853e2 100644 --- a/apps/infoalloggi/src/components/chat/chat-topbar.tsx +++ b/apps/infoalloggi/src/components/chat/chat-topbar.tsx @@ -137,7 +137,7 @@ const UserStatus = ({
    {onlineStatus.map((user, idx) => user.isAdmin ? ( - + {user.nome} diff --git a/apps/infoalloggi/src/components/come_funziona.tsx b/apps/infoalloggi/src/components/come_funziona.tsx index f5c263e..77d2bf0 100644 --- a/apps/infoalloggi/src/components/come_funziona.tsx +++ b/apps/infoalloggi/src/components/come_funziona.tsx @@ -43,14 +43,14 @@ export const ComeFunziona = () => { {t.come_funziona.title}
    - {features.map((feature, idx) => ( + {features.map((feature) => (
    {`img${idx}`} key={index} type={sparklesIcon} /> diff --git a/apps/infoalloggi/src/components/custom_ui/staggered-fade.tsx b/apps/infoalloggi/src/components/custom_ui/staggered-fade.tsx index c4954ae..ae9ebce 100644 --- a/apps/infoalloggi/src/components/custom_ui/staggered-fade.tsx +++ b/apps/infoalloggi/src/components/custom_ui/staggered-fade.tsx @@ -55,7 +55,14 @@ export const StaggeredFade: React.FC = ({ viewport={{ once: true }} > {letters.map((word, i) => ( - + + i + }`} + variants={variants} + > {word} ))} diff --git a/apps/infoalloggi/src/components/etichette.tsx b/apps/infoalloggi/src/components/etichette.tsx index 44e8015..6be7bcd 100644 --- a/apps/infoalloggi/src/components/etichette.tsx +++ b/apps/infoalloggi/src/components/etichette.tsx @@ -101,8 +101,11 @@ export const EtichetteModal = ({
    - {data.map((etichetta, idx) => ( -
    + {data.map((etichetta) => ( +
    - {etichette?.map((etichetta, idx) => ( - + {etichette?.map((etichetta) => ( + {etichetta.title} ))} diff --git a/apps/infoalloggi/src/components/map/Map.tsx b/apps/infoalloggi/src/components/map/Map.tsx index baa0ef4..5709264 100644 --- a/apps/infoalloggi/src/components/map/Map.tsx +++ b/apps/infoalloggi/src/components/map/Map.tsx @@ -188,6 +188,7 @@ const MapComp = ({ /> {isGroup ? ( + // biome-ignore lint/suspicious/noArrayIndexKey: groupData.map((pos, i) => ) ) : ( diff --git a/apps/infoalloggi/src/components/navbar/login-button.tsx b/apps/infoalloggi/src/components/navbar/login-button.tsx index 2a7a174..033bcf8 100644 --- a/apps/infoalloggi/src/components/navbar/login-button.tsx +++ b/apps/infoalloggi/src/components/navbar/login-button.tsx @@ -178,8 +178,8 @@ const Items = ({ }) => { return ( - {items?.map((item, idx) => ( - + {items?.map((item) => ( + { ClearCarousel(); setValue(idx); @@ -294,7 +294,7 @@ export const PricingComponentConsulenza = ({ "h-9 xs:h-10 rounded-md border-none px-3 xs:px-4 xs:py-2", idx === Value ? "fade-in-0 animate-in" : "", )} - key={idx} + key={opzione} onClick={() => { ClearCarousel(); setValue(idx); diff --git a/apps/infoalloggi/src/components/schedaAnnuncioStampabile.tsx b/apps/infoalloggi/src/components/schedaAnnuncioStampabile.tsx index fab20c5..82b023d 100644 --- a/apps/infoalloggi/src/components/schedaAnnuncioStampabile.tsx +++ b/apps/infoalloggi/src/components/schedaAnnuncioStampabile.tsx @@ -209,24 +209,22 @@ function SchedaAnnuncio({ data }: { data: Annunci }) {
    {data.caratteristiche && - filteredCaratteristiche(data.caratteristiche).map( - (item, index) => { - if (!item.value) return null; - return ( -
    - - - - - {item.text}: {item.value} - -
    - ); - }, - )} + filteredCaratteristiche(data.caratteristiche).map((item) => { + if (!item.value) return null; + return ( +
    + + + + + {item.text}: {item.value} + +
    + ); + })}
    diff --git a/apps/infoalloggi/src/components/tables/ricerca-table.tsx b/apps/infoalloggi/src/components/tables/ricerca-table.tsx index bdc23e8..2567c47 100644 --- a/apps/infoalloggi/src/components/tables/ricerca-table.tsx +++ b/apps/infoalloggi/src/components/tables/ricerca-table.tsx @@ -47,7 +47,7 @@ export const TabRicerca = ({ diff --git a/apps/infoalloggi/src/components/tables/servizio-table.tsx b/apps/infoalloggi/src/components/tables/servizio-table.tsx index 5cdf795..df1d826 100644 --- a/apps/infoalloggi/src/components/tables/servizio-table.tsx +++ b/apps/infoalloggi/src/components/tables/servizio-table.tsx @@ -105,13 +105,13 @@ export const TabServizio = ({ - {data.map((servizio, idx) => { + {data.map((servizio) => { const onboardDone = servizio.isInterrotto || servizio.isOkAcconto || servizio.decorrenza !== null; return ( - + {servizio.servizio_id} diff --git a/apps/infoalloggi/src/components/ui/calendar.tsx b/apps/infoalloggi/src/components/ui/calendar.tsx index 89ce131..80a0db3 100644 --- a/apps/infoalloggi/src/components/ui/calendar.tsx +++ b/apps/infoalloggi/src/components/ui/calendar.tsx @@ -501,6 +501,7 @@ function YearGrid({ "bg-accent font-medium text-accent-foreground", )} disabled={navView === "years" ? isDisabled : undefined} + // biome-ignore lint/suspicious/noArrayIndexKey: key={i} onClick={() => { setNavView("days"); diff --git a/apps/infoalloggi/src/components/ui/slider.tsx b/apps/infoalloggi/src/components/ui/slider.tsx index c337ea5..4408b24 100644 --- a/apps/infoalloggi/src/components/ui/slider.tsx +++ b/apps/infoalloggi/src/components/ui/slider.tsx @@ -58,6 +58,7 @@ function Slider({ thumbClassName, )} data-slot="slider-thumb" + // biome-ignore lint/suspicious/noArrayIndexKey: key={index} /> ))} diff --git a/apps/infoalloggi/src/components/upload_modal.tsx b/apps/infoalloggi/src/components/upload_modal.tsx index 6ff67e3..97e4062 100644 --- a/apps/infoalloggi/src/components/upload_modal.tsx +++ b/apps/infoalloggi/src/components/upload_modal.tsx @@ -248,8 +248,8 @@ export const UploadComponent = ({ - {files.map((file, index) => ( - + {files.map((file) => ( + diff --git a/apps/infoalloggi/src/forms/FormNewServizio.tsx b/apps/infoalloggi/src/forms/FormNewServizio.tsx index 5c83e62..cba4954 100644 --- a/apps/infoalloggi/src/forms/FormNewServizio.tsx +++ b/apps/infoalloggi/src/forms/FormNewServizio.tsx @@ -479,12 +479,12 @@ export const FormNewServizio = ({ {t.preferenze.altrepref_desc}
    - {altrePrefMapping.map((pair, index) => { + {altrePrefMapping.map((pair) => { if (pair) { return ( ( diff --git a/apps/infoalloggi/src/forms/FormNewServizioAcquisto.tsx b/apps/infoalloggi/src/forms/FormNewServizioAcquisto.tsx index 956ed18..e08011d 100644 --- a/apps/infoalloggi/src/forms/FormNewServizioAcquisto.tsx +++ b/apps/infoalloggi/src/forms/FormNewServizioAcquisto.tsx @@ -776,12 +776,12 @@ export const FormNewServizioAcquisto = ({ {t.preferenze.altrepref_desc}
    - {altrePrefMapping.map((pair, index) => { + {altrePrefMapping.map((pair) => { if (pair) { return ( ( diff --git a/apps/infoalloggi/src/pages/area-riservata/admin/user-view/edit-user/[userId].tsx b/apps/infoalloggi/src/pages/area-riservata/admin/user-view/edit-user/[userId].tsx index beb9a09..bdcc2a1 100644 --- a/apps/infoalloggi/src/pages/area-riservata/admin/user-view/edit-user/[userId].tsx +++ b/apps/infoalloggi/src/pages/area-riservata/admin/user-view/edit-user/[userId].tsx @@ -267,8 +267,8 @@ const FatturazioneData = ({ cf }: { cf: string }) => { return ( <> {data.data && data.data.length > 0 ? ( - data.data.map((client, idx) => ( -
    + data.data.map((client, i) => ( +

    Dati Fatturazione

    Nome: {client.name}

    Codice Fiscale: {client.tax_code}

    diff --git a/apps/infoalloggi/src/pages/guida.tsx b/apps/infoalloggi/src/pages/guida.tsx index bea14c9..3e23689 100644 --- a/apps/infoalloggi/src/pages/guida.tsx +++ b/apps/infoalloggi/src/pages/guida.tsx @@ -62,10 +62,10 @@ const FAQSection = () => {
    - {t.faq.domande.map((item, index) => ( + {t.faq.domande.map((item) => (
    - {t.faq.domande.map((item, index) => ( + {t.faq.domande.map((item) => ( @@ -86,7 +86,7 @@ const FAQSection = () => {

    {item.label}

    {item.qas.map((f, i) => ( - + {f.title} diff --git a/apps/infoalloggi/src/pages/prezzi.tsx b/apps/infoalloggi/src/pages/prezzi.tsx index a4e3fd1..5bbcc75 100644 --- a/apps/infoalloggi/src/pages/prezzi.tsx +++ b/apps/infoalloggi/src/pages/prezzi.tsx @@ -74,8 +74,8 @@ const Prezzi: NextPage = () => {

    {t.prezzi.desc_transitori}

      - {t.prezzi.cta_transitori.map((item, idx) => ( -
    • + {t.prezzi.cta_transitori.map((item) => ( +
    • @@ -119,8 +119,8 @@ const Prezzi: NextPage = () => {

      {t.prezzi.desc_stabile}

        - {t.prezzi.cta_stabile.map((item, idx) => ( -
      • + {t.prezzi.cta_stabile.map((item) => ( +
      • @@ -166,8 +166,8 @@ const Prezzi: NextPage = () => {

        {t.prezzi.desc_contratti}

          - {t.prezzi.cta_contratti.map((item, idx) => ( -
        • + {t.prezzi.cta_contratti.map((item) => ( +