Skip to content

Commit 20ddbe4

Browse files
committed
Build: Update jscs and lint files
Ref 10fdad7 Fixes gh-2056
1 parent fa8a5a9 commit 20ddbe4

File tree

135 files changed

+8857
-8084
lines changed

Some content is hidden

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

135 files changed

+8857
-8084
lines changed

.jscsrc

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
{
22
"preset": "jquery",
33

4-
"excludeFiles": [ "external", "src/intro.js", "src/outro.js",
5-
"test/node_smoke_tests/lib/ensure_iterability.js" ]
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+
8+
"excludeFiles": [
9+
"external", "src/intro.js", "src/outro.js",
10+
"node_modules",
11+
"test/node_smoke_tests/lib/ensure_iterability.js"
12+
]
613
}

Gruntfile.js

Lines changed: 8 additions & 3 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": {
@@ -107,7 +107,12 @@ module.exports = function( grunt ) {
107107
gruntfile: "Gruntfile.js",
108108

109109
// Check parts of tests that pass
110-
test: [ "test/data/testrunner.js", "test/unit/animation.js", "test/unit/tween.js" ],
110+
test: [
111+
"test/data/testrunner.js",
112+
"test/unit/animation.js",
113+
"test/unit/tween.js",
114+
"test/unit/wrap.js"
115+
],
111116
build: "build"
112117
},
113118
testswarm: {
@@ -160,7 +165,7 @@ module.exports = function( grunt ) {
160165
}
161166
}
162167
}
163-
});
168+
} );
164169

165170
// Load grunt tasks from NPM packages
166171
require( "load-grunt-tasks" )( grunt );

build/release.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ module.exports = function( Release ) {
1010
npmTags = Release.npmTags,
1111
createTag = Release._createTag;
1212

13-
Release.define({
13+
Release.define( {
1414
npmPublish: true,
1515
issueTracker: "github",
1616
/**
@@ -48,6 +48,7 @@ module.exports = function( Release ) {
4848
* for publishing the distribution repo instead
4949
*/
5050
npmTags: function() {
51+
5152
// origRepo is not defined if dist was skipped
5253
Release.dir.repo = Release.dir.origRepo || Release.dir.repo;
5354
return npmTags();
@@ -59,9 +60,9 @@ module.exports = function( Release ) {
5960
dist: function( callback ) {
6061
cdn.makeArchives( Release, function() {
6162
dist( Release, callback );
62-
});
63+
} );
6364
}
64-
});
65+
} );
6566
};
6667

6768
module.exports.dependencies = [

build/release/cdn.js

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,14 @@ function makeReleaseCopies( Release ) {
3333
var version = Release.newVersion.replace( "-compat", "" );
3434
shell.mkdir( "-p", cdnFolder );
3535

36-
Object.keys( releaseFiles ).forEach(function( key ) {
36+
Object.keys( releaseFiles ).forEach( function( key ) {
3737
var text,
3838
builtFile = releaseFiles[ key ],
3939
unpathedFile = key.replace( /VER/g, version ),
4040
releaseFile = cdnFolder + "/" + unpathedFile;
4141

4242
if ( /\.map$/.test( releaseFile ) ) {
43+
4344
// Map files need to reference the new uncompressed name;
4445
// assume that all files reside in the same directory.
4546
// "file":"jquery.min.js","sources":["jquery.js"]
@@ -51,7 +52,7 @@ function makeReleaseCopies( Release ) {
5152
} else if ( builtFile !== releaseFile ) {
5253
shell.cp( "-f", builtFile, releaseFile );
5354
}
54-
});
55+
} );
5556
}
5657

5758
function makeArchives( Release, callback ) {
@@ -80,28 +81,30 @@ function makeArchives( Release, callback ) {
8081

8182
output.on( "error", function( err ) {
8283
throw err;
83-
});
84+
} );
8485

8586
archiver.pipe( output );
8687

87-
files = files.map(function( item ) {
88+
files = files.map( function( item ) {
8889
return "dist" + ( rver.test( item ) ? "/cdn" : "" ) + "/" +
8990
item.replace( rver, version );
90-
});
91+
} );
9192

9293
sum = Release.exec(
94+
9395
// Read jQuery files
9496
"md5sum " + files.join( " " ).replace( rcompat, "." ),
9597
"Error retrieving md5sum"
9698
);
9799
fs.writeFileSync( "./" + md5file, sum );
98100
files.push( md5file );
99101

100-
files.forEach(function( file ) {
102+
files.forEach( function( file ) {
103+
101104
// For Google, read jquery.js, write jquery-compat.js
102105
archiver.append( fs.createReadStream( file.replace( rcompat, "." ) ),
103106
{ name: path.basename( file ) } );
104-
});
107+
} );
105108

106109
archiver.finalize();
107110
}
@@ -114,9 +117,9 @@ function makeArchives( Release, callback ) {
114117
makeArchive( "mscdn", msFilesCDN, callback );
115118
}
116119

117-
buildGoogleCDN(function() {
120+
buildGoogleCDN( function() {
118121
buildMicrosoftCDN( callback );
119-
});
122+
} );
120123
}
121124

122125
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-compat-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-compat-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)