Skip to content

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

Draft
zamotany wants to merge 1 commit intomainfrom
fix/no-unused-vars-ignoreRestSiblings
Draft

fix: add missing ignoreRestSiblings to allow to omit values#245
zamotany wants to merge 1 commit intomainfrom
fix/no-unused-vars-ignoreRestSiblings

Conversation

@zamotany
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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