Skip to content

Expand no unused vars rule#15704

Merged
kimadeline merged 2 commits intomicrosoft:mainfrom
kimadeline:expand-no-unused-vars-rule
Mar 19, 2021
Merged

Expand no unused vars rule#15704
kimadeline merged 2 commits intomicrosoft:mainfrom
kimadeline:expand-no-unused-vars-rule

Conversation

@kimadeline
Copy link
Copy Markdown

@kimadeline kimadeline commented Mar 18, 2021

Amend the @typescript-eslint/no-unused-vars rule to ignore all unused positional arguments that start with an underscore and are placed after the last used argument (see the description here). This also means that we don't need to add an ignore directive for code like this anymore:

function foo(x, _y) {​​​​​​​
    return x + 1;
}​​​​​​​​​​​​​​

Cleaned up the 44 no-unused-vars ignore comments in the codebase as well.

@kimadeline kimadeline added the no-changelog No news entry required label Mar 18, 2021
@kimadeline kimadeline marked this pull request as ready for review March 19, 2021 15:06
@kimadeline kimadeline merged commit 630c75d into microsoft:main Mar 19, 2021
@kimadeline kimadeline deleted the expand-no-unused-vars-rule branch March 19, 2021 17:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no-changelog No news entry required

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants