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

feat(typescript): allow unused vars starting with underscores #111

Merged
merged 1 commit into from Jul 4, 2019

Conversation

francoischalifour
Copy link
Member

Description

Keeping an unused variable in a function signature is sometimes useful to know what data we're dealing with. A common pattern is to prefix this variable with _ to make it explicit that it's not used but it's usable. This pattern is used in the InstantSearch codebases.

This rule is already used in the InstantSearch.js ESLint configuration.

Examples

function example(start: number): number[] {
  const values = ['a', 'b', 'c'];

  return values.map((_, index) => start + index);
}

@samouss samouss merged commit b3fcb88 into master Jul 4, 2019
@samouss samouss deleted the feat/allow-unused-vars-underscore branch July 4, 2019 21:39
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

3 participants