Skip to content

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.

2 participants