From e5355c42b71857128f72d7a23af5ac903704b3da Mon Sep 17 00:00:00 2001 From: Amila Welihinda Date: Sat, 25 Mar 2017 13:52:57 -0700 Subject: [PATCH 1/3] Added initial eslint config & removed jshint --- .eslintrc | 3 ++ .jscsrc | 68 ------------------------------------------ .jshintrc | 32 -------------------- gulpfile.babel.js | 14 +-------- package.json | 13 ++------ test/file_content.js | 2 -- test/file_existence.js | 2 -- 7 files changed, 6 insertions(+), 128 deletions(-) create mode 100644 .eslintrc delete mode 100644 .jscsrc delete mode 100644 .jshintrc diff --git a/.eslintrc b/.eslintrc new file mode 100644 index 0000000000..fa39e8371e --- /dev/null +++ b/.eslintrc @@ -0,0 +1,3 @@ +{ + "extends": "eslint:recommended" +} diff --git a/.jscsrc b/.jscsrc deleted file mode 100644 index a83f173dfd..0000000000 --- a/.jscsrc +++ /dev/null @@ -1,68 +0,0 @@ -{ - "disallowEmptyBlocks": true, - "disallowKeywords": [ - "with" - ], - "disallowMixedSpacesAndTabs": true, - "disallowMultipleLineStrings": true, - "disallowMultipleVarDecl": true, - "disallowSpaceAfterPrefixUnaryOperators": [ - "!", - "+", - "++", - "-", - "--", - "~" - ], - "disallowSpaceBeforeBinaryOperators": [ - "," - ], - "disallowSpaceBeforePostfixUnaryOperators": true, - "disallowSpacesInNamedFunctionExpression": { - "beforeOpeningRoundBrace": true - }, - "disallowSpacesInsideArrayBrackets": true, - "disallowSpacesInsideParentheses": true, - "disallowTrailingComma": true, - "disallowTrailingWhitespace": true, - "requireCamelCaseOrUpperCaseIdentifiers": true, - "requireCapitalizedConstructors": true, - "requireCommaBeforeLineBreak": true, - "requireCurlyBraces": true, - "requireDotNotation": true, - "requireLineFeedAtFileEnd": true, - "requireParenthesesAroundIIFE": true, - "requireSpaceAfterBinaryOperators": true, - "requireSpaceAfterKeywords": [ - "catch", - "do", - "else", - "for", - "if", - "return", - "switch", - "try", - "while" - ], - "requireSpaceAfterLineComment": true, - "requireSpaceBeforeBinaryOperators": true, - "requireSpaceBeforeBlockStatements": true, - "requireSpacesInAnonymousFunctionExpression": { - "beforeOpeningCurlyBrace": true - }, - "requireSpacesInConditionalExpression": true, - "requireSpacesInFunctionDeclaration": { - "beforeOpeningCurlyBrace": true - }, - "requireSpacesInFunctionExpression": { - "beforeOpeningCurlyBrace": true - }, - "requireSpacesInNamedFunctionExpression": { - "beforeOpeningCurlyBrace": true - }, - "requireSpacesInsideObjectBrackets": "allButNested", - "validateIndentation": 4, - "validateLineBreaks": "LF", - "validateParameterSeparator": ", ", - "validateQuoteMarks": "'" -} diff --git a/.jshintrc b/.jshintrc deleted file mode 100644 index e1eb05b11e..0000000000 --- a/.jshintrc +++ /dev/null @@ -1,32 +0,0 @@ -{ - - // Enforcing options - // http://jshint.com/docs/options/#enforcing-options - - "bitwise": true, - "eqeqeq": true, - "forin": true, - "latedef": true, - "noarg": true, - "nonbsp": true, - "nonew": true, - "undef": true, - "unused": true, - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // Relaxing options - // http://jshint.com/docs/options/#relaxing-options - - "esnext": true, - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // Environments - // http://jshint.com/docs/options/#environments - - "browser": true, - "jquery": true, - "node": true - -} diff --git a/gulpfile.babel.js b/gulpfile.babel.js index 06b4251db4..53aa5ee82b 100644 --- a/gulpfile.babel.js +++ b/gulpfile.babel.js @@ -149,18 +149,6 @@ gulp.task('copy:normalize', () => .pipe(gulp.dest(`${dirs.dist}/css`)) ); -gulp.task('lint:js', () => - gulp.src([ - 'gulpfile.js', - `${dirs.src}/js/*.js`, - `${dirs.test}/*.js` - ]).pipe(plugins().jscs()) - .pipe(plugins().jshint()) - .pipe(plugins().jshint.reporter('jshint-stylish')) - .pipe(plugins().jshint.reporter('fail')) -); - - // --------------------------------------------------------------------- // | Main tasks | // --------------------------------------------------------------------- @@ -175,7 +163,7 @@ gulp.task('archive', (done) => { gulp.task('build', (done) => { runSequence( - ['clean', 'lint:js'], + ['clean'], 'copy', done) }); diff --git a/package.json b/package.json index ef4fb8daa8..4b4bca3cc0 100644 --- a/package.json +++ b/package.json @@ -12,32 +12,22 @@ "babel-preset-es2015": "^6.18.0", "babel-register": "^6.8.0", "del": "^2.2.2", + "eslint": "^3.18.0", "glob": "^7.1.1", "gulp": "^3.9.1", "gulp-autoprefixer": "^3.1.1", "gulp-header": "^1.8.8", - "gulp-jscs": "^4.0.0", - "gulp-jshint": "^2.0.4", "gulp-load-plugins": "^1.4.0", - "gulp-rename": "^1.2.2", "gulp-replace": "^0.5.4", "jquery": "3.2.0", - "jshint": "^2.9.4", - "jshint-stylish": "^2.2.1", "mocha": "^3.2.0", "node-sri": "^1.1.1", "normalize.css": "5.0.0", - "run-sequence": "^1.2.2", "travis-after-all": "^1.4.4" }, "engines": { "node": ">=0.10.0" }, - "babel": { - "presets": [ - "es2015" - ] - }, "h5bp-configs": { "directories": { "archive": "archive", @@ -52,6 +42,7 @@ "private": true, "scripts": { "build": "gulp build", + "lint": "eslint .", "test": "gulp archive && mocha --compilers js:babel-register --reporter spec --timeout 5000" }, "version": "5.3.0" diff --git a/test/file_content.js b/test/file_content.js index 31005636e6..ea6737efa6 100644 --- a/test/file_content.js +++ b/test/file_content.js @@ -1,5 +1,3 @@ -/* jshint mocha: true */ - import assert from 'assert'; import fs from 'fs'; import path from 'path'; diff --git a/test/file_existence.js b/test/file_existence.js index 0101cc31f1..2874575a83 100644 --- a/test/file_existence.js +++ b/test/file_existence.js @@ -1,5 +1,3 @@ -/* jshint mocha: true */ - import assert from 'assert'; import fs from 'fs'; import path from 'path'; From 905c5107234e4ce60dcf53d6e3472fa6f33c17c9 Mon Sep 17 00:00:00 2001 From: Amila Welihinda Date: Sat, 25 Mar 2017 14:13:14 -0700 Subject: [PATCH 2/3] Autofixed all js styles, added airbnb eslint config --- .eslintignore | 2 + .eslintrc | 11 ++- gulpfile.babel.js | 121 ++++++++++++++++---------------- package.json | 5 ++ src/js/plugins.js | 31 ++++----- test/file_content.js | 92 +++++++++++------------- test/file_existence.js | 154 +++++++++++++++++++---------------------- 7 files changed, 202 insertions(+), 214 deletions(-) create mode 100644 .eslintignore diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000000..6d068efcef --- /dev/null +++ b/.eslintignore @@ -0,0 +1,2 @@ +dist +/src/js/vendor diff --git a/.eslintrc b/.eslintrc index fa39e8371e..4a5c7ca193 100644 --- a/.eslintrc +++ b/.eslintrc @@ -1,3 +1,12 @@ { - "extends": "eslint:recommended" + "extends": "airbnb", + "env": { + "browser": true, + "mocha": true, + "es6": true + }, + "rules": { + "no-plusplus": "off", + "no-cond-assign": "off" + } } diff --git a/gulpfile.babel.js b/gulpfile.babel.js index 53aa5ee82b..e3c7d2171a 100644 --- a/gulpfile.babel.js +++ b/gulpfile.babel.js @@ -14,7 +14,7 @@ import runSequence from 'run-sequence'; import archiver from 'archiver'; import glob from 'glob'; import del from 'del'; -import sri from 'node-sri' +import sri from 'node-sri'; import pkg from './package.json'; @@ -25,102 +25,97 @@ const dirs = pkg['h5bp-configs'].directories; // --------------------------------------------------------------------- gulp.task('archive:create_archive_dir', () => { - fs.mkdirSync(path.resolve(dirs.archive), '0755'); + fs.mkdirSync(path.resolve(dirs.archive), '0755'); }); gulp.task('archive:zip', (done) => { + const archiveName = path.resolve(dirs.archive, `${pkg.name}_v${pkg.version}.zip`); + const zip = archiver('zip'); + const files = glob.sync('**/*.*', { + cwd: dirs.dist, + dot: true, // include hidden files + }); + const output = fs.createWriteStream(archiveName); - const archiveName = path.resolve(dirs.archive, `${pkg.name}_v${pkg.version}.zip`); - const zip = archiver('zip'); - const files = glob.sync('**/*.*', { - 'cwd': dirs.dist, - 'dot': true // include hidden files - }); - const output = fs.createWriteStream(archiveName); - - zip.on('error', (error) => { - done(); - throw error; - }); - - output.on('close', done); + zip.on('error', (error) => { + done(); + throw error; + }); - files.forEach( (file) => { + output.on('close', done); - const filePath = path.resolve(dirs.dist, file); + files.forEach((file) => { + const filePath = path.resolve(dirs.dist, file); // `zip.bulk` does not maintain the file // permissions, so we need to add files individually - zip.append(fs.createReadStream(filePath), { - 'name': file, - 'mode': fs.statSync(filePath).mode - }); - + zip.append(fs.createReadStream(filePath), { + name: file, + mode: fs.statSync(filePath).mode, }); + }); - zip.pipe(output); - zip.finalize(); - + zip.pipe(output); + zip.finalize(); }); gulp.task('clean', (done) => { - del([ - dirs.archive, - dirs.dist - ]).then( () => { - done(); - }); + del([ + dirs.archive, + dirs.dist, + ]).then(() => { + done(); + }); }); gulp.task('copy', [ - 'copy:.htaccess', - 'copy:index.html', - 'copy:jquery', - 'copy:license', - 'copy:main.css', - 'copy:misc', - 'copy:normalize' + 'copy:.htaccess', + 'copy:index.html', + 'copy:jquery', + 'copy:license', + 'copy:main.css', + 'copy:misc', + 'copy:normalize', ]); gulp.task('copy:.htaccess', () => gulp.src('node_modules/apache-server-configs/dist/.htaccess') .pipe(plugins().replace(/# ErrorDocument/g, 'ErrorDocument')) - .pipe(gulp.dest(dirs.dist)) + .pipe(gulp.dest(dirs.dist)), ); -gulp.task('copy:index.html', (done) => +gulp.task('copy:index.html', done => sri.hash('node_modules/jquery/dist/jquery.min.js', (err, hash) => { - if (err) throw err + if (err) throw err; - let version = pkg.devDependencies.jquery; - gulp.src(`${dirs.src}/index.html`) + const version = pkg.devDependencies.jquery; + gulp.src(`${dirs.src}/index.html`) .pipe(plugins().replace(/{{JQUERY_VERSION}}/g, version)) .pipe(plugins().replace(/{{JQUERY_SRI_HASH}}/g, hash)) .pipe(gulp.dest(dirs.dist)); - done(); - }) + done(); + }), ); gulp.task('copy:jquery', () => gulp.src(['node_modules/jquery/dist/jquery.min.js']) .pipe(plugins().rename(`jquery-${pkg.devDependencies.jquery}.min.js`)) - .pipe(gulp.dest(`${dirs.dist}/js/vendor`)) + .pipe(gulp.dest(`${dirs.dist}/js/vendor`)), ); gulp.task('copy:license', () => gulp.src('LICENSE.txt') - .pipe(gulp.dest(dirs.dist)) + .pipe(gulp.dest(dirs.dist)), ); gulp.task('copy:main.css', () => { + const banner = `/*! HTML5 Boilerplate v${pkg.version} | ${pkg.license} License | ${pkg.homepage} */\n\n`; - const banner = `/*! HTML5 Boilerplate v${pkg.version} | ${pkg.license} License | ${pkg.homepage} */\n\n`; - - gulp.src(`${dirs.src}/css/main.css`) + gulp.src(`${dirs.src}/css/main.css`) .pipe(plugins().header(banner)) .pipe(plugins().autoprefixer({ - browsers: ['last 2 versions', 'ie >= 8', '> 1%'], - cascade: false + browsers: ['last 2 versions', 'ie >= 8', '> 1%'], + cascade: false, })) .pipe(gulp.dest(`${dirs.dist}/css`)); }); @@ -129,24 +124,24 @@ gulp.task('copy:misc', () => gulp.src([ // Copy all files - `${dirs.src}/**/*`, + `${dirs.src}/**/*`, // Exclude the following files // (other tasks will handle the copying of these files) - `!${dirs.src}/css/main.css`, - `!${dirs.src}/index.html` + `!${dirs.src}/css/main.css`, + `!${dirs.src}/index.html`, ], { // Include hidden files by default - dot: true + dot: true, - }).pipe(gulp.dest(dirs.dist)) + }).pipe(gulp.dest(dirs.dist)), ); gulp.task('copy:normalize', () => gulp.src('node_modules/normalize.css/normalize.css') - .pipe(gulp.dest(`${dirs.dist}/css`)) + .pipe(gulp.dest(`${dirs.dist}/css`)), ); // --------------------------------------------------------------------- @@ -154,18 +149,18 @@ gulp.task('copy:normalize', () => // --------------------------------------------------------------------- gulp.task('archive', (done) => { - runSequence( + runSequence( 'build', 'archive:create_archive_dir', 'archive:zip', - done) + done); }); gulp.task('build', (done) => { - runSequence( + runSequence( ['clean'], 'copy', - done) + done); }); gulp.task('default', ['build']); diff --git a/package.json b/package.json index 4b4bca3cc0..6b59eb14e5 100644 --- a/package.json +++ b/package.json @@ -13,6 +13,10 @@ "babel-register": "^6.8.0", "del": "^2.2.2", "eslint": "^3.18.0", + "eslint-config-airbnb": "^14.1.0", + "eslint-plugin-import": "^2.2.0", + "eslint-plugin-jsx-a11y": "^4.0.0", + "eslint-plugin-react": "^6.10.3", "glob": "^7.1.1", "gulp": "^3.9.1", "gulp-autoprefixer": "^3.1.1", @@ -23,6 +27,7 @@ "mocha": "^3.2.0", "node-sri": "^1.1.1", "normalize.css": "5.0.0", + "run-sequence": "^1.2.2", "travis-after-all": "^1.4.4" }, "engines": { diff --git a/src/js/plugins.js b/src/js/plugins.js index f887480226..7d6b5b8d25 100644 --- a/src/js/plugins.js +++ b/src/js/plugins.js @@ -1,24 +1,23 @@ // Avoid `console` errors in browsers that lack a console. -(function() { - var method; - var noop = function () {}; - var methods = [ - 'assert', 'clear', 'count', 'debug', 'dir', 'dirxml', 'error', - 'exception', 'group', 'groupCollapsed', 'groupEnd', 'info', 'log', - 'markTimeline', 'profile', 'profileEnd', 'table', 'time', 'timeEnd', - 'timeline', 'timelineEnd', 'timeStamp', 'trace', 'warn' - ]; - var length = methods.length; - var console = (window.console = window.console || {}); +(function () { + let method; + const noop = function () {}; + const methods = [ + 'assert', 'clear', 'count', 'debug', 'dir', 'dirxml', 'error', + 'exception', 'group', 'groupCollapsed', 'groupEnd', 'info', 'log', + 'markTimeline', 'profile', 'profileEnd', 'table', 'time', 'timeEnd', + 'timeline', 'timelineEnd', 'timeStamp', 'trace', 'warn', + ]; + let length = methods.length; - while (length--) { - method = methods[length]; + while (length--) { + method = methods[length]; // Only stub undefined methods. - if (!console[method]) { - console[method] = noop; - } + if (!console[method]) { + console[method] = noop; } + } }()); // Place any jQuery/helper plugins in here. diff --git a/test/file_content.js b/test/file_content.js index ea6737efa6..d78cca422a 100644 --- a/test/file_content.js +++ b/test/file_content.js @@ -9,70 +9,60 @@ const dirs = pkg['h5bp-configs'].directories; // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - function checkString(file, string, done) { - - let character = ''; - let matchFound = false; - let matchedPositions = 0; - const readStream = fs.createReadStream(file, { 'encoding': 'utf8' }); - - readStream.on('close', done); - readStream.on('error', done); - readStream.on('readable', function () { - + let character = ''; + let matchFound = false; + let matchedPositions = 0; + const readStream = fs.createReadStream(file, { encoding: 'utf8' }); + + readStream.on('close', done); + readStream.on('error', done); + readStream.on('readable', function handleReadableStream() { // Read file until the string is found // or the whole file has been read - while (matchFound !== true && + while (matchFound !== true && (character = readStream.read(1)) !== null) { - - if (character === string.charAt(matchedPositions)) { - matchedPositions += 1; - } else { - matchedPositions = 0; - } - - if (matchedPositions === string.length) { - matchFound = true; - } - - } - - assert.equal(true, matchFound); - this.close(); - - }); - + if (character === string.charAt(matchedPositions)) { + matchedPositions += 1; + } else { + matchedPositions = 0; + } + + if (matchedPositions === string.length) { + matchFound = true; + } + } + + assert.equal(true, matchFound); + this.close(); + }); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - function runTests() { + const dir = dirs.dist; - const dir = dirs.dist; - - describe(`Test if the files from the "${dir}" directory have the expected content`, () => { - - it('".htaccess" should have the "ErrorDocument..." line uncommented', (done) => { - const string = '\n\nErrorDocument 404 /404.html\n\n'; - checkString(path.resolve(dir, '.htaccess'), string, done); - }); - - it('"index.html" should contain the correct jQuery version in the CDN URL', (done) => { - const string = `code.jquery.com/jquery-${pkg.devDependencies.jquery}.min.js`; - checkString(path.resolve(dir, 'index.html'), string, done); - }); - - it('"index.html" should contain the correct jQuery version in the local URL', (done) => { - const string = `js/vendor/jquery-${pkg.devDependencies.jquery}.min.js`; - checkString(path.resolve(dir, 'index.html'), string, done); - }); + describe(`Test if the files from the "${dir}" directory have the expected content`, () => { + it('".htaccess" should have the "ErrorDocument..." line uncommented', (done) => { + const string = '\n\nErrorDocument 404 /404.html\n\n'; + checkString(path.resolve(dir, '.htaccess'), string, done); + }); - it('"main.css" should contain a custom banner', function (done) { - const string = `/*! HTML5 Boilerplate v${pkg.version} | ${pkg.license} License | ${pkg.homepage} */\n\n/*\n`; - checkString(path.resolve(dir, 'css/main.css'), string, done); - }); + it('"index.html" should contain the correct jQuery version in the CDN URL', (done) => { + const string = `code.jquery.com/jquery-${pkg.devDependencies.jquery}.min.js`; + checkString(path.resolve(dir, 'index.html'), string, done); + }); + it('"index.html" should contain the correct jQuery version in the local URL', (done) => { + const string = `js/vendor/jquery-${pkg.devDependencies.jquery}.min.js`; + checkString(path.resolve(dir, 'index.html'), string, done); }); + it('"main.css" should contain a custom banner', (done) => { + const string = `/*! HTML5 Boilerplate v${pkg.version} | ${pkg.license} License | ${pkg.homepage} */\n\n/*\n`; + checkString(path.resolve(dir, 'css/main.css'), string, done); + }); + }); } runTests(); diff --git a/test/file_existence.js b/test/file_existence.js index 2874575a83..2616827824 100644 --- a/test/file_existence.js +++ b/test/file_existence.js @@ -3,129 +3,117 @@ import fs from 'fs'; import path from 'path'; import glob from 'glob'; -import pkg from './../package.json'; +import pkg from './../package.json'; const dirs = pkg['h5bp-configs'].directories; const expectedFilesInArchiveDir = [ - `${pkg.name}_v${pkg.version}.zip` + `${pkg.name}_v${pkg.version}.zip`, ]; const expectedFilesInDistDir = [ - '.editorconfig', - '.gitattributes', - '.gitignore', - '.htaccess', - '404.html', - 'apple-touch-icon.png', - 'browserconfig.xml', + '.editorconfig', + '.gitattributes', + '.gitignore', + '.htaccess', + '404.html', + 'apple-touch-icon.png', + 'browserconfig.xml', - 'css/', // for directories, a `/` character + 'css/', // for directories, a `/` character // should be included at the end - 'css/main.css', - 'css/normalize.css', - - 'doc/', - 'doc/TOC.md', - 'doc/css.md', - 'doc/extend.md', - 'doc/faq.md', - 'doc/html.md', - 'doc/js.md', - 'doc/misc.md', - 'doc/usage.md', - - 'favicon.ico', - 'humans.txt', - - 'img/', - 'img/.gitignore', - - 'index.html', - - 'js/', - 'js/main.js', - 'js/plugins.js', - 'js/vendor/', - `js/vendor/jquery-${pkg.devDependencies.jquery}.min.js`, - 'js/vendor/modernizr-2.8.3.min.js', - - 'LICENSE.txt', - 'robots.txt', - 'tile-wide.png', - 'tile.png' + 'css/main.css', + 'css/normalize.css', + + 'doc/', + 'doc/TOC.md', + 'doc/css.md', + 'doc/extend.md', + 'doc/faq.md', + 'doc/html.md', + 'doc/js.md', + 'doc/misc.md', + 'doc/usage.md', + + 'favicon.ico', + 'humans.txt', + + 'img/', + 'img/.gitignore', + + 'index.html', + + 'js/', + 'js/main.js', + 'js/plugins.js', + 'js/vendor/', + `js/vendor/jquery-${pkg.devDependencies.jquery}.min.js`, + 'js/vendor/modernizr-2.8.3.min.js', + + 'LICENSE.txt', + 'robots.txt', + 'tile-wide.png', + 'tile.png', ]; // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - function checkFiles(directory, expectedFiles) { - // Get the list of files from the specified directory - const files = glob.sync('**/*', { - 'cwd': directory, - 'dot': true, // include hidden files - 'mark': true // add a `/` character to directory matches - }); + const files = glob.sync('**/*', { + cwd: directory, + dot: true, // include hidden files + mark: true, // add a `/` character to directory matches + }); // Check if all expected files are present in the // specified directory, and are of the expected type - expectedFiles.forEach( (file) => { - - let ok = false; - const expectedFileType = (file.slice(-1) !== '/' ? 'regular file' : 'directory'); + expectedFiles.forEach((file) => { + let ok = false; + const expectedFileType = (file.slice(-1) !== '/' ? 'regular file' : 'directory'); // If file exists - if (files.indexOf(file) !== -1) { - + if (files.indexOf(file) !== -1) { // Check if the file is of the correct type - if (file.slice(-1) !== '/') { + if (file.slice(-1) !== '/') { // Check if the file is really a regular file - ok = fs.statSync(path.resolve(directory, file)).isFile(); - } else { + ok = fs.statSync(path.resolve(directory, file)).isFile(); + } else { // Check if the file is a directory // (Since glob adds the `/` character to directory matches, // we can simply check if the `/` character is present) - ok = (files[files.indexOf(file)].slice(-1) === '/'); - } - - } - - it(`"${file}" should be present and it should be a ${expectedFileType}`, () =>{ - assert.equal(true, ok); - }); + ok = (files[files.indexOf(file)].slice(-1) === '/'); + } + } + it(`"${file}" should be present and it should be a ${expectedFileType}`, () => { + assert.equal(true, ok); }); + }); // List all files that should be NOT // be present in the specified directory - (files.filter( (file) => { - return expectedFiles.indexOf(file) === -1; - })).forEach( (file) => { - it(`"${file}" should NOT be present`, () => { - assert(false); - }); + (files.filter(file => expectedFiles.indexOf(file) === -1)).forEach((file) => { + it(`"${file}" should NOT be present`, () => { + assert(false); }); - + }); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - function runTests() { - - describe('Test if all the expected files, and only them, are present in the build directories', () => { - - describe(dirs.archive, () => { - checkFiles(dirs.archive, expectedFilesInArchiveDir); - }); - - describe(dirs.dist, () => { - checkFiles(dirs.dist, expectedFilesInDistDir); - }); - + describe('Test if all the expected files, and only them, are present in the build directories', () => { + describe(dirs.archive, () => { + checkFiles(dirs.archive, expectedFilesInArchiveDir); }); + describe(dirs.dist, () => { + checkFiles(dirs.dist, expectedFilesInDistDir); + }); + }); } runTests(); From 30b2eb158f0b73151a687b80e2c3ee413763c4cc Mon Sep 17 00:00:00 2001 From: Amila Welihinda Date: Sun, 26 Mar 2017 09:18:17 -0700 Subject: [PATCH 3/3] Added missing gulp-rename dependency --- dist/js/plugins.js | 31 +++++++++++++++---------------- package.json | 1 + 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/dist/js/plugins.js b/dist/js/plugins.js index f887480226..7d6b5b8d25 100644 --- a/dist/js/plugins.js +++ b/dist/js/plugins.js @@ -1,24 +1,23 @@ // Avoid `console` errors in browsers that lack a console. -(function() { - var method; - var noop = function () {}; - var methods = [ - 'assert', 'clear', 'count', 'debug', 'dir', 'dirxml', 'error', - 'exception', 'group', 'groupCollapsed', 'groupEnd', 'info', 'log', - 'markTimeline', 'profile', 'profileEnd', 'table', 'time', 'timeEnd', - 'timeline', 'timelineEnd', 'timeStamp', 'trace', 'warn' - ]; - var length = methods.length; - var console = (window.console = window.console || {}); +(function () { + let method; + const noop = function () {}; + const methods = [ + 'assert', 'clear', 'count', 'debug', 'dir', 'dirxml', 'error', + 'exception', 'group', 'groupCollapsed', 'groupEnd', 'info', 'log', + 'markTimeline', 'profile', 'profileEnd', 'table', 'time', 'timeEnd', + 'timeline', 'timelineEnd', 'timeStamp', 'trace', 'warn', + ]; + let length = methods.length; - while (length--) { - method = methods[length]; + while (length--) { + method = methods[length]; // Only stub undefined methods. - if (!console[method]) { - console[method] = noop; - } + if (!console[method]) { + console[method] = noop; } + } }()); // Place any jQuery/helper plugins in here. diff --git a/package.json b/package.json index 6b59eb14e5..ed7c2b2e08 100644 --- a/package.json +++ b/package.json @@ -22,6 +22,7 @@ "gulp-autoprefixer": "^3.1.1", "gulp-header": "^1.8.8", "gulp-load-plugins": "^1.4.0", + "gulp-rename": "^1.2.2", "gulp-replace": "^0.5.4", "jquery": "3.2.0", "mocha": "^3.2.0",