From 89da7159a1039df2562f67a92ab1042e7b3315fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Rialland?= Date: Tue, 31 Jan 2023 18:52:10 +0100 Subject: [PATCH] Fix prettier --- site/source/components/PaySlip.tsx | 2 +- site/source/pages/Budget/Budget.tsx | 4 ++-- .../pages/Simulateurs/EconomieCollaborative/activitésData.ts | 2 +- .../pages/Simulateurs/ExonerationCovid/ExonérationCovid.tsx | 2 +- site/source/sitePaths.ts | 4 ++-- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/site/source/components/PaySlip.tsx b/site/source/components/PaySlip.tsx index a0fcc4b17..3a84d492c 100644 --- a/site/source/components/PaySlip.tsx +++ b/site/source/components/PaySlip.tsx @@ -34,7 +34,7 @@ export const SECTION_ORDER = [ 'protection sociale . autres', ] as Array -type Section = typeof SECTION_ORDER[number] +type Section = (typeof SECTION_ORDER)[number] function getSection(rule: RuleNode): Section { const section = `protection sociale . ${ diff --git a/site/source/pages/Budget/Budget.tsx b/site/source/pages/Budget/Budget.tsx index a747b9888..26740508c 100644 --- a/site/source/pages/Budget/Budget.tsx +++ b/site/source/pages/Budget/Budget.tsx @@ -45,7 +45,7 @@ export default function Budget() { { label: 'T3', 'aria-label': 'Trimestre 3' }, { label: 'T4', 'aria-label': 'Trimestre 4' }, ] - const [selectedYear, setSelectedYear] = useState( + const [selectedYear, setSelectedYear] = useState<(typeof years)[number]>( years[years.length - 1] ) const categories = [ @@ -78,7 +78,7 @@ export default function Budget() { label={'Année'} defaultSelectedKey={selectedYear} onSelectionChange={(year) => { - setSelectedYear(year as typeof years[number]) + setSelectedYear(year as (typeof years)[number]) }} > {years diff --git a/site/source/pages/Simulateurs/EconomieCollaborative/activitésData.ts b/site/source/pages/Simulateurs/EconomieCollaborative/activitésData.ts index 5804fc3df..cc5b7054a 100644 --- a/site/source/pages/Simulateurs/EconomieCollaborative/activitésData.ts +++ b/site/source/pages/Simulateurs/EconomieCollaborative/activitésData.ts @@ -5,7 +5,7 @@ import activités from './activités.yaml' export { activités } -export type Activitée = typeof activités[number] +export type Activitée = (typeof activités)[number] type ActivitésEn = typeof activitésEn export const flatActivités = activités.flatMap((el) => [ diff --git a/site/source/pages/Simulateurs/ExonerationCovid/ExonérationCovid.tsx b/site/source/pages/Simulateurs/ExonerationCovid/ExonérationCovid.tsx index 5fbb0de36..10cd4a61e 100644 --- a/site/source/pages/Simulateurs/ExonerationCovid/ExonérationCovid.tsx +++ b/site/source/pages/Simulateurs/ExonerationCovid/ExonérationCovid.tsx @@ -33,7 +33,7 @@ export const ExonérationCovid = () => { const location = useLocation() const [searchParams] = useSearchParams() const params = Object.fromEntries(searchParams.entries()) as { - [key in typeof rootDottedNames[number]]?: string + [key in (typeof rootDottedNames)[number]]?: string } const { t } = useTranslation() diff --git a/site/source/sitePaths.ts b/site/source/sitePaths.ts index 085353376..2ad3ff817 100644 --- a/site/source/sitePaths.ts +++ b/site/source/sitePaths.ts @@ -243,9 +243,9 @@ export const relativeSitePaths = encodedRelativeSitePaths export const absoluteSitePaths = encodedAbsoluteSitePaths export type RelativeSitePaths = - typeof relativeSitePaths[keyof typeof relativeSitePaths] + (typeof relativeSitePaths)[keyof typeof relativeSitePaths] export type AbsoluteSitePaths = - typeof absoluteSitePaths[keyof typeof absoluteSitePaths] + (typeof absoluteSitePaths)[keyof typeof absoluteSitePaths] export const useSitePaths = (lang?: T) => { const { language } = useTranslation().i18n