Skip to content

Latest commit

 

History

History
50 lines (26 loc) · 842 Bytes

jquery-each.md

File metadata and controls

50 lines (26 loc) · 842 Bytes

Standardize on either Underscore's or jQuery's each function (jquery-each)

Both Underscore and jQuery implement an each function. For consistency, you may want to standardize on one over the other.

Rule Details

never (default)

jquery-each: [2, "never"]

The following patterns are considered warnings:

$.each([], function(key, value){ return value % 2; });

The following patterns are not warnings:

_.each([], function(value, key){ return value % 2; });

always

jquery-each: [2, "always"]

The following patterns are considered warnings:

_.each([], function(value, key){ return value % 2; });

The following patterns are not warnings:

$.each([], function(key, value){ return value % 2; });

Options

This rule has two modes: never (the default), and always.