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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: add missing ignoreRestSiblings to allow to omit values #245

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

zamotany
Copy link
Contributor

Summary

Add missing ignoreRestSiblings to allow to omit values in destructuring assignment.

Without ignoreRestSiblings: true this code fails:

const { modalDialogs: _, ...rest } = (params ?? {}) as InternalParams;
// error  '_' is assigned a value but never used  @typescript-eslint/no-unused-vars

@zamotany zamotany requested a review from thymikee April 21, 2022 14:57
@zamotany zamotany marked this pull request as draft April 21, 2022 15:01
@zamotany
Copy link
Contributor Author

Edit:

ignoreRestSiblings: true will not require values to have to be renamed to ^_, eg:

const { modalDialogs, ...rest } = (params ?? {}) as InternalParams;

will pass w/o errors.

@thymikee
Copy link
Member

Will this ignore unused props when being unused as well?

function Component({ prop1, prop2 }: Props) { 
  return prop1 
}

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

Successfully merging this pull request may close these issues.

None yet

2 participants