Skip to content
This repository has been archived by the owner on Mar 25, 2021. It is now read-only.

Add no-unnecessary-callback-wrapper rule #2249

Merged
merged 1 commit into from
Mar 6, 2017

Conversation

andy-hanson
Copy link
Contributor

@andy-hanson andy-hanson commented Feb 26, 2017

PR checklist

  • Addresses an existing issue: #0000
  • New feature, bugfix, or enhancement
    • Includes tests
  • Documentation update

Overview of change:

Added the no-redundant-callback rule, which warns on x => f(x) (prefer just f).

CHANGELOG.md entry:

[new-rule] no-unnecessary-callback-wrapper

@ajafff
Copy link
Contributor

ajafff commented Mar 2, 2017

As always, I need to bikeshed about the rule name.
"redundant callback" means this to me:

function foo(cb: () => void) {
    cb();
    cb();
    ~~~~~ [redundant callback]
}

I'd rather change the name to something like no-unnecessary-wrapper(-function)?

@IllusionMH
Copy link
Contributor

Or no-unnecessary-callback-wrapper

@andy-hanson andy-hanson changed the title Add no-redundant-callback rule Add no-unnecessary-callback-wrapper rule Mar 5, 2017
Copy link
Contributor

@nchen63 nchen63 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good. Thanks

@nchen63 nchen63 merged commit b835dbc into palantir:master Mar 6, 2017
@adidahiya
Copy link
Contributor

👍 let's include this in tslint:latest

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

Successfully merging this pull request may close these issues.

5 participants