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.馃榾


export const SelectProps = buildProps({
export const selectProps = buildProps({
Copy link
Collaborator

Choose a reason for hiding this comment

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

It may be better to keep the first letter capitalized here, otherwise it will be a breaking change for users who use related values.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You are right.

@@ -248,7 +255,7 @@ export const SelectProps = buildProps({
...useAriaProps(['ariaLabel']),
} as const)

export const OptionProps = buildProps({
export const optionProps = buildProps({
Copy link
Collaborator

Choose a reason for hiding this comment

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

Same here.

@@ -190,7 +220,7 @@ export default defineComponent({
}

const onEscOrTab = () => {
select.expanded = false
select.expanded.value = false
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is there a bug here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yep, it should indeed not be modified in this PR, causing confusion. I will revert it.

@@ -1,3 +1,5 @@
import type { Nullable } from '@element-plus/utils'
Copy link
Collaborator

Choose a reason for hiding this comment

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

Maybe Nullable should no longer be used here, as it will be deprecated later.

expanded: boolean
tooltipRef: Ref<TooltipInstance>
props: ExtractPropTypes<typeof selectProps>
expanded: Ref<boolean>
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why has the type changed here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

For select.expanded.value = false

@@ -18,7 +18,7 @@ export const defaultProps: Required<Props> = {
options: 'options',
}

export function useProps(props: Pick<ISelectV2Props, 'props'>) {
export function useProps(props: ISelectV2Props) {
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 change here. Only props.props is used below, and only the corresponding types are extracted.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think the type should match the runtime value. Anyway, it doesn't matter. I'm fine with both.

import type { ISelectV2Props } from './token'
import type { SelectEmitFn } from './defaults'
import type { TooltipInstance } from '@element-plus/components/tooltip'
import type { Nullable } from '@element-plus/utils/typescript'
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nullable should no longer be used.

@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
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