3
3
var Checker = require ( "jscs" ) ,
4
4
jscsConfig = require ( "jscs/lib/cli-config" ) ,
5
5
6
- assign = require ( "lodash" ) . assign ,
6
+ _ = require ( "lodash" ) ,
7
7
hooker = require ( "hooker" ) ;
8
8
9
9
exports . init = function ( grunt ) {
10
10
11
11
// Task specific options
12
12
var taskOptions = [ "config" , "force" , "reporter" , "reporterOutput" ] ;
13
13
14
- /**
15
- * @see jQuery.isEmptyObject
16
- * @private
17
- */
18
- function isEmptyObject ( obj ) {
19
- var name ;
20
-
21
- for ( name in obj ) {
22
- return false ;
23
- }
24
-
25
- return true ;
26
- }
27
-
28
14
/**
29
15
* Default reporter
30
16
* @private
@@ -81,11 +67,11 @@ exports.init = function( grunt ) {
81
67
82
68
// If the config option is null, but we have inline options,
83
69
// we'll only use them as our config.
84
- if ( configOption == null && ! isEmptyObject ( options ) ) {
70
+ if ( configOption == null && ! _ . isEmpty ( options ) ) {
85
71
config = options ;
86
72
87
73
} else {
88
- assign ( config , options ) ;
74
+ _ . assign ( config , options ) ;
89
75
}
90
76
91
77
this . throwForConfig ( config ) ;
@@ -100,7 +86,7 @@ exports.init = function( grunt ) {
100
86
JSCS . prototype . throwForConfig = function ( config ) {
101
87
var configOption = this . options . config ;
102
88
103
- if ( isEmptyObject ( config ) ) {
89
+ if ( _ . isEmpty ( config ) ) {
104
90
if ( configOption && typeof configOption === "string" ) {
105
91
if ( grunt . file . exists ( configOption ) ) {
106
92
grunt . fatal ( "\"" + configOption + "\" config is empty" ) ;
0 commit comments