Skip to content

Commit 373ee18

Browse files
committed
Build: Fix formatting according to JSCS rules
1 parent 7fa34f3 commit 373ee18

File tree

4 files changed

+41
-35
lines changed

4 files changed

+41
-35
lines changed

Gruntfile.js

Lines changed: 33 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ module.exports = function( grunt ) {
33
"use strict";
44

55
var
6+
67
// files
78
coreFiles = [
89
"core.js",
@@ -16,11 +17,11 @@ var
1617
"effect.js"
1718
],
1819

19-
uiFiles = coreFiles.map(function( file ) {
20+
uiFiles = coreFiles.map( function( file ) {
2021
return "ui/" + file;
21-
}).concat( expandFiles( "ui/**/*.js" ).filter(function( file ) {
22+
} ).concat( expandFiles( "ui/**/*.js" ).filter( function( file ) {
2223
return coreFiles.indexOf( file.substring( 3 ) ) === -1;
23-
}) ),
24+
} ) ),
2425

2526
allI18nFiles = expandFiles( "ui/i18n/*.js" ),
2627

@@ -45,9 +46,9 @@ var
4546
"tabs",
4647
"tooltip",
4748
"theme"
48-
].map(function( component ) {
49+
].map( function( component ) {
4950
return "themes/base/" + component + ".css";
50-
}),
51+
} ),
5152

