Build: ESLint details

Use eslint pragmas, fix new errors, etc

Closes gh-3148
This commit is contained in:
Oleg Gaidarenko
2016-05-10 12:12:28 +03:00
parent a4474c9a00
commit 58c6ca9822
46 changed files with 349 additions and 457 deletions

View File

@@ -1,7 +0,0 @@
{
"env": {
"node": true
},
"extends": "../.eslintrc",
"root": true
}

View File

@@ -21,6 +21,7 @@ module.exports = function( Release ) {
Release.define( {
npmPublish: true,
issueTracker: "github",
/**
* Ensure the repo is in a proper state before release
* @param {Function} callback
@@ -28,6 +29,7 @@ module.exports = function( Release ) {
checkRepoState: function( callback ) {
ensureSizzle( Release, callback );
},
/**
* Set the version in the src folder for distributing AMD
*/
@@ -37,6 +39,7 @@ module.exports = function( Release ) {
contents = contents.replace( /@VERSION/g, Release.newVersion );
fs.writeFileSync( corePath, contents, "utf8" );
},
/**
* Generates any release artifacts that should be included in the release.
* The callback must be invoked with an array of files that should be
@@ -54,6 +57,7 @@ module.exports = function( Release ) {
Release._setSrcVersion();
callback( files );
},
/**
* Acts as insertion point for restoring Release.dir.repo
* It was changed to reuse npm publish code in jquery-release
@@ -65,6 +69,7 @@ module.exports = function( Release ) {
Release.dir.repo = Release.dir.origRepo || Release.dir.repo;
return npmTags();
},
/**
* Publish to distribution repo and npm
* @param {Function} callback

View File

@@ -38,7 +38,7 @@ module.exports = function( grunt ) {
// Avoid breaking semicolons inserted by r.js
skipSemiColonInsertion: true,
wrap: {
start: wrapper[ 0 ].replace( /\/\*jshint .* \*\/\n/, "" ),
start: wrapper[ 0 ].replace( /\/\*eslint .* \*\/\n/, "" ),
end: globals.replace(
/\/\*\s*ExcludeStart\s*\*\/[\w\W]*?\/\*\s*ExcludeEnd\s*\*\//ig,
""
@@ -64,7 +64,12 @@ module.exports = function( grunt ) {
// Convert var modules
if ( /.\/var\//.test( path.replace( process.cwd(), "" ) ) ) {
contents = contents
.replace( /define\([\w\W]*?return/, "var " + ( /var\/([\w-]+)/.exec( name )[ 1 ] ) + " =" )
.replace(
/define\([\w\W]*?return/,
"var " +
( /var\/([\w-]+)/.exec( name )[ 1 ] ) +
" ="
)
.replace( rdefineEnd, "" );
// Sizzle treatment
@@ -130,6 +135,7 @@ module.exports = function( grunt ) {
excluded = [],
included = [],
version = grunt.config( "pkg.version" ),
/**
* Recursively calls the excluder to remove on all modules in the list
* @param {Array} list
@@ -167,6 +173,7 @@ module.exports = function( grunt ) {
} );
}
},
/**
* Adds the specified module to the excluded or included list, depending on the flag
* @param {String} flag A module path relative to

View File

@@ -1,5 +1,3 @@
/* jshint node: true */
"use strict";
// Run Node with provided parameters: the first one being the Grunt
@@ -13,4 +11,4 @@ module.exports = function spawnTest( done ) {
.on( "close", function( code ) {
done( code === 0 );
} );
} ;
};