Skip to content

Commit 10fdad7

Browse files
committed
Build: Update jscs and lint files
Fixes gh-2056
1 parent 7aa46e0 commit 10fdad7

File tree

129 files changed

+8708
-7968
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

129 files changed

+8708
-7968
lines changed

.jscsrc

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
{
22
"preset": "jquery",
33

4+
// remove after https://github.com/jscs-dev/node-jscs/issues/1685
5+
// and https://github.com/jscs-dev/node-jscs/issues/1686
6+
"requireCapitalizedComments": null,
7+
48
"excludeFiles": [ "external", "src/intro.js", "src/outro.js",
5-
"test/node_smoke_tests/lib/ensure_iterability.js" ]
9+
"test/node_smoke_tests/lib/ensure_iterability.js", "node_modules" ]
610
}

Gruntfile.js

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ module.exports = function( grunt ) {
2020
// But our modules can
2121
delete srcHintOptions.onevar;
2222

23-
grunt.initConfig({
23+
grunt.initConfig( {
2424
pkg: grunt.file.readJSON( "package.json" ),
2525
dst: readOptionalJSON( "dist/.destination.json" ),
2626
"compare_size": {
@@ -53,6 +53,7 @@ module.exports = function( grunt ) {
5353
"core",
5454
"selector"
5555
],
56+
5657
// Exclude specified modules if the module matching the key is removed
5758
removeWith: {
5859
ajax: [ "manipulation/_evalUrl", "event/ajax" ],
@@ -108,7 +109,12 @@ module.exports = function( grunt ) {
108109
gruntfile: "Gruntfile.js",
109110

110111
// Check parts of tests that pass
111-
test: [ "test/data/testrunner.js", "test/unit/animation.js", "test/unit/tween.js" ],
112+
test: [
113+
"test/data/testrunner.js",
114+
"test/unit/animation.js",
115+
"test/unit/tween.js",
116+
"test/unit/wrap.js"
117+
],
112118
release: [ "build/*.js", "!build/release-notes.js" ],
113119
tasks: "build/tasks/*.js"
114120
},
@@ -162,7 +168,7 @@ module.exports = function( grunt ) {
162168
}
163169
}
164170
}
165-
});
171+
} );
166172

167173
// Load grunt tasks from NPM packages
168174
require( "load-grunt-tasks" )( grunt );
@@ -177,7 +183,7 @@ module.exports = function( grunt ) {
177183
grunt.registerTask( "test", [ "test_fast", "promises_aplus_tests" ] );
178184

179185
// Short list as a high frequency watch task
180-
grunt.registerTask( "dev", [ "build:*:*", "lint", "uglify", "remove_map_comment", "dist:*" ] );
186+
grunt.registerTask( "dev", [ "build:*:*", "uglify", "remove_map_comment", "dist:*" ] );
181187

182188
grunt.registerTask( "default", [ "dev", "test_fast", "compare_size" ] );
183189
};

build/release.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ module.exports = function( Release ) {
99

1010
npmTags = Release.npmTags;
1111

12-
Release.define({
12+
Release.define( {
1313
npmPublish: true,
1414
issueTracker: "github",
1515
/**
@@ -36,6 +36,7 @@ module.exports = function( Release ) {
3636
* for publishing the distribution repo instead
3737
*/
3838
npmTags: function() {
39+
3940
// origRepo is not defined if dist was skipped
4041
Release.dir.repo = Release.dir.origRepo || Release.dir.repo;
4142
return npmTags();
@@ -47,9 +48,9 @@ module.exports = function( Release ) {
4748
dist: function( callback ) {
4849
cdn.makeArchives( Release, function() {
4950
dist( Release, callback );
50-
});
51+
} );
5152
}
52-
});
53+
} );
5354
};
5455

5556
module.exports.dependencies = [

build/release/cdn.js

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,14 @@ var
2929
function makeReleaseCopies( Release ) {
3030
shell.mkdir( "-p", cdnFolder );
3131

32-
Object.keys( releaseFiles ).forEach(function( key ) {
32+
Object.keys( releaseFiles ).forEach( function( key ) {
3333
var text,
3434
builtFile = releaseFiles[ key ],
3535
unpathedFile = key.replace( /VER/g, Release.newVersion ),
3636
releaseFile = cdnFolder + "/" + unpathedFile;
3737

3838
if ( /\.map$/.test( releaseFile ) ) {
39+
3940
// Map files need to reference the new uncompressed name;
4041
// assume that all files reside in the same directory.
4142
// "file":"jquery.min.js","sources":["jquery.js"]
@@ -47,7 +48,7 @@ function makeReleaseCopies( Release ) {
4748
} else if ( builtFile !== releaseFile ) {
4849
shell.cp( "-f", builtFile, releaseFile );
4950
}
50-
});
51+
} );
5152
}
5253

5354
function makeArchives( Release, callback ) {
@@ -75,23 +76,23 @@ function makeArchives( Release, callback ) {
7576

7677
output.on( "error", function( err ) {
7778
throw err;
78-
});
79+
} );
7980

8081
archiver.pipe( output );
8182

82-
files = files.map(function( item ) {
83+
files = files.map( function( item ) {
8384
return "dist" + ( rver.test( item ) ? "/cdn" : "" ) + "/" +
8485
item.replace( rver, Release.newVersion );
85-
});
86+
} );
8687

8788
sum = Release.exec( "md5sum " + files.join( " " ), "Error retrieving md5sum" );
8889
fs.writeFileSync( md5file, sum );
8990
files.push( md5file );
9091

91-
files.forEach(function( file ) {
92+
files.forEach( function( file ) {
9293
archiver.append( fs.createReadStream( file ),
9394
{ name: path.basename( file ) } );
94-
});
95+
} );
9596

9697
archiver.finalize();
9798
}
@@ -104,9 +105,9 @@ function makeArchives( Release, callback ) {
104105
makeArchive( "mscdn", msFilesCDN, callback );
105106
}
106107

107-
buildGoogleCDN(function() {
108+
buildGoogleCDN( function() {
108109
buildMicrosoftCDN( callback );
109-
});
110+
} );
110111
}
111112

112113
module.exports = {

build/release/dist.js

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ module.exports = function( Release, complete ) {
55
shell = require( "shelljs" ),
66
pkg = require( Release.dir.repo + "/package.json" ),
77
distRemote = Release.remote.replace( "jquery.git", "jquery-dist.git" ),
8+
89
// These files are included with the distribution
910
files = [
1011
"src",
@@ -34,15 +35,15 @@ module.exports = function( Release, complete ) {
3435
* Generate bower file for jquery-dist
3536
*/
3637
function generateBower() {
37-
return JSON.stringify({
38+
return JSON.stringify( {
3839
name: pkg.name,
3940
main: pkg.main,
4041
license: "MIT",
4142
ignore: [
4243
"package.json"
4344
],
4445
keywords: pkg.keywords
45-
}, null, 2);
46+
}, null, 2 );
4647
}
4748

4849
/**
@@ -57,14 +58,14 @@ module.exports = function( Release, complete ) {
5758
"dist/jquery.js",
5859
"dist/jquery.min.js",
5960
"dist/jquery.min.map"
60-
].forEach(function( file ) {
61+
].forEach( function( file ) {
6162
shell.cp( Release.dir.repo + "/" + file, distFolder );
62-
});
63+
} );
6364

6465
// Copy other files
65-
files.forEach(function( file ) {
66+
files.forEach( function( file ) {
6667
shell.cp( "-r", Release.dir.repo + "/" + file, Release.dir.dist );
67-
});
68+
} );
6869

6970
// Write generated bower file
7071
fs.writeFileSync( Release.dir.dist + "/bower.json", generateBower() );

build/release/ensure-sizzle.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ var fs = require( "fs" ),
88
* @param {Function(string)} callback
99
*/
1010
function getLatestSizzle( callback ) {
11-
npm.load(function( err, npm ) {
11+
npm.load( function( err, npm ) {
1212
if ( err ) {
1313
throw err;
1414
}
@@ -17,8 +17,8 @@ function getLatestSizzle( callback ) {
1717
throw err;
1818
}
1919
callback( Object.keys( info )[ 0 ] );
20-
});
21-
});
20+
} );
21+
} );
2222
}
2323

2424
/**
@@ -29,11 +29,12 @@ function getLatestSizzle( callback ) {
2929
function ensureSizzle( Release, callback ) {
3030
console.log();
3131
console.log( "Checking Sizzle version..." );
32-
getLatestSizzle(function( latest ) {
32+
getLatestSizzle( function( latest ) {
3333
var match = rversion.exec( fs.readFileSync( sizzleLoc, "utf8" ) ),
3434
version = match ? match[ 1 ] : "Not Found";
3535

3636
if ( version !== latest ) {
37+
3738
// colors is inherited from jquery-release
3839
console.log(
3940
"The Sizzle version in the src folder (" + version.red +
@@ -44,7 +45,7 @@ function ensureSizzle( Release, callback ) {
4445
console.log( "Sizzle is latest (" + latest.green + ")" );
4546
callback();
4647
}
47-
});
48+
} );
4849
}
4950

5051
module.exports = ensureSizzle;

build/release/release-notes.js

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,16 @@
33
* jQuery Release Note Generator
44
*/
55

6-
var http = require("http"),
6+
var http = require( "http" ),
77
extract = /<a href="\/ticket\/(\d+)" title="View ticket">(.*?)<[^"]+"component">\s*(\S+)/g,
8-
version = process.argv[2];
8+
version = process.argv[ 2 ];
99

1010
if ( !/^\d+\.\d+/.test( version ) ) {
1111
console.error( "Invalid version number: " + version );
1212
process.exit( 1 );
1313
}
1414

15-
http.request({
15+
http.request( {
1616
host: "bugs.jquery.com",
1717
port: 80,
1818
method: "GET",
@@ -23,34 +23,36 @@ http.request({
2323

2424
res.on( "data", function( chunk ) {
2525
data.push( chunk );
26-
});
26+
} );
2727

2828
res.on( "end", function() {
2929
var match, cur, cat,
30-
file = data.join("");
30+
file = data.join( "" );
3131

32-
while ( (match = extract.exec( file )) ) {
33-
if ( "#" + match[1] !== match[2] ) {
34-
cat = match[3];
32+
while ( ( match = extract.exec( file ) ) ) {
33+
if ( "#" + match[ 1 ] !== match[ 2 ] ) {
34+
cat = match[ 3 ];
3535

3636
if ( !cur || cur !== cat ) {
3737
if ( cur ) {
38-
console.log("</ul>");
38+
console.log( "</ul>" );
3939
}
4040
cur = cat;
41-
console.log( "<h3>" + cat.charAt(0).toUpperCase() + cat.slice(1) + "</h3>" );
42-
console.log("<ul>");
41+
console.log(
42+
"<h3>" + cat.charAt( 0 ).toUpperCase() + cat.slice( 1 ) + "</h3>"
43+
);
44+
console.log( "<ul>" );
4345
}
4446

4547
console.log(
46-
" <li><a href=\"http://bugs.jquery.com/ticket/" + match[1] + "\">#" +
47-
match[1] + ": " + match[2] + "</a></li>"
48+
" <li><a href=\"http://bugs.jquery.com/ticket/" + match[ 1 ] + "\">#" +
49+
match[ 1 ] + ": " + match[ 2 ] + "</a></li>"
4850
);
4951
}
5052
}
5153
if ( cur ) {
52-
console.log("</ul>");
54+
console.log( "</ul>" );
5355
}
5456

55-
});
56-
}).end();
57+
} );
58+
} ).end();

0 commit comments

Comments
 (0)