5253
// minified files
5354
minify = {
@@ -92,28 +93,30 @@ function mapMinFile( file ) {
9293
}
9394

9495
function expandFiles( files ) {
95-
return grunt.util._.pluck( grunt.file.expandMapping( files ), "src" ).map(function( values ) {
96+
return grunt.util._.pluck( grunt.file.expandMapping( files ), "src" ).map( function( values ) {
9697
return values[ 0 ];
97-
});
98+
} );
9899
}
99100

100-
uiFiles.concat( allI18nFiles ).forEach(function( file ) {
101+
uiFiles.concat( allI18nFiles ).forEach( function( file ) {
101102
minify[ file ] = {
102103
options: {
103104
banner: createBanner()
104105
},
105106
files: {}
106107
};
107108
minify[ file ].files[ mapMinFile( file ) ] = file;
108-
});
109+
} );
110+
111+
uiFiles.forEach( function( file ) {
109112

110-
uiFiles.forEach(function( file ) {
111113
// TODO this doesn't do anything until https://github.com/rwldrn/grunt-compare-size/issues/13
112114
compareFiles[ file ] = [ file, mapMinFile( file ) ];
113-
});
115+
} );
114116

115117
// grunt plugins
116118
require( "load-grunt-tasks" )( grunt );
119+
117120
// local testswarm and build tasks
118121
grunt.loadTasks( "build/tasks" );
119122

@@ -122,17 +125,18 @@ function stripDirectory( file ) {
122125
}
123126

124127
function createBanner( files ) {
128+
125129
// strip folders
126130
var fileNames = files && files.map( stripDirectory );
127131
return "/*! <%= pkg.title || pkg.name %> - v<%= pkg.version %> - " +
128132
"<%= grunt.template.today('isoDate') %>\n" +
129133
"<%= pkg.homepage ? '* ' + pkg.homepage + '\\n' : '' %>" +
130-
(files ? "* Includes: " + fileNames.join(", ") + "\n" : "") +
134+
( files ? "* Includes: " + fileNames.join( ", " ) + "\n" : "" ) +
131135
"* Copyright <%= pkg.author.name %>;" +
132136
" Licensed <%= _.pluck(pkg.licenses, 'type').join(', ') %> */\n";
133137
}
134138

135-
grunt.initConfig({
139+
grunt.initConfig( {
136140
pkg: grunt.file.readJSON( "package.json" ),
137141
files: {
138142
dist: "<%= pkg.name %>-<%= pkg.version %>"
@@ -166,7 +170,7 @@ grunt.initConfig({
166170
include: expandFiles( [ "ui/**/*.js", "!ui/core.js", "!ui/i18n/*" ] ),
167171
out: "dist/jquery-ui.js",
168172
wrap: {
169-
start: createBanner( uiFiles ),
173+
start: createBanner( uiFiles )
170174
}
171175
}
172176
}
@@ -215,9 +219,9 @@ grunt.initConfig({
215219
}
216220
},
217221
qunit: {
218-
files: expandFiles( "tests/unit/" + component + "/*.html" ).filter(function( file ) {
222+
files: expandFiles( "tests/unit/" + component + "/*.html" ).filter( function( file ) {
219223
return !( /(all|index|test)\.html$/ ).test( file );
220-
}),
224+
} ),
221225
options: {
222226
inject: false,
223227
page: {
@@ -450,43 +454,43 @@ grunt.initConfig({
450454
"Bohdan Ganicky <bohdan.ganicky@gmail.com>"
451455
]
452456
}
453-
});
457+
} );
454458

455459
grunt.registerTask( "update-authors", function() {
456460
var getAuthors = require( "grunt-git-authors" ).getAuthors,
457461
done = this.async();
458462

459-
getAuthors({
463+
getAuthors( {
460464
priorAuthors: grunt.config( "authors.prior" )
461465
}, function( error, authors ) {
462466
if ( error ) {
463467
grunt.log.error( error );
464468
return done( false );
465469
}
466470

467-
authors = authors.map(function( author ) {
471+
authors = authors.map( function( author ) {
468472
if ( author.match( /^Jacek Jędrzejewski </ ) ) {
469473
return "Jacek Jędrzejewski (http://jacek.jedrzejewski.name)";
470474
} else if ( author.match( /^Pawel Maruszczyk </ ) ) {
471475
return "Pawel Maruszczyk (http://hrabstwo.net)";
472476
} else {
473477
return author;
474478
}
475-
});
479+
} );
476480

477481
grunt.file.write( "AUTHORS.txt",
478482
"Authors ordered by first contribution\n" +
479483
"A list of current team members is available at http://jqueryui.com/about\n\n" +
480484
authors.join( "\n" ) + "\n" );
481485
done();
482-
});
483-
});
484-
485-
grunt.registerTask( "default", [ "lint", "requirejs", "test" ]);
486-
grunt.registerTask( "jenkins", [ "default", "concat" ]);
487-
grunt.registerTask( "lint", [ "asciilint", "jshint", "jscs", "csslint", "htmllint" ]);
488-
grunt.registerTask( "test", [ "qunit" ]);
489-
grunt.registerTask( "sizer", [ "requirejs:js", "uglify:main", "compare_size:all" ]);
490-
grunt.registerTask( "sizer_all", [ "requirejs:js", "uglify", "compare_size" ]);
486+
} );
487+
} );
488+
489+
grunt.registerTask( "default", [ "lint", "requirejs", "test" ] );
490+
grunt.registerTask( "jenkins", [ "default", "concat" ] );
491+
grunt.registerTask( "lint", [ "asciilint", "jshint", "jscs", "csslint", "htmllint" ] );
492+
grunt.registerTask( "test", [ "qunit" ] );
493+
grunt.registerTask( "sizer", [ "requirejs:js", "uglify:main", "compare_size:all" ] );
494+
grunt.registerTask( "sizer_all", [ "requirejs:js", "uglify", "compare_size" ] );
491495

492496
};

tests/unit/dialog/options.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -251,24 +251,24 @@ QUnit.test( "height", function( assert ) {
251251
assert.expect( 4 );
252252

253253
var element = $( "<div></div>" ).dialog();
254-
assert.ok( Math.abs( element.dialog( "widget" ).outerHeight() - 150) < 0.25,
254+
assert.ok( Math.abs( element.dialog( "widget" ).outerHeight() - 150 ) < 0.25,
255255
"default height within 0.25 from expected" );
256256
element.remove();
257257

258258
element = $( "<div></div>" ).dialog( { height: 237 } );
259-
assert.ok( Math.abs( element.dialog( "widget" ).outerHeight() - 237) < 0.25,
259+
assert.ok( Math.abs( element.dialog( "widget" ).outerHeight() - 237 ) < 0.25,
260260
"explicit height within 0.25 from expected" );
261261
element.remove();
262262

263263
element = $( "<div></div>" ).dialog();
264264
element.dialog( "option", "height", 238 );
265-
assert.ok( Math.abs( element.dialog( "widget" ).outerHeight() - 238) < 0.25,
265+
assert.ok( Math.abs( element.dialog( "widget" ).outerHeight() - 238 ) < 0.25,
266266
"explicit height set after init within 0.25 from expected" );
267267
element.remove();
268268

269269
element = $( "<div></div>" ).css( "padding", "20px" )
270270
.dialog( { height: 240 } );
271-
assert.ok( Math.abs( element.dialog( "widget" ).outerHeight() - 240) < 0.25,
271+
assert.ok( Math.abs( element.dialog( "widget" ).outerHeight() - 240 ) < 0.25,
272272
"explicit height with padding within 0.25 from expected" );
273273
element.remove();
274274
} );

ui/widget.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,8 @@ $.widget.bridge = function( name, object ) {
233233
"attempted to call method '" + options + "'" );
234234
}
235235

236-
if ( typeof instance[ options ] !== "function" || options.charAt( 0 ) === "_" ) {
236+
if ( typeof instance[ options ] !== "function" ||
237+
options.charAt( 0 ) === "_" ) {
237238
return $.error( "no such method '" + options + "' for " + name +
238239
" widget instance" );
239240
}

ui/widgets/button.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,8 @@ if ( $.uiBackCompat !== false ) {
373373
"attempted to call method '" + options + "'" );
374374
}
375375

376-
if ( typeof instance[ options ] !== "function" || options.charAt( 0 ) === "_" ) {
376+
if ( typeof instance[ options ] !== "function" ||
377+
options.charAt( 0 ) === "_" ) {
377378
return $.error( "no such method '" + options + "' for button" +
378379
" widget instance" );
379380
}

0 commit comments

Comments
 (0)