diff --git a/.prettierrc b/.prettierrc index 4ff30ba2c..cf0520a18 100644 --- a/.prettierrc +++ b/.prettierrc @@ -12,5 +12,5 @@ "^\\.(.*)" ], "importOrderParserPlugins": ["typescript", "jsx", "importAssertions"], - "importOrderTypeScriptVersion": "^4.5.0" + "importOrderTypeScriptVersion": "5.0.0" } diff --git a/api/source/sentry.ts b/api/source/sentry.ts index 84dacc840..3ca66c757 100644 --- a/api/source/sentry.ts +++ b/api/source/sentry.ts @@ -1,8 +1,9 @@ +// eslint-disable-next-line n/no-deprecated-api +import Domains from 'domain' + import { RouterContext } from '@koa/router' import * as Sentry from '@sentry/node' import * as Tracing from '@sentry/tracing' -// eslint-disable-next-line n/no-deprecated-api -import Domains from 'domain' import { Context, Next } from 'koa' const release = diff --git a/scripts/build-rules.js b/scripts/build-rules.js index b6e192323..9db852ebf 100644 --- a/scripts/build-rules.js +++ b/scripts/build-rules.js @@ -1,7 +1,8 @@ /* eslint-env node */ import fs from 'fs' -import yaml from 'js-yaml' import path from 'path' + +import yaml from 'js-yaml' import Engine from 'publicodes' const publicodesDir = './règles' diff --git a/scripts/check-links-validity.js b/scripts/check-links-validity.js index 0f4291a29..2965a43c6 100644 --- a/scripts/check-links-validity.js +++ b/scripts/check-links-validity.js @@ -1,8 +1,9 @@ /* eslint-disable no-console */ import { exec } from 'child_process' -import dotenv from 'dotenv' import { promisify } from 'util' +import dotenv from 'dotenv' + dotenv.config() // Extrait la liste des liens référencés dans la base de code diff --git a/server/source/jobs.ts b/server/source/jobs.ts index b3da74c74..b3f457e68 100644 --- a/server/source/jobs.ts +++ b/server/source/jobs.ts @@ -1,8 +1,9 @@ -import later from '@breejs/later' -import Bree, { BreeOptions } from 'bree' import { dirname, join } from 'node:path' import { fileURLToPath } from 'node:url' +import later from '@breejs/later' +import Bree, { BreeOptions } from 'bree' + import { NODE_ENV } from './config.js' const __dirname = dirname(fileURLToPath(import.meta.url)) diff --git a/server/source/server.ts b/server/source/server.ts index 7ae592c06..11266dc6d 100644 --- a/server/source/server.ts +++ b/server/source/server.ts @@ -4,9 +4,9 @@ import Koa from 'koa' import { koaBody } from 'koa-body' import { - PORT, clientId, clientSecret, + PORT, redirectUri, serverUrl, } from './config.js' diff --git a/site/prerender.ts b/site/prerender.ts index 6d6a725a1..7c2bd31be 100644 --- a/site/prerender.ts +++ b/site/prerender.ts @@ -1,6 +1,7 @@ import { readFileSync, statSync, writeFileSync } from 'node:fs' import { resolve } from 'node:path' import { argv } from 'node:process' + import Tinypool from 'tinypool' import { absoluteSitePaths } from './source/sitePaths.js' diff --git a/site/scripts/NAFAndGuichetData/NAF-search/merge-data.ts b/site/scripts/NAFAndGuichetData/NAF-search/merge-data.ts index 0933f0b9f..a27e393d3 100644 --- a/site/scripts/NAFAndGuichetData/NAF-search/merge-data.ts +++ b/site/scripts/NAFAndGuichetData/NAF-search/merge-data.ts @@ -2,11 +2,11 @@ import { writeFileSync } from 'fs' import { join } from 'path' import { fileURLToPath } from 'url' -import rawApeTags from '../NomenclatureGuichet/ape_tags.json' assert { type: 'json' } import { Data as RawApeData } from '../extract-NAF-data/convert-pdf.js' import rawApeData from '../extract-NAF-data/output.json' assert { type: 'json' } import { Out as NbEtablissementsData } from '../nombre-etablissements-par-code-ape/fetch-json.js' import rawEtablissementsData from '../nombre-etablissements-par-code-ape/output.json' assert { type: 'json' } +import rawApeTags from '../NomenclatureGuichet/ape_tags.json' assert { type: 'json' } import { customTags } from './custom-tags.js' import { multipleCf } from './custom.js' diff --git a/site/scripts/NAFAndGuichetData/NomenclatureGuichet/extract.ts b/site/scripts/NAFAndGuichetData/NomenclatureGuichet/extract.ts index 04e9cc1ea..fdbf1d66a 100644 --- a/site/scripts/NAFAndGuichetData/NomenclatureGuichet/extract.ts +++ b/site/scripts/NAFAndGuichetData/NomenclatureGuichet/extract.ts @@ -1,8 +1,9 @@ -import parseCsv from 'csv-parser' import fs from 'fs' import { join } from 'path' import { fileURLToPath } from 'url' +import parseCsv from 'csv-parser' + import output from '../nombre-etablissements-par-code-ape/output.json' assert { type: 'json' } import { computeGuichet } from './compute-guichet.js' diff --git a/site/scripts/NAFAndGuichetData/extract-NAF-data/convert-pdf.ts b/site/scripts/NAFAndGuichetData/extract-NAF-data/convert-pdf.ts index bfbffdf01..f11a210d7 100644 --- a/site/scripts/NAFAndGuichetData/extract-NAF-data/convert-pdf.ts +++ b/site/scripts/NAFAndGuichetData/extract-NAF-data/convert-pdf.ts @@ -1,8 +1,9 @@ import { readFileSync, writeFileSync } from 'fs' import { join } from 'path' -import { PdfData, VerbosityLevel } from 'pdfdataextract' import { fileURLToPath } from 'url' +import { PdfData, VerbosityLevel } from 'pdfdataextract' + const __dirname = fileURLToPath(new URL('.', import.meta.url)) const INPUT_PDF_PATH = join( diff --git a/site/scripts/build-yaml-to-dts.ts b/site/scripts/build-yaml-to-dts.ts index 849c5b79d..22bd81169 100644 --- a/site/scripts/build-yaml-to-dts.ts +++ b/site/scripts/build-yaml-to-dts.ts @@ -1,5 +1,6 @@ import { readFileSync } from 'fs' import { join } from 'path' + import { Project } from 'ts-morph' import yaml from 'yaml' diff --git a/site/scripts/fetch-job-offers.js b/site/scripts/fetch-job-offers.js index 0c69f1ef4..4bf001574 100644 --- a/site/scripts/fetch-job-offers.js +++ b/site/scripts/fetch-job-offers.js @@ -1,8 +1,9 @@ // We publish our job offers on https://beta.gouv.fr/recrutement/. To augment // their reach, we also publish a banner on our website automatically by using // the beta.gouv.fr API. -import dotenv from 'dotenv' import { promisify } from 'util' + +import dotenv from 'dotenv' import { parseString } from 'xml2js' import { createDataDir, writeInDataDir } from './utils.js' diff --git a/site/scripts/i18n/translate-rules.js b/site/scripts/i18n/translate-rules.js index 6844763f1..5a8cd7ce2 100644 --- a/site/scripts/i18n/translate-rules.js +++ b/site/scripts/i18n/translate-rules.js @@ -1,4 +1,5 @@ import { writeFileSync } from 'fs' + import prettier from 'prettier' import yaml from 'yaml' diff --git a/site/scripts/i18n/translate-ui.js b/site/scripts/i18n/translate-ui.js index 08247b1e0..8888662d9 100644 --- a/site/scripts/i18n/translate-ui.js +++ b/site/scripts/i18n/translate-ui.js @@ -1,13 +1,14 @@ import { readFileSync, writeFileSync } from 'fs' + import yaml from 'yaml' import { - UiOriginalTranslationPath, - UiTranslationPath, assocPath, fetchTranslation, filterUnusedTranslations, getUiMissingTranslations, + UiOriginalTranslationPath, + UiTranslationPath, } from './utils.js' const sleep = (timeout) => diff --git a/site/scripts/i18n/utils.js b/site/scripts/i18n/utils.js index 6413093f4..87b0e4df4 100644 --- a/site/scripts/i18n/utils.js +++ b/site/scripts/i18n/utils.js @@ -1,5 +1,6 @@ -import dotenv from 'dotenv' import { readFileSync } from 'fs' + +import dotenv from 'dotenv' import yaml from 'yaml' import rules from '../../../modele-social/dist/index.js' diff --git a/site/scripts/runScriptOnFileChange/execOnFileChange.ts b/site/scripts/runScriptOnFileChange/execOnFileChange.ts index cabff488f..0fd517e3a 100644 --- a/site/scripts/runScriptOnFileChange/execOnFileChange.ts +++ b/site/scripts/runScriptOnFileChange/execOnFileChange.ts @@ -1,9 +1,10 @@ -import { getPackageDeps } from '@rushstack/package-deps-hash' import { exec as originalExec } from 'child_process' import { existsSync, lstatSync, readFileSync, writeFileSync } from 'fs' import { relative, resolve } from 'path' import { promisify } from 'util' +import { getPackageDeps } from '@rushstack/package-deps-hash' + const exec = promisify(originalExec) type DirPath = string diff --git a/site/scripts/stats/fetch-stats.js b/site/scripts/stats/fetch-stats.js index af9abc0e4..f85330b0b 100644 --- a/site/scripts/stats/fetch-stats.js +++ b/site/scripts/stats/fetch-stats.js @@ -1,8 +1,9 @@ -import dotenv from 'dotenv' import fs from 'fs' import path from 'path' import { fileURLToPath } from 'url' +import dotenv from 'dotenv' + import { createDataDir, readInDataDir, writeInDataDir } from '../utils.js' import { apiStats } from './fetch-api-stats.js' diff --git a/site/source/components/App.tsx b/site/source/components/App.tsx index 9545bf212..bb4a3b17b 100644 --- a/site/source/components/App.tsx +++ b/site/source/components/App.tsx @@ -6,13 +6,13 @@ import { useTranslation } from 'react-i18next' import { Route, Routes } from 'react-router-dom' import styled, { css } from 'styled-components' -import Route404 from '@/components/Route404' import Footer from '@/components/layout/Footer/Footer' import Header from '@/components/layout/Header' +import Route404 from '@/components/Route404' import { + engineFactory, EngineProvider, Rules, - engineFactory, useEngine, useSetupSafeSituation, } from '@/components/utils/EngineContext' @@ -21,17 +21,17 @@ import { useAxeCoreAnalysis } from '@/hooks/useAxeCoreAnalysis' import { useGetFullURL } from '@/hooks/useGetFullURL' import { useIsEmbedded } from '@/hooks/useIsEmbedded' import { useSaveAndRestoreScrollPosition } from '@/hooks/useSaveAndRestoreScrollPosition' -import Accessibilité from '@/pages/Accessibilité' -import Documentation from '@/pages/Documentation' -import Offline from '@/pages/Offline' -import Plan from '@/pages/Plan' import Landing from '@/pages/_landing/Landing' +import Accessibilité from '@/pages/Accessibilité' import Assistants from '@/pages/assistants/index' import Budget from '@/pages/budget/index' import IntegrationTest from '@/pages/dev/IntegrationTest' +import Documentation from '@/pages/Documentation' import Iframes from '@/pages/iframes' import Integration from '@/pages/integration/index' import Nouveautés from '@/pages/nouveautés/index' +import Offline from '@/pages/Offline' +import Plan from '@/pages/Plan' import Simulateurs from '@/pages/simulateurs' import SimulateursEtAssistants from '@/pages/simulateurs-et-assistants' import Stats from '@/pages/statistiques/LazyStats' diff --git a/site/source/components/ChiffreAffairesActivitéMixte.tsx b/site/source/components/ChiffreAffairesActivitéMixte.tsx index 191187701..c3f369c93 100644 --- a/site/source/components/ChiffreAffairesActivitéMixte.tsx +++ b/site/source/components/ChiffreAffairesActivitéMixte.tsx @@ -10,9 +10,9 @@ import { batchUpdateSituation } from '@/store/actions/actions' import { situationSelector } from '@/store/selectors/simulationSelectors' import { catchDivideByZeroError } from '@/utils' +import { ExplicableRule } from './conversation/Explicable' import { Condition, WhenApplicable } from './EngineValue' import { SimulationGoal } from './Simulation' -import { ExplicableRule } from './conversation/Explicable' import { FromTop } from './ui/animate' import { useEngine } from './utils/EngineContext' diff --git a/site/source/components/EngineValue.tsx b/site/source/components/EngineValue.tsx index d02432ed4..34e16b757 100644 --- a/site/source/components/EngineValue.tsx +++ b/site/source/components/EngineValue.tsx @@ -2,9 +2,9 @@ import { DottedName } from 'modele-social' import Engine, { ASTNode, EvaluatedNode, + formatValue, PublicodesExpression, RuleNode, - formatValue, } from 'publicodes' import React from 'react' import { useTranslation } from 'react-i18next' diff --git a/site/source/components/Logo.tsx b/site/source/components/Logo.tsx index 06de8af1b..b61bad5a9 100644 --- a/site/source/components/Logo.tsx +++ b/site/source/components/Logo.tsx @@ -1,10 +1,10 @@ import { useTranslation } from 'react-i18next' import styled from 'styled-components' -import logoSvgFR from '@/assets/images/logo-monentreprise.svg' import logoSvgFRDark from '@/assets/images/logo-monentreprise_white.svg' -import logoSvgEN from '@/assets/images/logo-mycompany.svg' +import logoSvgFR from '@/assets/images/logo-monentreprise.svg' import logoSvgENDark from '@/assets/images/logo-mycompany_white.svg' +import logoSvgEN from '@/assets/images/logo-mycompany.svg' import { useDarkMode } from '@/hooks/useDarkMode' /* Figma source: https://www.figma.com/file/YJUpRNO12lcPUDsEYEXzT9/logo-monentreprisee-urssaf-edition */ diff --git a/site/source/components/PaySlip.tsx b/site/source/components/PaySlip.tsx index 32ef471ac..b898fd110 100644 --- a/site/source/components/PaySlip.tsx +++ b/site/source/components/PaySlip.tsx @@ -1,11 +1,11 @@ import { DottedName } from 'modele-social' import { ASTNode, + formatValue, ParsedRules, + reduceAST, Rule, RuleNode, - formatValue, - reduceAST, } from 'publicodes' import { Fragment, useContext } from 'react' import { Trans, useTranslation } from 'react-i18next' diff --git a/site/source/components/PlaceDesEntreprises.tsx b/site/source/components/PlaceDesEntreprises.tsx index ace0e0284..2bca25a3a 100644 --- a/site/source/components/PlaceDesEntreprises.tsx +++ b/site/source/components/PlaceDesEntreprises.tsx @@ -1,4 +1,4 @@ -import { Suspense, lazy, useRef } from 'react' +import { lazy, Suspense, useRef } from 'react' import { Trans, useTranslation } from 'react-i18next' import styled from 'styled-components' diff --git a/site/source/components/Provider.tsx b/site/source/components/Provider.tsx index 5c9a5972b..a405dad7b 100644 --- a/site/source/components/Provider.tsx +++ b/site/source/components/Provider.tsx @@ -1,15 +1,15 @@ import { OverlayProvider } from '@react-aria/overlays' import { ErrorBoundary } from '@sentry/react' import i18next from 'i18next' -import { ReactNode, createContext } from 'react' +import { createContext, ReactNode } from 'react' import { HelmetProvider } from 'react-helmet-async' import { I18nextProvider, useTranslation } from 'react-i18next' import { Provider as ReduxProvider } from 'react-redux' import { BrowserRouter } from 'react-router-dom' import logo from '@/assets/images/logo-monentreprise.svg' -import { DisableAnimationOnPrintProvider } from '@/components/utils/DisableAnimationContext' import { ThemeColorsProvider } from '@/components/utils/colors' +import { DisableAnimationOnPrintProvider } from '@/components/utils/DisableAnimationContext' import { GlobalStyle } from '@/design-system/global-style' import { Container, Grid } from '@/design-system/layout' import DesignSystemThemeProvider from '@/design-system/root' diff --git a/site/source/components/Simulation/SimulationGoal.tsx b/site/source/components/Simulation/SimulationGoal.tsx index 555ac4f93..9fbd785f0 100644 --- a/site/source/components/Simulation/SimulationGoal.tsx +++ b/site/source/components/Simulation/SimulationGoal.tsx @@ -1,5 +1,5 @@ import { DottedName } from 'modele-social' -import { PublicodesExpression, formatValue } from 'publicodes' +import { formatValue, PublicodesExpression } from 'publicodes' import React, { useCallback, useState } from 'react' import { useDispatch, useSelector } from 'react-redux' import styled from 'styled-components' @@ -11,11 +11,11 @@ import { Body, SmallBody } from '@/design-system/typography/paragraphs' import { updateSituation } from '@/store/actions/actions' import { targetUnitSelector } from '@/store/selectors/simulationSelectors' -import RuleLink from '../RuleLink' import { ExplicableRule } from '../conversation/Explicable' import RuleInput, { InputProps } from '../conversation/RuleInput' -import AnimatedTargetValue from '../ui/AnimatedTargetValue' +import RuleLink from '../RuleLink' import { Appear } from '../ui/animate' +import AnimatedTargetValue from '../ui/AnimatedTargetValue' import { useEngine } from '../utils/EngineContext' import { useInitialRender } from '../utils/useInitialRender' diff --git a/site/source/components/Simulation/index.tsx b/site/source/components/Simulation/index.tsx index 820499478..1d3ddadab 100644 --- a/site/source/components/Simulation/index.tsx +++ b/site/source/components/Simulation/index.tsx @@ -5,8 +5,8 @@ import { Trans, useTranslation } from 'react-i18next' import { useSelector } from 'react-redux' import styled from 'styled-components' -import ShareOrSaveSimulationBanner from '@/components/ShareSimulationBanner' import { ConversationProps } from '@/components/conversation/Conversation' +import ShareOrSaveSimulationBanner from '@/components/ShareSimulationBanner' import { PopoverWithTrigger } from '@/design-system' import { Grid, Spacing } from '@/design-system/layout' import { Link } from '@/design-system/typography/link' diff --git a/site/source/components/company/Details.tsx b/site/source/components/company/Details.tsx index 1ac22a4da..cdd2665e5 100644 --- a/site/source/components/company/Details.tsx +++ b/site/source/components/company/Details.tsx @@ -8,8 +8,8 @@ import { Strong } from '@/design-system/typography' import { H4 } from '@/design-system/typography/heading' import { Body } from '@/design-system/typography/paragraphs' -import Value from '../EngineValue' import SeeAnswersButton from '../conversation/SeeAnswersButton' +import Value from '../EngineValue' export function CompanyDetails({ showSituation = false, diff --git a/site/source/components/conversation/Conversation.tsx b/site/source/components/conversation/Conversation.tsx index 1e3b151fc..9dd2b9bde 100644 --- a/site/source/components/conversation/Conversation.tsx +++ b/site/source/components/conversation/Conversation.tsx @@ -4,9 +4,9 @@ import React, { useCallback, useEffect, useState } from 'react' import { Trans, useTranslation } from 'react-i18next' import { useDispatch, useSelector } from 'react-redux' +import RuleInput from '@/components/conversation/RuleInput' import Notifications from '@/components/Notifications' import QuickLinks from '@/components/QuickLinks' -import RuleInput from '@/components/conversation/RuleInput' import { useEngine } from '@/components/utils/EngineContext' import { Button } from '@/design-system/buttons' import { Emoji } from '@/design-system/emoji' diff --git a/site/source/components/conversation/NumberInput.tsx b/site/source/components/conversation/NumberInput.tsx index 0ae6d554a..4e64bd543 100644 --- a/site/source/components/conversation/NumberInput.tsx +++ b/site/source/components/conversation/NumberInput.tsx @@ -1,5 +1,5 @@ import { NumberFieldProps } from '@react-types/numberfield' -import { ASTNode, Unit, parseUnit, serializeUnit } from 'publicodes' +import { ASTNode, parseUnit, serializeUnit, Unit } from 'publicodes' import { useCallback, useContext, useEffect, useState } from 'react' import { useTranslation } from 'react-i18next' import styled from 'styled-components' diff --git a/site/source/components/conversation/RuleInput.tsx b/site/source/components/conversation/RuleInput.tsx index ea29eaabc..156aac148 100644 --- a/site/source/components/conversation/RuleInput.tsx +++ b/site/source/components/conversation/RuleInput.tsx @@ -4,8 +4,8 @@ import Engine, { EvaluatedNode, Evaluation, PublicodesExpression, - RuleNode, reduceAST, + RuleNode, } from 'publicodes' import React, { useContext } from 'react' @@ -18,9 +18,9 @@ import { Choice, MultipleAnswerInput, OuiNonInput } from './ChoicesInput' import DateInput from './DateInput' import { MultipleChoicesInput } from './MulipleChoicesInput' import ParagrapheInput from './ParagrapheInput' -import TextInput from './TextInput' import SelectPaysDétachement from './select/SelectPaysDétachement' import SelectAtmp from './select/SelectTauxRisque' +import TextInput from './TextInput' type InputType = 'radio' | 'card' | 'toggle' | 'select' diff --git a/site/source/components/conversation/select/SelectCommune.tsx b/site/source/components/conversation/select/SelectCommune.tsx index 2e58a29d7..896764c30 100644 --- a/site/source/components/conversation/select/SelectCommune.tsx +++ b/site/source/components/conversation/select/SelectCommune.tsx @@ -4,8 +4,8 @@ import styled, { css } from 'styled-components' import { Commune, - SearchCommune, fetchCommuneDetails, + SearchCommune, searchCommunes, } from '@/api/commune' import { TextField } from '@/design-system/field' diff --git a/site/source/components/layout/Footer/Privacy.tsx b/site/source/components/layout/Footer/Privacy.tsx index a19c5f8f3..4ceb959bd 100644 --- a/site/source/components/layout/Footer/Privacy.tsx +++ b/site/source/components/layout/Footer/Privacy.tsx @@ -7,7 +7,7 @@ import { Link } from '@/design-system/typography/link' import { Body, SmallBody } from '@/design-system/typography/paragraphs' import * as safeLocalStorage from '../../../storage/safeLocalStorage' -import { TrackPage, TrackingContext } from '../../ATInternetTracking' +import { TrackingContext, TrackPage } from '../../ATInternetTracking' export default function Privacy({ label, diff --git a/site/source/components/search/SimulatorHits.tsx b/site/source/components/search/SimulatorHits.tsx index 1b85f4139..e8b113481 100644 --- a/site/source/components/search/SimulatorHits.tsx +++ b/site/source/components/search/SimulatorHits.tsx @@ -3,9 +3,9 @@ import { Hit } from 'react-instantsearch-core' import { connectHits } from 'react-instantsearch-dom' import styled from 'styled-components' -import InfoBulle from '@/design-system/InfoBulle' import { SmallCard } from '@/design-system/card' import { Emoji } from '@/design-system/emoji' +import InfoBulle from '@/design-system/InfoBulle' import { Grid } from '@/design-system/layout' import { H3 } from '@/design-system/typography/heading' import { MergedSimulatorDataValues } from '@/hooks/useCurrentSimulatorData' diff --git a/site/source/components/simulationExplanation/InstitutionsPartenaires.tsx b/site/source/components/simulationExplanation/InstitutionsPartenaires.tsx index 53310a6fd..31bd14e89 100644 --- a/site/source/components/simulationExplanation/InstitutionsPartenaires.tsx +++ b/site/source/components/simulationExplanation/InstitutionsPartenaires.tsx @@ -3,9 +3,9 @@ import { Trans } from 'react-i18next' import { useSelector } from 'react-redux' import styled from 'styled-components' -import urssafSrc from '@/assets/images/Urssaf.svg' import assuranceMaladieSrc from '@/assets/images/assurance-maladie.svg' import dgfipSrc from '@/assets/images/logo-dgfip.svg' +import urssafSrc from '@/assets/images/Urssaf.svg' import Value, { Condition, WhenApplicable, diff --git a/site/source/components/ui/Checklist/index.tsx b/site/source/components/ui/Checklist/index.tsx index 08e0c0c5c..c2014401f 100644 --- a/site/source/components/ui/Checklist/index.tsx +++ b/site/source/components/ui/Checklist/index.tsx @@ -2,8 +2,8 @@ import React, { useEffect, useState } from 'react' import { Trans } from 'react-i18next' import styled from 'styled-components' -import { ScrollToElement } from '@/components/utils/Scroll' import { Markdown } from '@/components/utils/markdown' +import { ScrollToElement } from '@/components/utils/Scroll' import { Checkbox } from '@/design-system/field' import { Grid, Spacing } from '@/design-system/layout' import { Link } from '@/design-system/typography/link' diff --git a/site/source/components/ui/animate.tsx b/site/source/components/ui/animate.tsx index 32771341f..665dc782e 100644 --- a/site/source/components/ui/animate.tsx +++ b/site/source/components/ui/animate.tsx @@ -1,8 +1,8 @@ import React, { useContext } from 'react' import { - SpringConfig, animated, config as configPresets, + SpringConfig, useSpring, useTrail, } from 'react-spring' diff --git a/site/source/components/utils/DarkModeContext.tsx b/site/source/components/utils/DarkModeContext.tsx index 316422661..d92aa2b10 100644 --- a/site/source/components/utils/DarkModeContext.tsx +++ b/site/source/components/utils/DarkModeContext.tsx @@ -1,4 +1,4 @@ -import { ReactNode, createContext, useState } from 'react' +import { createContext, ReactNode, useState } from 'react' import { ThemeProvider } from 'styled-components' import { useDarkMode } from '@/hooks/useDarkMode' diff --git a/site/source/components/utils/EngineContext.tsx b/site/source/components/utils/EngineContext.tsx index 3b063f26b..8ae242b46 100644 --- a/site/source/components/utils/EngineContext.tsx +++ b/site/source/components/utils/EngineContext.tsx @@ -1,10 +1,10 @@ import { DottedName } from 'modele-social' import Engine, { EvaluatedNode, + isPublicodesError, PublicodesExpression, Rule, RuleNode, - isPublicodesError, } from 'publicodes' import { createContext, useContext, useMemo } from 'react' import { useDispatch, useSelector } from 'react-redux' diff --git a/site/source/components/utils/SituationContext.tsx b/site/source/components/utils/SituationContext.tsx index cee351d50..97c2c9724 100644 --- a/site/source/components/utils/SituationContext.tsx +++ b/site/source/components/utils/SituationContext.tsx @@ -1,8 +1,8 @@ import Engine, { PublicodesExpression } from 'publicodes' import { + createContext, Dispatch, SetStateAction, - createContext, useContext, useRef, useState, diff --git a/site/source/components/utils/useInitialRender.tsx b/site/source/components/utils/useInitialRender.tsx index 0660ab41e..b832ef59d 100644 --- a/site/source/components/utils/useInitialRender.tsx +++ b/site/source/components/utils/useInitialRender.tsx @@ -1,6 +1,6 @@ import { - ReactNode, createContext, + ReactNode, useContext, useEffect, useMemo, diff --git a/site/source/design-system/field/Select/ListBox.tsx b/site/source/design-system/field/Select/ListBox.tsx index a49ceb375..18ae949f0 100644 --- a/site/source/design-system/field/Select/ListBox.tsx +++ b/site/source/design-system/field/Select/ListBox.tsx @@ -2,10 +2,10 @@ import { AriaListBoxOptions, useListBox, useOption } from '@react-aria/listbox' import type { ListState } from '@react-stately/list' import type { Node } from '@react-types/shared' import { + createContext, HTMLAttributes, ReactNode, RefObject, - createContext, useContext, useRef, } from 'react' diff --git a/site/source/design-system/layout/Grid.tsx b/site/source/design-system/layout/Grid.tsx index bff87b9b6..411773eaf 100644 --- a/site/source/design-system/layout/Grid.tsx +++ b/site/source/design-system/layout/Grid.tsx @@ -1,4 +1,4 @@ -import { ComponentType, ReactNode, createContext, useContext } from 'react' +import { ComponentType, createContext, ReactNode, useContext } from 'react' import styled, { css } from 'styled-components' import { SpacingKey } from '../theme' diff --git a/site/source/design-system/message/index.tsx b/site/source/design-system/message/index.tsx index 1a9b79334..b5c05bace 100644 --- a/site/source/design-system/message/index.tsx +++ b/site/source/design-system/message/index.tsx @@ -1,6 +1,6 @@ import React from 'react' import { useTranslation } from 'react-i18next' -import styled, { CSSProperties, DefaultTheme, css } from 'styled-components' +import styled, { css, CSSProperties, DefaultTheme } from 'styled-components' import { ForceThemeProvider } from '@/components/utils/DarkModeContext' import { Palette, SmallPalette } from '@/types/styled' diff --git a/site/source/design-system/root.tsx b/site/source/design-system/root.tsx index e180e4f2d..56df1a4d3 100644 --- a/site/source/design-system/root.tsx +++ b/site/source/design-system/root.tsx @@ -1,9 +1,9 @@ import isbot from 'isbot' import { ReactNode } from 'react' import styled, { + css, StyleSheetManager, ThemeProvider, - css, } from 'styled-components' import urssafTheme from '@/design-system/theme' diff --git a/site/source/design-system/typography/link.tsx b/site/source/design-system/typography/link.tsx index 750593554..af0bcd7fd 100644 --- a/site/source/design-system/typography/link.tsx +++ b/site/source/design-system/typography/link.tsx @@ -1,9 +1,9 @@ import { useButton } from '@react-aria/button' import { AriaButtonProps } from '@react-types/button' import React, { - CSSProperties, ComponentProps, ComponentPropsWithRef, + CSSProperties, ForwardedRef, useCallback, useRef, diff --git a/site/source/entries/entry-sw.ts b/site/source/entries/entry-sw.ts index d1aa34e51..d1dc0a220 100644 --- a/site/source/entries/entry-sw.ts +++ b/site/source/entries/entry-sw.ts @@ -1,7 +1,7 @@ import { ExpirationPlugin } from 'workbox-expiration' import { cleanupOutdatedCaches, precacheAndRoute } from 'workbox-precaching' import { offlineFallback } from 'workbox-recipes' -import { Route, registerRoute, setDefaultHandler } from 'workbox-routing' +import { registerRoute, Route, setDefaultHandler } from 'workbox-routing' import { NetworkFirst, StaleWhileRevalidate } from 'workbox-strategies' declare let self: ServiceWorkerGlobalScope diff --git a/site/source/pages/Documentation.tsx b/site/source/pages/Documentation.tsx index 5e7c9bf9b..e3f9d8635 100644 --- a/site/source/pages/Documentation.tsx +++ b/site/source/pages/Documentation.tsx @@ -1,6 +1,6 @@ import rules, { DottedName } from 'modele-social' import Engine from 'publicodes' -import { RulePage, getDocumentationSiteMap } from 'publicodes-react' +import { getDocumentationSiteMap, RulePage } from 'publicodes-react' import { ComponentProps, useMemo, useRef } from 'react' import { Helmet } from 'react-helmet-async' import { Trans, useTranslation } from 'react-i18next' @@ -17,9 +17,9 @@ import styled from 'styled-components' import { References } from '@/components/References' import SearchRules from '@/components/search/SearchRules' import { FromBottom } from '@/components/ui/animate' +import { Markdown } from '@/components/utils/markdown' import Meta from '@/components/utils/Meta' import { ScrollToTop } from '@/components/utils/Scroll' -import { Markdown } from '@/components/utils/markdown' import { Accordion, Item } from '@/design-system' import { Button } from '@/design-system/buttons' import { Spacing } from '@/design-system/layout' diff --git a/site/source/pages/_landing/Landing.tsx b/site/source/pages/_landing/Landing.tsx index e3877a736..bcc755708 100644 --- a/site/source/pages/_landing/Landing.tsx +++ b/site/source/pages/_landing/Landing.tsx @@ -2,9 +2,9 @@ import { Trans, useTranslation } from 'react-i18next' import styled from 'styled-components' import { TrackPage } from '@/components/ATInternetTracking' -import PageHeader from '@/components/PageHeader' import Footer from '@/components/layout/Footer/Footer' import Header from '@/components/layout/Header' +import PageHeader from '@/components/PageHeader' import Meta from '@/components/utils/Meta' import { Button } from '@/design-system/buttons' import { Container, Grid, Spacing } from '@/design-system/layout' @@ -16,9 +16,9 @@ import useSimulatorsData from '@/hooks/useSimulatorsData' import { useSitePaths } from '@/sitePaths' import { SimulateurCard } from '../simulateurs-et-assistants' -import SearchOrCreate from './SearchOrCreate' -import illustration2Svg from './illustration2.svg' import illustrationSvg from './illustration.svg' +import illustration2Svg from './illustration2.svg' +import SearchOrCreate from './SearchOrCreate' export default function Landing() { const simulators = useSimulatorsData() diff --git a/site/source/pages/assistants/choix-du-statut/CreationChecklist.tsx b/site/source/pages/assistants/choix-du-statut/CreationChecklist.tsx index 2ee9b1b94..e4f178c6f 100644 --- a/site/source/pages/assistants/choix-du-statut/CreationChecklist.tsx +++ b/site/source/pages/assistants/choix-du-statut/CreationChecklist.tsx @@ -2,8 +2,8 @@ import { Trans, useTranslation } from 'react-i18next' import { useDispatch, useSelector } from 'react-redux' import { TrackPage } from '@/components/ATInternetTracking' -import { CheckItem, Checklist } from '@/components/ui/Checklist' import { FromBottom } from '@/components/ui/animate' +import { CheckItem, Checklist } from '@/components/ui/Checklist' import DefaultHelmet from '@/components/utils/DefaultHelmet' import Scroll from '@/components/utils/Scroll' import { Button } from '@/design-system/buttons' diff --git a/site/source/pages/assistants/choix-du-statut/index.tsx b/site/source/pages/assistants/choix-du-statut/index.tsx index 5ccbd13a1..ac726d7d9 100644 --- a/site/source/pages/assistants/choix-du-statut/index.tsx +++ b/site/source/pages/assistants/choix-du-statut/index.tsx @@ -4,9 +4,9 @@ import { ScrollToTop } from '@/components/utils/Scroll' import { LANDING_LEGAL_STATUS_LIST, useSitePaths } from '@/sitePaths' import AfterRegistration from './AfterRegistration' +import ChoixStatutJuridique from './choix-statut-juridique' import CreationChecklist from './CreationChecklist' import GuideStatut from './GuideStatut' -import ChoixStatutJuridique from './choix-statut-juridique' export default function ChoixDuStatut() { const { relativeSitePaths } = useSitePaths() diff --git a/site/source/pages/assistants/declaration-charges-sociales-independant/components/ExplicationResultatFiscal.tsx b/site/source/pages/assistants/declaration-charges-sociales-independant/components/ExplicationResultatFiscal.tsx index a8a863d34..be1736227 100644 --- a/site/source/pages/assistants/declaration-charges-sociales-independant/components/ExplicationResultatFiscal.tsx +++ b/site/source/pages/assistants/declaration-charges-sociales-independant/components/ExplicationResultatFiscal.tsx @@ -3,7 +3,7 @@ import styled from 'styled-components' import HelpButtonWithPopover from '@/design-system/buttons/HelpButtonWithPopover' import { Li, Ul } from '@/design-system/typography/list' -import { Body, baseParagraphStyle } from '@/design-system/typography/paragraphs' +import { baseParagraphStyle, Body } from '@/design-system/typography/paragraphs' export const StyledTable = styled.table` ${baseParagraphStyle} diff --git a/site/source/pages/assistants/declaration-charges-sociales-independant/index.tsx b/site/source/pages/assistants/declaration-charges-sociales-independant/index.tsx index 02fc496ca..27371656e 100644 --- a/site/source/pages/assistants/declaration-charges-sociales-independant/index.tsx +++ b/site/source/pages/assistants/declaration-charges-sociales-independant/index.tsx @@ -6,11 +6,11 @@ import { useDispatch, useSelector } from 'react-redux' import styled from 'styled-components' import { TrackPage } from '@/components/ATInternetTracking' +import RuleInput from '@/components/conversation/RuleInput' import { Condition, WhenAlreadyDefined } from '@/components/EngineValue' import PageHeader from '@/components/PageHeader' -import RuleInput from '@/components/conversation/RuleInput' -import Warning from '@/components/ui/WarningBlock' import { FromTop } from '@/components/ui/animate' +import Warning from '@/components/ui/WarningBlock' import DefaultHelmet from '@/components/utils/DefaultHelmet' import { useEngine } from '@/components/utils/EngineContext' import { Grid } from '@/design-system/layout' diff --git a/site/source/pages/assistants/declaration-revenu-independants/components/DéclarationRevenu.tsx b/site/source/pages/assistants/declaration-revenu-independants/components/DéclarationRevenu.tsx index 82fe9bd84..baaefca38 100644 --- a/site/source/pages/assistants/declaration-revenu-independants/components/DéclarationRevenu.tsx +++ b/site/source/pages/assistants/declaration-revenu-independants/components/DéclarationRevenu.tsx @@ -6,10 +6,10 @@ import { useDispatch } from 'react-redux' import styled, { css } from 'styled-components' import { TrackPage } from '@/components/ATInternetTracking' -import Value, { Condition } from '@/components/EngineValue' -import ShareOrSaveSimulationBanner from '@/components/ShareSimulationBanner' import { ExplicableRule } from '@/components/conversation/Explicable' import RuleInput from '@/components/conversation/RuleInput' +import Value, { Condition } from '@/components/EngineValue' +import ShareOrSaveSimulationBanner from '@/components/ShareSimulationBanner' import { FromTop } from '@/components/ui/animate' import { useEngine } from '@/components/utils/EngineContext' import { Message } from '@/design-system' diff --git a/site/source/pages/assistants/declaration-revenu-independants/cotisations.tsx b/site/source/pages/assistants/declaration-revenu-independants/cotisations.tsx index 028ba45be..91c61609b 100644 --- a/site/source/pages/assistants/declaration-revenu-independants/cotisations.tsx +++ b/site/source/pages/assistants/declaration-revenu-independants/cotisations.tsx @@ -1,8 +1,8 @@ +import Conversation from '@/components/conversation/Conversation' import Value, { Condition, WhenAlreadyDefined } from '@/components/EngineValue' import ShareOrSaveSimulationBanner from '@/components/ShareSimulationBanner' -import Conversation from '@/components/conversation/Conversation' -import Progress from '@/components/ui/Progress' import { FromTop } from '@/components/ui/animate' +import Progress from '@/components/ui/Progress' import { useEngine } from '@/components/utils/EngineContext' import { Markdown } from '@/components/utils/markdown' import { Message } from '@/design-system' diff --git a/site/source/pages/assistants/declaration-revenu-independants/entreprise.tsx b/site/source/pages/assistants/declaration-revenu-independants/entreprise.tsx index 6ad375332..60b917f73 100644 --- a/site/source/pages/assistants/declaration-revenu-independants/entreprise.tsx +++ b/site/source/pages/assistants/declaration-revenu-independants/entreprise.tsx @@ -3,6 +3,8 @@ import { Trans } from 'react-i18next' import { useDispatch } from 'react-redux' import { TrackPage } from '@/components/ATInternetTracking' +import { CompanyDetails } from '@/components/company/Details' +import { CompanySearchField } from '@/components/company/SearchField' import { Condition, WhenAlreadyDefined, @@ -10,10 +12,8 @@ import { WhenNotAlreadyDefined, } from '@/components/EngineValue' import PageHeader from '@/components/PageHeader' -import { CompanyDetails } from '@/components/company/Details' -import { CompanySearchField } from '@/components/company/SearchField' -import Warning from '@/components/ui/WarningBlock' import { FromTop } from '@/components/ui/animate' +import Warning from '@/components/ui/WarningBlock' import { useEngine } from '@/components/utils/EngineContext' import { Markdown } from '@/components/utils/markdown' import { Message } from '@/design-system' @@ -31,8 +31,8 @@ import { resetCompany } from '@/store/actions/companyActions' import { SimpleField } from '../components/Fields' import Exceptions from './components/Exceptions' -import NotHandledCase from './components/NotHandledCase' import { useProgress } from './components/hooks' +import NotHandledCase from './components/NotHandledCase' import illustration from './components/undraw_fill_in_mie5.svg' export const OBJECTIFS: DottedName[] = [ diff --git a/site/source/pages/assistants/declaration-revenu-independants/imposition.tsx b/site/source/pages/assistants/declaration-revenu-independants/imposition.tsx index efdbc6088..930ee5f21 100644 --- a/site/source/pages/assistants/declaration-revenu-independants/imposition.tsx +++ b/site/source/pages/assistants/declaration-revenu-independants/imposition.tsx @@ -29,8 +29,8 @@ import { getMeta } from '@/utils' import { SimpleField } from '../components/Fields' import FormulaireTitle from './components/FormulaireTitle' -import ModeAccompagnement from './components/ModeAccompagnement' import { useProgress } from './components/hooks' +import ModeAccompagnement from './components/ModeAccompagnement' export const OBJECTIFS: Array = [ 'entreprise . imposition', diff --git a/site/source/pages/assistants/demande-mobilité/EndBlock.tsx b/site/source/pages/assistants/demande-mobilité/EndBlock.tsx index ebc1efa4a..dccad6e43 100644 --- a/site/source/pages/assistants/demande-mobilité/EndBlock.tsx +++ b/site/source/pages/assistants/demande-mobilité/EndBlock.tsx @@ -1,10 +1,10 @@ import { BlobProvider } from '@react-pdf/renderer' import { RuleNode, utils } from 'publicodes' -import { Suspense, lazy, useContext, useRef, useState } from 'react' +import { lazy, Suspense, useContext, useRef, useState } from 'react' import SignaturePad from 'react-signature-pad-wrapper' import { ThemeContext } from 'styled-components' -import { TrackPage, TrackingContext } from '@/components/ATInternetTracking' +import { TrackingContext, TrackPage } from '@/components/ATInternetTracking' import { Condition } from '@/components/EngineValue' import { EngineContext, EngineProvider } from '@/components/utils/EngineContext' import { Message, PopoverWithTrigger } from '@/design-system' diff --git a/site/source/pages/assistants/demande-mobilité/FieldsPDF.tsx b/site/source/pages/assistants/demande-mobilité/FieldsPDF.tsx index 5bec06ec0..aa6d546e2 100644 --- a/site/source/pages/assistants/demande-mobilité/FieldsPDF.tsx +++ b/site/source/pages/assistants/demande-mobilité/FieldsPDF.tsx @@ -1,5 +1,5 @@ import PDFElement from '@react-pdf/renderer' -import { RuleNode, formatValue } from 'publicodes' +import { formatValue, RuleNode } from 'publicodes' import { useContext } from 'react' import { EngineContext } from '@/components/utils/EngineContext' diff --git a/site/source/pages/assistants/demande-mobilité/index.tsx b/site/source/pages/assistants/demande-mobilité/index.tsx index 51ee03fdb..c48b9db7b 100644 --- a/site/source/pages/assistants/demande-mobilité/index.tsx +++ b/site/source/pages/assistants/demande-mobilité/index.tsx @@ -1,11 +1,11 @@ import { DottedName } from 'modele-social' import Engine, { PublicodesExpression } from 'publicodes' -import { Fragment, Suspense, lazy, useCallback, useContext } from 'react' +import { Fragment, lazy, Suspense, useCallback, useContext } from 'react' import { Trans, useTranslation } from 'react-i18next' import { TrackPage } from '@/components/ATInternetTracking' -import { WhenApplicable, WhenNotApplicable } from '@/components/EngineValue' import RuleInput from '@/components/conversation/RuleInput' +import { WhenApplicable, WhenNotApplicable } from '@/components/EngineValue' import BrowserOnly from '@/components/utils/BrowserOnly' import DefaultHelmet from '@/components/utils/DefaultHelmet' import { EngineContext, EngineProvider } from '@/components/utils/EngineContext' diff --git a/site/source/pages/assistants/embaucher.tsx b/site/source/pages/assistants/embaucher.tsx index b660013c9..d45d7854b 100644 --- a/site/source/pages/assistants/embaucher.tsx +++ b/site/source/pages/assistants/embaucher.tsx @@ -2,8 +2,8 @@ import { Trans, useTranslation } from 'react-i18next' import { connect, useSelector } from 'react-redux' import { TrackPage } from '@/components/ATInternetTracking' -import { CheckItem, Checklist, ChecklistProps } from '@/components/ui/Checklist' import { FromBottom } from '@/components/ui/animate' +import { CheckItem, Checklist, ChecklistProps } from '@/components/ui/Checklist' import DefaultHelmet from '@/components/utils/DefaultHelmet' import { H1, H2, H3 } from '@/design-system/typography/heading' import { Link } from '@/design-system/typography/link' diff --git a/site/source/pages/assistants/pour-mon-entreprise/index.tsx b/site/source/pages/assistants/pour-mon-entreprise/index.tsx index 34bfa638e..5cdec6f42 100644 --- a/site/source/pages/assistants/pour-mon-entreprise/index.tsx +++ b/site/source/pages/assistants/pour-mon-entreprise/index.tsx @@ -5,10 +5,10 @@ import { useEffect, useRef, useState } from 'react' import { Trans, useTranslation } from 'react-i18next' import { useDispatch, useSelector } from 'react-redux' import { + generatePath, Navigate, Route, Routes, - generatePath, useParams, } from 'react-router-dom' import styled from 'styled-components' @@ -18,11 +18,11 @@ import { searchDenominationOrSiren, } from '@/api/fabrique-social' import { TrackPage } from '@/components/ATInternetTracking' +import { CompanyDetails } from '@/components/company/Details' +import RuleInput from '@/components/conversation/RuleInput' import { Condition, WhenApplicable } from '@/components/EngineValue' import PageHeader from '@/components/PageHeader' import { PlaceDesEntreprisesButton } from '@/components/PlaceDesEntreprises' -import { CompanyDetails } from '@/components/company/Details' -import RuleInput from '@/components/conversation/RuleInput' import { FromTop } from '@/components/ui/animate' import { ForceThemeProvider } from '@/components/utils/DarkModeContext' import DefaultHelmet from '@/components/utils/DefaultHelmet' diff --git a/site/source/pages/assistants/recherche-code-ape/Result.tsx b/site/source/pages/assistants/recherche-code-ape/Result.tsx index 43b1daafe..3f7fc6f5c 100644 --- a/site/source/pages/assistants/recherche-code-ape/Result.tsx +++ b/site/source/pages/assistants/recherche-code-ape/Result.tsx @@ -4,9 +4,9 @@ import styled, { css } from 'styled-components' import { Appear } from '@/components/ui/animate' import { Chip } from '@/design-system' -import InfoBulle from '@/design-system/InfoBulle' import { Button, HelpButtonWithPopover } from '@/design-system/buttons' import { ChevronIcon } from '@/design-system/icons' +import InfoBulle from '@/design-system/InfoBulle' import { Grid } from '@/design-system/layout' import { H3, H4 } from '@/design-system/typography/heading' import { Link } from '@/design-system/typography/link' diff --git a/site/source/pages/assistants/sécurité-sociale.tsx b/site/source/pages/assistants/sécurité-sociale.tsx index d705264bc..2457915af 100644 --- a/site/source/pages/assistants/sécurité-sociale.tsx +++ b/site/source/pages/assistants/sécurité-sociale.tsx @@ -2,8 +2,8 @@ import { Trans, useTranslation } from 'react-i18next' import styled from 'styled-components' import { TrackPage } from '@/components/ATInternetTracking' -import FoldingMessage from '@/components/ui/FoldingMessage' import { FromBottom } from '@/components/ui/animate' +import FoldingMessage from '@/components/ui/FoldingMessage' import DefaultHelmet from '@/components/utils/DefaultHelmet' import { H1, H2 } from '@/design-system/typography/heading' import { Body } from '@/design-system/typography/paragraphs' diff --git a/site/source/pages/assistants/économie-collaborative/ActiviteCard/index.tsx b/site/source/pages/assistants/économie-collaborative/ActiviteCard/index.tsx index 46273d435..09ecc24a7 100644 --- a/site/source/pages/assistants/économie-collaborative/ActiviteCard/index.tsx +++ b/site/source/pages/assistants/économie-collaborative/ActiviteCard/index.tsx @@ -15,9 +15,9 @@ import { H4 } from '@/design-system/typography/heading' import { Body, SmallBody } from '@/design-system/typography/paragraphs' import { useSitePaths } from '@/sitePaths' -import { StoreContext } from '../StoreContext' import { toggleActivité } from '../actions' import { getTranslatedActivité } from '../activitésData' +import { StoreContext } from '../StoreContext' type ActiviteCardProps = { title: string diff --git a/site/source/pages/assistants/économie-collaborative/Activité.tsx b/site/source/pages/assistants/économie-collaborative/Activité.tsx index b09678bea..b105b05c6 100644 --- a/site/source/pages/assistants/économie-collaborative/Activité.tsx +++ b/site/source/pages/assistants/économie-collaborative/Activité.tsx @@ -5,8 +5,8 @@ import { Navigate, useParams } from 'react-router-dom' import { TrackPage } from '@/components/ATInternetTracking' import { FromBottom } from '@/components/ui/animate' -import { ScrollToTop } from '@/components/utils/Scroll' import { Markdown } from '@/components/utils/markdown' +import { ScrollToTop } from '@/components/utils/Scroll' import { Emoji } from '@/design-system/emoji' import { Radio, RadioGroup } from '@/design-system/field' import { H1, H2, H3 } from '@/design-system/typography/heading' @@ -14,13 +14,13 @@ import { Body, SmallBody } from '@/design-system/typography/paragraphs' import { useSitePaths } from '@/sitePaths' import { getValueFrom } from '@/utils' +import { selectSeuilRevenus } from './actions' +import { getTranslatedActivité } from './activitésData' import { ActivitéSelection } from './ActivitésSelection' import Exonérations from './Exonérations' import NextButton from './NextButton' -import { StoreContext } from './StoreContext' -import { selectSeuilRevenus } from './actions' -import { getTranslatedActivité } from './activitésData' import { estExonéréeSelector } from './selectors' +import { StoreContext } from './StoreContext' export type Activity = { titre: string diff --git a/site/source/pages/assistants/économie-collaborative/ActivitésSelection.tsx b/site/source/pages/assistants/économie-collaborative/ActivitésSelection.tsx index 0bf18fa4a..5617c8ed9 100644 --- a/site/source/pages/assistants/économie-collaborative/ActivitésSelection.tsx +++ b/site/source/pages/assistants/économie-collaborative/ActivitésSelection.tsx @@ -9,15 +9,15 @@ import { Grid, Spacing } from '@/design-system/layout' import { H1, H2 } from '@/design-system/typography/heading' import { Body, SmallBody } from '@/design-system/typography/paragraphs' -import { ActiviteCard } from './ActiviteCard' import { Activity } from './Activité' -import NextButton from './NextButton' -import { StoreContext } from './StoreContext' +import { ActiviteCard } from './ActiviteCard' import { activités } from './activitésData' +import NextButton from './NextButton' import { activitésEffectuéesSelector, activitésRéponduesSelector, } from './selectors' +import { StoreContext } from './StoreContext' export default function ActivitésSelection() { const { t } = useTranslation() diff --git a/site/source/pages/assistants/économie-collaborative/Exonérations.tsx b/site/source/pages/assistants/économie-collaborative/Exonérations.tsx index 3b57618df..e32e7f263 100644 --- a/site/source/pages/assistants/économie-collaborative/Exonérations.tsx +++ b/site/source/pages/assistants/économie-collaborative/Exonérations.tsx @@ -5,9 +5,9 @@ import { CheckItem, Checklist } from '@/components/ui/Checklist' import { H2 } from '@/design-system/typography/heading' import { Body, SmallBody } from '@/design-system/typography/paragraphs' +import { changeCritèreExonération } from './actions' import { Activity } from './Activité' import { StoreContext } from './StoreContext' -import { changeCritèreExonération } from './actions' export default function Exonération({ exceptionsExonération, diff --git a/site/source/pages/assistants/économie-collaborative/NextButton.tsx b/site/source/pages/assistants/économie-collaborative/NextButton.tsx index c3dbffcab..934bbb8f4 100644 --- a/site/source/pages/assistants/économie-collaborative/NextButton.tsx +++ b/site/source/pages/assistants/économie-collaborative/NextButton.tsx @@ -4,9 +4,9 @@ import { Trans } from 'react-i18next' import { Button } from '@/design-system/buttons' import { useSitePaths } from '@/sitePaths' -import { StoreContext } from './StoreContext' import { activitéVue } from './actions' import { nextActivitéSelector } from './selectors' +import { StoreContext } from './StoreContext' type NextButtonProps = { activité: string diff --git a/site/source/pages/assistants/économie-collaborative/StoreContext.tsx b/site/source/pages/assistants/économie-collaborative/StoreContext.tsx index 5c6855f5a..c42cb1755 100644 --- a/site/source/pages/assistants/économie-collaborative/StoreContext.tsx +++ b/site/source/pages/assistants/économie-collaborative/StoreContext.tsx @@ -1,9 +1,9 @@ import { + createContext, Dispatch, ReactNode, ReducerAction, ReducerState, - createContext, useCallback, useReducer, } from 'react' diff --git a/site/source/pages/assistants/économie-collaborative/VotreSituation.tsx b/site/source/pages/assistants/économie-collaborative/VotreSituation.tsx index fe7259923..097cec4d4 100644 --- a/site/source/pages/assistants/économie-collaborative/VotreSituation.tsx +++ b/site/source/pages/assistants/économie-collaborative/VotreSituation.tsx @@ -16,7 +16,6 @@ import { Body, SmallBody } from '@/design-system/typography/paragraphs' import { useSitePaths } from '@/sitePaths' import { ActiviteCard } from './ActiviteCard' -import { StoreContext } from './StoreContext' import illustration from './images/multitasking.svg' import { activitésEffectuéesSelector, @@ -24,6 +23,7 @@ import { nextActivitéSelector, régimeGénéralDisponibleSelector, } from './selectors' +import { StoreContext } from './StoreContext' export default function VotreSituation() { const { absoluteSitePaths } = useSitePaths() diff --git a/site/source/pages/budget/index.tsx b/site/source/pages/budget/index.tsx index acbe4d126..f2caf62e7 100644 --- a/site/source/pages/budget/index.tsx +++ b/site/source/pages/budget/index.tsx @@ -5,8 +5,8 @@ import styled from 'styled-components' import { TrackPage } from '@/components/ATInternetTracking' import MoreInfosOnUs from '@/components/MoreInfosOnUs' -import { ScrollToTop } from '@/components/utils/Scroll' import { Markdown } from '@/components/utils/markdown' +import { ScrollToTop } from '@/components/utils/Scroll' import { Item } from '@/design-system' import { Emoji } from '@/design-system/emoji' import { Select } from '@/design-system/field/Select' diff --git a/site/source/pages/nouveautés/index.tsx b/site/source/pages/nouveautés/index.tsx index e7c343ec2..161c51671 100644 --- a/site/source/pages/nouveautés/index.tsx +++ b/site/source/pages/nouveautés/index.tsx @@ -4,11 +4,11 @@ import { Navigate, useMatch, useNavigate } from 'react-router-dom' import styled from 'styled-components' import { TrackPage } from '@/components/ATInternetTracking' -import MoreInfosOnUs from '@/components/MoreInfosOnUs' import { determinant, useHideNewsBanner } from '@/components/layout/NewsBanner' +import MoreInfosOnUs from '@/components/MoreInfosOnUs' +import { MarkdownWithAnchorLinks } from '@/components/utils/markdown' import Meta from '@/components/utils/Meta' import { ScrollToTop } from '@/components/utils/Scroll' -import { MarkdownWithAnchorLinks } from '@/components/utils/markdown' import { Item } from '@/design-system' import { Emoji } from '@/design-system/emoji' import { Select } from '@/design-system/field/Select' diff --git a/site/source/pages/simulateurs-et-assistants/index.tsx b/site/source/pages/simulateurs-et-assistants/index.tsx index ee680626b..b517f6302 100644 --- a/site/source/pages/simulateurs-et-assistants/index.tsx +++ b/site/source/pages/simulateurs-et-assistants/index.tsx @@ -5,10 +5,10 @@ import { TrackPage } from '@/components/ATInternetTracking' import PageHeader from '@/components/PageHeader' import Meta from '@/components/utils/Meta' import { Chip } from '@/design-system' -import InfoBulle from '@/design-system/InfoBulle' import { Card } from '@/design-system/card' import { SmallCard } from '@/design-system/card/SmallCard' import { Emoji } from '@/design-system/emoji' +import InfoBulle from '@/design-system/InfoBulle' import { Grid } from '@/design-system/layout' import { Strong } from '@/design-system/typography' import { H2, H3 } from '@/design-system/typography/heading' diff --git a/site/source/pages/simulateurs/auto-entrepreneur/AutoEntrepreneur.tsx b/site/source/pages/simulateurs/auto-entrepreneur/AutoEntrepreneur.tsx index cdd7bd141..4514e3a16 100644 --- a/site/source/pages/simulateurs/auto-entrepreneur/AutoEntrepreneur.tsx +++ b/site/source/pages/simulateurs/auto-entrepreneur/AutoEntrepreneur.tsx @@ -12,8 +12,8 @@ import Simulation, { SimulationGoal, SimulationGoals, } from '@/components/Simulation' -import StackedBarChart from '@/components/StackedBarChart' import { InstitutionsPartenairesAutoEntrepreneur } from '@/components/simulationExplanation/InstitutionsPartenaires' +import StackedBarChart from '@/components/StackedBarChart' import { Message } from '@/design-system' import { Emoji } from '@/design-system/emoji' import { H2 } from '@/design-system/typography/heading' diff --git a/site/source/pages/simulateurs/chômage-partiel/ChômagePartiel.tsx b/site/source/pages/simulateurs/chômage-partiel/ChômagePartiel.tsx index 8939aee4f..1b715ca1e 100644 --- a/site/source/pages/simulateurs/chômage-partiel/ChômagePartiel.tsx +++ b/site/source/pages/simulateurs/chômage-partiel/ChômagePartiel.tsx @@ -11,8 +11,8 @@ import Simulation, { SimulationGoal, SimulationGoals, } from '@/components/Simulation' -import Warning from '@/components/ui/WarningBlock' import { FromTop } from '@/components/ui/animate' +import Warning from '@/components/ui/WarningBlock' import { useEngine } from '@/components/utils/EngineContext' import { Strong } from '@/design-system/typography' import { H2 } from '@/design-system/typography/heading' diff --git a/site/source/pages/simulateurs/comparaison-statuts/components/AllerPlusLoinRevenus.tsx b/site/source/pages/simulateurs/comparaison-statuts/components/AllerPlusLoinRevenus.tsx index 8cdade922..7d0981394 100644 --- a/site/source/pages/simulateurs/comparaison-statuts/components/AllerPlusLoinRevenus.tsx +++ b/site/source/pages/simulateurs/comparaison-statuts/components/AllerPlusLoinRevenus.tsx @@ -5,10 +5,10 @@ import { useDispatch } from 'react-redux' import styled from 'styled-components' import { DottedName } from '@/../../modele-social' -import Value from '@/components/EngineValue' import { SwitchInput } from '@/components/conversation/ChoicesInput' import { ExplicableRule } from '@/components/conversation/Explicable' import RuleInput from '@/components/conversation/RuleInput' +import Value from '@/components/EngineValue' import { useEngine } from '@/components/utils/EngineContext' import { Message } from '@/design-system' import { Button } from '@/design-system/buttons' diff --git a/site/source/pages/simulateurs/comparaison-statuts/components/DetailsRowCards.tsx b/site/source/pages/simulateurs/comparaison-statuts/components/DetailsRowCards.tsx index 401eec2d7..cbbcf33b7 100644 --- a/site/source/pages/simulateurs/comparaison-statuts/components/DetailsRowCards.tsx +++ b/site/source/pages/simulateurs/comparaison-statuts/components/DetailsRowCards.tsx @@ -11,7 +11,7 @@ import RuleLink from '@/components/RuleLink' import { HelpIcon } from '@/design-system/icons' import { Grid } from '@/design-system/layout' -import { OptionType, getBestOption } from '../utils' +import { getBestOption, OptionType } from '../utils' import StatusCard from './StatusCard' const getStatusLabelsArray = (statusArray: OptionType[]) => diff --git a/site/source/pages/simulateurs/comparaison-statuts/components/Détails.tsx b/site/source/pages/simulateurs/comparaison-statuts/components/Détails.tsx index 676ce9642..f0add8c8a 100644 --- a/site/source/pages/simulateurs/comparaison-statuts/components/Détails.tsx +++ b/site/source/pages/simulateurs/comparaison-statuts/components/Détails.tsx @@ -3,11 +3,11 @@ import { Trans } from 'react-i18next' import styled from 'styled-components' import { DottedName } from '@/../../modele-social' +import { ExplicableRule } from '@/components/conversation/Explicable' import Value, { WhenAlreadyDefined, WhenValueEquals, } from '@/components/EngineValue' -import { ExplicableRule } from '@/components/conversation/Explicable' import { Accordion, Item } from '@/design-system' import { Emoji } from '@/design-system/emoji' import { ExternalLinkIcon, PlusCircleIcon } from '@/design-system/icons' diff --git a/site/source/pages/simulateurs/comparaison-statuts/components/RevenuAprèsImpot.tsx b/site/source/pages/simulateurs/comparaison-statuts/components/RevenuAprèsImpot.tsx index ad570f6d2..f7630fd03 100644 --- a/site/source/pages/simulateurs/comparaison-statuts/components/RevenuAprèsImpot.tsx +++ b/site/source/pages/simulateurs/comparaison-statuts/components/RevenuAprèsImpot.tsx @@ -12,7 +12,7 @@ import { H2 } from '@/design-system/typography/heading' import { StyledLink } from '@/design-system/typography/link' import { Body } from '@/design-system/typography/paragraphs' -import { OptionType, getBestOption } from '../utils' +import { getBestOption, OptionType } from '../utils' import AllerPlusLoinRevenus from './AllerPlusLoinRevenus' import StatusCard from './StatusCard' import WarningTooltip from './WarningTooltip' diff --git a/site/source/pages/simulateurs/comparaison-statuts/contexts/CasParticuliers.tsx b/site/source/pages/simulateurs/comparaison-statuts/contexts/CasParticuliers.tsx index 4c679650d..052f94606 100644 --- a/site/source/pages/simulateurs/comparaison-statuts/contexts/CasParticuliers.tsx +++ b/site/source/pages/simulateurs/comparaison-statuts/contexts/CasParticuliers.tsx @@ -1,8 +1,8 @@ import { + createContext, Dispatch, ReactNode, SetStateAction, - createContext, useContext, useState, } from 'react' diff --git a/site/source/pages/simulateurs/impot-societe/index.tsx b/site/source/pages/simulateurs/impot-societe/index.tsx index 5c960dc11..a0209f0f3 100644 --- a/site/source/pages/simulateurs/impot-societe/index.tsx +++ b/site/source/pages/simulateurs/impot-societe/index.tsx @@ -3,6 +3,8 @@ import { useDispatch, useSelector } from 'react-redux' import styled from 'styled-components' import { TrackPage } from '@/components/ATInternetTracking' +import { StyledInputSuggestion } from '@/components/conversation/InputSuggestions' +import RuleInput from '@/components/conversation/RuleInput' import Value from '@/components/EngineValue' import Notifications from '@/components/Notifications' import { @@ -10,10 +12,8 @@ import { SimulationGoal, SimulationGoals, } from '@/components/Simulation' -import { StyledInputSuggestion } from '@/components/conversation/InputSuggestions' -import RuleInput from '@/components/conversation/RuleInput' -import Warning from '@/components/ui/WarningBlock' import { FromTop } from '@/components/ui/animate' +import Warning from '@/components/ui/WarningBlock' import { H2 } from '@/design-system/typography/heading' import { Link } from '@/design-system/typography/link' import { Body, Intro } from '@/design-system/typography/paragraphs' diff --git a/site/source/pages/simulateurs/index.tsx b/site/source/pages/simulateurs/index.tsx index 2a1d931bd..cf25deaea 100644 --- a/site/source/pages/simulateurs/index.tsx +++ b/site/source/pages/simulateurs/index.tsx @@ -2,8 +2,8 @@ import { useEffect, useMemo } from 'react' import { Trans } from 'react-i18next' import { Navigate, Route, Routes, useLocation } from 'react-router-dom' -import { ScrollToTop } from '@/components/utils/Scroll' import { usePersistingState } from '@/components/utils/persistState' +import { ScrollToTop } from '@/components/utils/Scroll' import { Link } from '@/design-system/typography/link' import { useIsEmbedded } from '@/hooks/useIsEmbedded' import useSimulatorsData from '@/hooks/useSimulatorsData' diff --git a/site/source/pages/simulateurs/indépendant/Indépendant.tsx b/site/source/pages/simulateurs/indépendant/Indépendant.tsx index 77b7eeaf5..f7bb9b63f 100644 --- a/site/source/pages/simulateurs/indépendant/Indépendant.tsx +++ b/site/source/pages/simulateurs/indépendant/Indépendant.tsx @@ -2,6 +2,7 @@ import { Trans } from 'react-i18next' import { useDispatch } from 'react-redux' import ChiffreAffairesActivitéMixte from '@/components/ChiffreAffairesActivitéMixte' +import RuleInput from '@/components/conversation/RuleInput' import { Condition } from '@/components/EngineValue' import PeriodSwitch from '@/components/PeriodSwitch' import RuleLink from '@/components/RuleLink' @@ -11,7 +12,6 @@ import Simulation, { SimulationGoal, SimulationGoals, } from '@/components/Simulation' -import RuleInput from '@/components/conversation/RuleInput' import IndépendantExplanation from '@/components/simulationExplanation/IndépendantExplanation' import { Message } from '@/design-system' import { Emoji } from '@/design-system/emoji' diff --git a/site/source/pages/simulateurs/metadata-src.ts b/site/source/pages/simulateurs/metadata-src.ts index f2b882c8a..bcf4903d0 100644 --- a/site/source/pages/simulateurs/metadata-src.ts +++ b/site/source/pages/simulateurs/metadata-src.ts @@ -4,9 +4,9 @@ import { choixStatutJuridiqueConfig } from '../assistants/choix-du-statut/choix- import { déclarationChargesSocialesIndépendantConfig } from '../assistants/declaration-charges-sociales-independant/config' import { déclarationRevenuIndépendantBetaConfig } from '../assistants/declaration-revenu-independants/config' import { demandeMobilitéConfig } from '../assistants/demande-mobilité/config' +import { économieCollaborativeConfig } from '../assistants/économie-collaborative/config' import { pourMonEntrepriseConfig } from '../assistants/pour-mon-entreprise/config' import { rechercheCodeApeConfig } from '../assistants/recherche-code-ape/config' -import { économieCollaborativeConfig } from '../assistants/économie-collaborative/config' import { PageConfig, SimulatorsDataParams } from './_configs/types' import { artisteAuteurConfig } from './artiste-auteur/config' import { autoEntrepreneurConfig } from './auto-entrepreneur/config' diff --git a/site/source/pages/statistiques/LazyStats.tsx b/site/source/pages/statistiques/LazyStats.tsx index 39bc3b527..293d2cace 100644 --- a/site/source/pages/statistiques/LazyStats.tsx +++ b/site/source/pages/statistiques/LazyStats.tsx @@ -1,10 +1,10 @@ -import { Suspense, lazy, useState } from 'react' +import { lazy, Suspense, useState } from 'react' import { useTranslation } from 'react-i18next' import { TrackPage } from '@/components/ATInternetTracking' +import Privacy from '@/components/layout/Footer/Privacy' import MoreInfosOnUs from '@/components/MoreInfosOnUs' import PageHeader from '@/components/PageHeader' -import Privacy from '@/components/layout/Footer/Privacy' import Meta from '@/components/utils/Meta' import { ScrollToTop } from '@/components/utils/Scroll' import { Message } from '@/design-system' diff --git a/site/source/pages/statistiques/StatsDetail.tsx b/site/source/pages/statistiques/StatsDetail.tsx index 693c49780..b2a47f0db 100644 --- a/site/source/pages/statistiques/StatsDetail.tsx +++ b/site/source/pages/statistiques/StatsDetail.tsx @@ -9,9 +9,9 @@ import { toAtString } from '@/components/ATInternetTracking' import PagesChart from '@/components/charts/PagesCharts' import { useScrollToHash } from '@/components/utils/markdown' import { Item, Message, Radio, ToggleGroup } from '@/design-system' -import InfoBulle from '@/design-system/InfoBulle' import { Emoji } from '@/design-system/emoji' import { Select } from '@/design-system/field/Select' +import InfoBulle from '@/design-system/InfoBulle' import { Grid, Spacing } from '@/design-system/layout' import { H2, H3 } from '@/design-system/typography/heading' import { Body } from '@/design-system/typography/paragraphs' diff --git a/site/source/store/reducers/rootReducer.ts b/site/source/store/reducers/rootReducer.ts index 24fb1c6c4..f66c12350 100644 --- a/site/source/store/reducers/rootReducer.ts +++ b/site/source/store/reducers/rootReducer.ts @@ -1,6 +1,6 @@ import { DottedName } from 'modele-social' import reduceReducers from 'reduce-reducers' -import { Reducer, combineReducers } from 'redux' +import { combineReducers, Reducer } from 'redux' import { SimulationConfig, Situation } from '@/pages/simulateurs/_configs/types' import { Action } from '@/store/actions/actions' diff --git a/site/source/store/store.ts b/site/source/store/store.ts index c2ed53b9c..4246c009e 100644 --- a/site/source/store/store.ts +++ b/site/source/store/store.ts @@ -1,6 +1,6 @@ import { composeWithDevToolsDevelopmentOnly } from '@redux-devtools/extension' import { createReduxEnhancer } from '@sentry/react' -import { StoreEnhancer, applyMiddleware, createStore } from 'redux' +import { applyMiddleware, createStore, StoreEnhancer } from 'redux' import reducers from '@/store/reducers/rootReducer' diff --git a/site/source/utils/index.ts b/site/source/utils/index.ts index 7480b078d..0af8b0509 100644 --- a/site/source/utils/index.ts +++ b/site/source/utils/index.ts @@ -1,10 +1,10 @@ import { DottedName } from 'modele-social' import Engine, { + formatValue, + isPublicodesError, PublicodesExpression, Rule, RuleNode, - formatValue, - isPublicodesError, } from 'publicodes' import { Situation } from '@/store/reducers/rootReducer' diff --git a/site/vite-build-simulation-data.config.ts b/site/vite-build-simulation-data.config.ts index 1508b2ef6..b7369eadf 100644 --- a/site/vite-build-simulation-data.config.ts +++ b/site/vite-build-simulation-data.config.ts @@ -1,5 +1,6 @@ import { unlinkSync, writeFileSync } from 'fs' import path from 'path' + import { defineConfig } from 'vite' import { PageConfig } from '@/pages/simulateurs/_configs/types' diff --git a/site/vite-iframe-script.config.ts b/site/vite-iframe-script.config.ts index c62ab353c..ef141bbd2 100644 --- a/site/vite-iframe-script.config.ts +++ b/site/vite-iframe-script.config.ts @@ -1,6 +1,7 @@ -import yaml from '@rollup/plugin-yaml' import { statSync } from 'fs' import path from 'path' + +import yaml from '@rollup/plugin-yaml' import { defineConfig } from 'vite' import { VitePWA } from 'vite-plugin-pwa' diff --git a/site/vite.config.ts b/site/vite.config.ts index ec822f9ee..e54ef5ad3 100644 --- a/site/vite.config.ts +++ b/site/vite.config.ts @@ -1,12 +1,13 @@ /* eslint-disable no-console */ +import fs from 'fs/promises' +import path from 'path' + import replace from '@rollup/plugin-replace' import yaml, { ValidYamlType } from '@rollup/plugin-yaml' import legacy from '@vitejs/plugin-legacy' import react from '@vitejs/plugin-react-swc' -import fs from 'fs/promises' -import path from 'path' import serveStatic from 'serve-static' -import { Plugin, defineConfig, loadEnv } from 'vite' +import { defineConfig, loadEnv, Plugin } from 'vite' import { VitePWA } from 'vite-plugin-pwa' import { runScriptOnFileChange } from './scripts/runScriptOnFileChange'