From edcb2613f11a8e2cbe405e90725f16d2e0984599 Mon Sep 17 00:00:00 2001 From: Eric Schultz Date: Thu, 22 Oct 2020 14:27:07 -0500 Subject: [PATCH] Add @typescript-eslint/member-delimiter-style to eslint --- .eslintrc.js | 12 ++++++++ .../components/formik/MoneyTextField.spec.tsx | 2 +- .../components/formik/MoneyTextField.tsx | 2 +- app/javascript/hooks/useSteps.spec.ts | 20 ++++++------- app/javascript/hooks/useSteps.ts | 28 +++++++++---------- 5 files changed, 38 insertions(+), 26 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index f9f4cd97..7eaf5062 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -116,6 +116,18 @@ const tsBase = { }, }, ], + '@typescript-eslint/member-delimiter-style': ['error', + { + "multiline": { + "delimiter": "semi", + "requireLast": true, + }, + "singleline": { + "delimiter": "comma", + "requireLast": false, + }, + }, + ], }, }; diff --git a/app/javascript/components/formik/MoneyTextField.spec.tsx b/app/javascript/components/formik/MoneyTextField.spec.tsx index 93df90c3..f9cfdef3 100644 --- a/app/javascript/components/formik/MoneyTextField.spec.tsx +++ b/app/javascript/components/formik/MoneyTextField.spec.tsx @@ -26,7 +26,7 @@ function FormikInner(props: { onChange:(args:{value:Money})=> void}) { ; } -function FormikHandler(props: { onChange:(args:{value:Money})=> void, value: Money,}) { +function FormikHandler(props: { onChange:(args:{value:Money})=> void, value: Money}) { const {value, ...innerFormikProps} = props; return diff --git a/app/javascript/components/formik/MoneyTextField.tsx b/app/javascript/components/formik/MoneyTextField.tsx index cb92d361..8f5d247b 100644 --- a/app/javascript/components/formik/MoneyTextField.tsx +++ b/app/javascript/components/formik/MoneyTextField.tsx @@ -12,7 +12,7 @@ import {useI18nCurrencyInput, Types} from '@houdiniproject/react-i18n-currency-i import '../../common/intl-polyfills/numberFormat'; export interface UseSerializeMoneyProps extends Omit { - value:Money + value:Money; } /** diff --git a/app/javascript/hooks/useSteps.spec.ts b/app/javascript/hooks/useSteps.spec.ts index 67a9504e..2349e3da 100644 --- a/app/javascript/hooks/useSteps.spec.ts +++ b/app/javascript/hooks/useSteps.spec.ts @@ -345,18 +345,18 @@ describe('.enable', () => { describe('modify steps', () => { function createTableEntry(props: { expectation: { - activeStep?: number, - completed?: KeyedStepMap, - disabled?: KeyedStepMap, - }, + activeStep?: number; + completed?: KeyedStepMap; + disabled?: KeyedStepMap; + }; initial: { - activeStep?: number, + activeStep?: number; completed?: - KeyedStepMap - disabled?: KeyedStepMap, - steps: KeyedStep[], - }, - stepChange: KeyedStep[], + KeyedStepMap; + disabled?: KeyedStepMap; + steps: KeyedStep[]; + }; + stepChange: KeyedStep[]; } ): [ KeyedStep[], number | undefined, KeyedStepMap | undefined, KeyedStepMap | undefined, // initial diff --git a/app/javascript/hooks/useSteps.ts b/app/javascript/hooks/useSteps.ts index b56cd10f..155fce10 100644 --- a/app/javascript/hooks/useSteps.ts +++ b/app/javascript/hooks/useSteps.ts @@ -13,7 +13,7 @@ export interface KeyedStep { } export interface KeyedStepMap { - [stepKey: string]: T + [stepKey: string]: T; } interface ReadonlyStepsState { @@ -24,7 +24,7 @@ interface ReadonlyStepsState { /** * An internal copy of steps which only includes the key */ - readonly stepKeys: readonly string[] + readonly stepKeys: readonly string[]; } @@ -114,25 +114,25 @@ interface StepsInitOptions { interface InputStepsState extends Readonly { - readonly steps: readonly KeyedStep[] + readonly steps: readonly KeyedStep[]; } interface InputStepsMethods { - addStep: (step: KeyedStep, before?: number) => void - removeStep: (step: KeyedStep) => void + addStep: (step: KeyedStep, before?: number) => void; + removeStep: (step: KeyedStep) => void; } interface MutableStepsObject extends InputStepsMethods { - back: () => void - complete: (step: number) => void - disable: (step: number) => void - enable: (step: number) => void - first: () => void - goto: (step: number) => void - last: () => void - next: () => void - uncomplete: (step: number) => void + back: () => void; + complete: (step: number) => void; + disable: (step: number) => void; + enable: (step: number) => void; + first: () => void; + goto: (step: number) => void; + last: () => void; + next: () => void; + uncomplete: (step: number) => void; } type StepsObject = Readonly & Readonly & StepsInitOptions & { readonly steps: readonly KeyedStep[] }