diff --git a/.eslintrc.cjs b/.eslintrc.cjs index 3332afe8f..97750c00d 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -64,7 +64,9 @@ module.exports = { ], plugins: ['@typescript-eslint', 'react', 'react-hooks'], rules: { + 'no-void': 'off', 'ban-ts-comment': 'off', + 'no-use-before-define': 'off', 'react/no-unescaped-entities': 'off', 'react/jsx-no-target-blank': 'off', '@typescript-eslint/ban-ts-comment': 'off', diff --git a/site/source/api/sirene.ts b/site/source/api/sirene.ts index 5c17baf48..a7618f592 100644 --- a/site/source/api/sirene.ts +++ b/site/source/api/sirene.ts @@ -53,16 +53,16 @@ async function searchFullText( if (!response.ok) { return null } - const json: SireneData = await response.json() + const json = (await response.json()) as SireneData const etablissements = json.etablissement .filter( - ({ is_siege, categorie_entreprise, activite_principale }) => - categorie_entreprise !== 'ETI' && - is_siege === '1' && - activite_principale !== '8411Z' + (data) => + data.categorie_entreprise !== 'ETI' && + data.is_siege === '1' && + data.activite_principale !== '8411Z' ) - .map(({ l1_normalisee, siren }) => ({ - denomination: l1_normalisee, + .map(({ l1_normalisee: denomination, siren }) => ({ + denomination, siren, })) diff --git a/site/source/components/Notifications.tsx b/site/source/components/Notifications.tsx index 6279c82ce..fe9b3bdc7 100644 --- a/site/source/components/Notifications.tsx +++ b/site/source/components/Notifications.tsx @@ -71,7 +71,7 @@ export default function Notifications() { {messages.map(({ sévérité, dottedName, résumé, description }) => ( {résumé ?? description ?? ''}{' '} diff --git a/site/source/components/SchemeComparaison.tsx b/site/source/components/SchemeComparaison.tsx index 53698f6fc..d2ca65228 100644 --- a/site/source/components/SchemeComparaison.tsx +++ b/site/source/components/SchemeComparaison.tsx @@ -50,8 +50,7 @@ export default function SchemeComparaison({ const situation = useSelector(situationSelector) const displayResult = - useSelector(situationSelector)['dirigeant . rémunération . totale'] != - undefined + useSelector(situationSelector)['dirigeant . rémunération . totale'] != null const assimiléEngine = useMemo( () => engine.shallowCopy().setSituation({ diff --git a/site/source/components/SimulateurWarning.tsx b/site/source/components/SimulateurWarning.tsx index 1b326d223..98eccd5d2 100644 --- a/site/source/components/SimulateurWarning.tsx +++ b/site/source/components/SimulateurWarning.tsx @@ -22,7 +22,7 @@ export default function SimulateurWarning({ localStorageKey={'app::simulateurs:warning-folded:v1:' + simulateur} >