Skip to content

Latest commit

 

History

History
32 lines (16 loc) · 536 Bytes

prefer-noop.md

File metadata and controls

32 lines (16 loc) · 536 Bytes

Prefer noop

When defining an empty function (e.g. for callbacks) it can be more readable to use _.noop instead

Rule Details

This rule takes no arguments.

The following patterns are considered warnings:

functionWithCallback(function(){});

const emptyFunction = ()=> {};

The following patterns are not considered warnings:

functionWithCallback(function(x){return x + 1});

const sqr = x => x * x;
 

When Not To Use It

If you do not want to enforce using _.noop, you should not use this rule.