Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: remove ts-nocheck comments in select-v2 #16746

Open
wants to merge 4 commits into
base: dev
Choose a base branch
from

Conversation

makedopamine
Copy link
Contributor

No description provided.

Copy link

馃憢 @makedopamine, thank you for contributing element-plus.

  • You can comment with /label Components:[component_name] to add a label for which component you are working on.
  • You may join our Discord for staying tuned.

Copy link

github-actions bot commented May 2, 2024

Copy link

github-actions bot commented May 2, 2024

Hello @makedopamine, thank you for contributing to element-plus, please see our guideline to see how to make contribution

Copy link

github-actions bot commented May 2, 2024

馃И Playground Preview: https://element-plus.run/?pr=16746
Please comment the example via this playground if needed.

@warmthsea
Copy link
Contributor

Found hundreds of @ts-nochecks. 馃憖

@makedopamine
Copy link
Contributor Author

Found hundreds of @ts-nochecks. 馃憖

I actually notice the problem what you say, however, its workload is somewhat heavy to address it completely in a single PR. And I think a large PR is hard for reviewers to review, so I prefer to split the task into separate PRs.
I'll work on select component next. It would be nice if you are interested in working on other components.馃榾

packages/components/select-v2/src/defaults.ts Outdated Show resolved Hide resolved
packages/components/select-v2/src/defaults.ts Outdated Show resolved Hide resolved
packages/components/select-v2/src/select-dropdown.tsx Outdated Show resolved Hide resolved
packages/components/select-v2/src/select.types.ts Outdated Show resolved Hide resolved
packages/components/select-v2/src/token.ts Show resolved Hide resolved
packages/components/select-v2/src/useProps.ts Outdated Show resolved Hide resolved
packages/components/select-v2/src/useSelect.ts Outdated Show resolved Hide resolved
@makedopamine
Copy link
Contributor Author

Thanks for your review. There's been a modification, please take a look.

@makedopamine
Copy link
Contributor Author

I pushed a new commit, kindly take note.

@makedopamine makedopamine force-pushed the chore/selectv2_remove_tsnocheck branch from b10e785 to 31abd48 Compare May 13, 2024 13:56
index: Number,
index: {
type: Number,
required: true,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is setting required required here?

},
height: {
type: Number,
required: true,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

required is necessary ?

loading: Boolean,
data: {
type: Array,
required: true as const,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as const seems unnecessary.

}
export const optionEmits = {
// eslint-disable-next-line @typescript-eslint/no-unused-vars
hover: (index: number) => true,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
hover: (index: number) => true,
hover: (index: number) => isNumber(index),

visibleChange: (visible: boolean) => true,
clear: () => true,
// eslint-disable-next-line @typescript-eslint/no-unused-vars
focus: (event: FocusEvent) => true,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
focus: (event: FocusEvent) => true,
focus: (event: FocusEvent) => event instanceof FocusEvent,

// eslint-disable-next-line vue/return-in-computed-property
const validateIcon = computed(() => {
if (!validateState.value) return
return ValidateComponentsMap[validateState.value]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There seems to be no need to add additional judgment here. If validateState.value does not exist, the returned value should also be undefined.

__: any,
// eslint-disable-next-line @typescript-eslint/no-unused-vars
___: any
): Record<string, T> => ({})
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems that there is no need to add so many comments here, using as should be fine.

const _getItemStyleCache = (_: any, __: any, ___: any) =>
 ({} as Record<string, T>)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants