Skip to content

Commit 14d1a54

Browse files
committed
fix(eslint): Remove unnecessary type assertions
Removed unnecessary type assertions that were flagged by ESLint: - inputField.tsx: Removed `as any` from e.target.value - numberField.tsx: Removed `as any` from e.target.value - onboarding.tsx: Removed `as number` assertions from stepper onClick handler These assertions were unnecessary because TypeScript already infers the correct types from the event handlers and component props.
1 parent 6f2985e commit 14d1a54

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

static/app/components/forms/fields/inputField.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ function defaultField({
4949
<InputGroup>
5050
<InputGroup.Input
5151
onBlur={e => onBlur(e.target.value, e)}
52-
onKeyDown={e => onKeyDown((e.target as any).value, e)}
52+
onKeyDown={e => onKeyDown(e.target.value, e)}
5353
onChange={e => onChange(e.target.value, e)}
5454
name={name}
5555
{...rest}

static/app/components/forms/fields/numberField.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ function createFieldWithSuffix({suffix}: {suffix: React.ReactNode}) {
6262
<InputGroup>
6363
<InputGroup.Input
6464
onBlur={e => onBlur(e.target.value, e)}
65-
onKeyDown={e => onKeyDown((e.target as any).value, e)}
65+
onKeyDown={e => onKeyDown(e.target.value, e)}
6666
onChange={e => onChange(e.target.value, e)}
6767
name={name}
6868
{...rest}

static/app/views/onboarding/onboarding.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -215,12 +215,12 @@ export function OnboardingWithoutContext(props: Props) {
215215
numSteps={onboardingSteps.length}
216216
currentStepIndex={stepIndex}
217217
onClick={i => {
218-
if ((i as number) < stepIndex && shallProjectBeDeleted) {
219-
handleGoBack(i as number);
218+
if (i < stepIndex && shallProjectBeDeleted) {
219+
handleGoBack(i);
220220
return;
221221
}
222222

223-
goToStep(onboardingSteps[i as number]!);
223+
goToStep(onboardingSteps[i]!);
224224
}}
225225
/>
226226
)}

0 commit comments

Comments
 (0)