From e263400205524a55bb0f9c67950b234d7e39259d Mon Sep 17 00:00:00 2001 From: Quentin Ruhier Date: Mon, 16 Sep 2024 17:33:19 +0200 Subject: [PATCH] chore: eslint config & fix errors --- .eslintrc.yaml | 4 ++++ .../rich-textarea/hoc/with-conditions.jsx | 19 ------------------- .../__snapshots__/drop-zone.spec.jsx.snap | 13 ------------- .../active-components-by-id.spec.jsx | 1 + src/utils/dictionary/dictionary.spec.jsx | 1 + .../variables/calculated-variables.jsx | 6 +++--- 6 files changed, 9 insertions(+), 35 deletions(-) delete mode 100644 src/forms/controls/rich-textarea/hoc/with-conditions.jsx diff --git a/.eslintrc.yaml b/.eslintrc.yaml index 3f13bab22..c4d51b373 100644 --- a/.eslintrc.yaml +++ b/.eslintrc.yaml @@ -23,6 +23,9 @@ env: rules: indent: 0 + default-param-last: 0 + no-restricted-exports: 0 + prefer-regex-literals: 0 func-style: 0 func-names: 0 comma-dangle: 0 @@ -38,6 +41,7 @@ rules: react/jsx-filename-extension: 0 react/prefer-stateless-function: 0 react/no-children-prop: 0 + react/function-component-definition: 0 react/forbid-prop-types: 0 react/react-in-jsx-scope: 0 react/no-unescaped-entities: 0 diff --git a/src/forms/controls/rich-textarea/hoc/with-conditions.jsx b/src/forms/controls/rich-textarea/hoc/with-conditions.jsx deleted file mode 100644 index a7dc40db4..000000000 --- a/src/forms/controls/rich-textarea/hoc/with-conditions.jsx +++ /dev/null @@ -1,19 +0,0 @@ -import React from 'react'; - -import { DEFAULT_FORM_NAME } from '../../../../constants/pogues-constants'; -import { storeToArray, nestedStoreToFlat } from '../../../../utils/utils'; - -/** - * High order component - * - * @param ComponentToWrap - * @returns - */ -const withConditions = ComponentToWrap => { - const withConditionsComponent = props => ; - - return connect(mapStateToProps(formName))(withConditionsComponent); -}; - -// Don't use hoc directly in render -export default withConditions; diff --git a/src/layout/questionnaire-list-components/components/drop-zone/__snapshots__/drop-zone.spec.jsx.snap b/src/layout/questionnaire-list-components/components/drop-zone/__snapshots__/drop-zone.spec.jsx.snap index 3706c6742..b3e4c227d 100644 --- a/src/layout/questionnaire-list-components/components/drop-zone/__snapshots__/drop-zone.spec.jsx.snap +++ b/src/layout/questionnaire-list-components/components/drop-zone/__snapshots__/drop-zone.spec.jsx.snap @@ -12,16 +12,3 @@ exports[`DropZone > Should have this default template 1`] = ` `; - -exports[`DropZone Should have this default template 1`] = ` -
-
- Drop here ! -
-
-`; diff --git a/src/reducers/app-state/active-components-by-id.spec.jsx b/src/reducers/app-state/active-components-by-id.spec.jsx index 1f1d0d632..b3520568f 100644 --- a/src/reducers/app-state/active-components-by-id.spec.jsx +++ b/src/reducers/app-state/active-components-by-id.spec.jsx @@ -1,3 +1,4 @@ +import { describe, expect, test } from 'vitest'; import actionsHandlers, { setActiveComponents, updateActiveComponents, diff --git a/src/utils/dictionary/dictionary.spec.jsx b/src/utils/dictionary/dictionary.spec.jsx index acc51588d..edcedfb9b 100644 --- a/src/utils/dictionary/dictionary.spec.jsx +++ b/src/utils/dictionary/dictionary.spec.jsx @@ -1,3 +1,4 @@ +import { expect, test } from 'vitest'; import { createDictionary, getLang } from './dictionary'; ['browserLanguage', 'language'].forEach(property => { diff --git a/src/widgets/component-new-edit/components/variables/calculated-variables.jsx b/src/widgets/component-new-edit/components/variables/calculated-variables.jsx index 976f59405..4ac9410c0 100644 --- a/src/widgets/component-new-edit/components/variables/calculated-variables.jsx +++ b/src/widgets/component-new-edit/components/variables/calculated-variables.jsx @@ -13,9 +13,9 @@ import Input from '../../../../forms/controls/input'; import { SimpleEditorWithVariable } from '../../../../forms/controls/control-with-suggestions'; import { ListWithInputPanel } from '../../../list-with-input-panel'; import { validateCalculatedVariableForm } from '../../../../utils/validation/validate'; -import ResponseFormatDatatypeNumeric from '../../components/response-format/simple/simple-numeric'; -import ResponseFormatDatatypeText from '../../components/response-format/simple/simple-text'; -import ResponseFormatDatatypeDate from '../../components/response-format/simple/simple-date'; +import ResponseFormatDatatypeNumeric from '../response-format/simple/simple-numeric'; +import ResponseFormatDatatypeText from '../response-format/simple/simple-text'; +import ResponseFormatDatatypeDate from '../response-format/simple/simple-date'; import Dictionary from '../../../../utils/dictionary/dictionary'; import { SelectorView, View } from '../../../selector-view';