Skip to content

Commit dac6a38

Browse files
author
benholloway
committed
moved 'use strict' from function to top of files and tweaked imports for consistency
1 parent 4017eb7 commit dac6a38

File tree

9 files changed

+40
-42
lines changed

9 files changed

+40
-42
lines changed

lib/build/browserify.js

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
'use strict';
2+
13
var fs = require('fs'),
24
path = require('path'),
35
through = require('through2'),
@@ -18,7 +20,6 @@ var fs = require('fs'),
1820
* @returns {boolean} True on valid node and valid match, else false
1921
*/
2022
function isLiteralAST(node) {
21-
'use strict';
2223
var candidates = Array.prototype.slice.call(arguments, 1);
2324
return (node) && (node.type === 'Literal') && candidates.some(function (candidate) {
2425
return (node.value === candidate)
@@ -33,7 +34,6 @@ function isLiteralAST(node) {
3334
* @returns {boolean} True on valid node and valid match, else false
3435
*/
3536
function isMethodAST(node) {
36-
'use strict';
3737
var candidates = Array.prototype.slice.call(arguments, 1);
3838
var result = (node) && (node.type === 'CallExpression') && (node.callee) && candidates.some(function (candidate) {
3939
var callee = node.callee;
@@ -49,7 +49,6 @@ function isMethodAST(node) {
4949
* @return A jasmine transform
5050
*/
5151
function jasmineTransform(symbol) {
52-
'use strict';
5352
return transformTools.makeFalafelTransform('jasmineTransform', null, function (node, options, done) {
5453
var isValid = isLiteralAST(node, symbol) && isMethodAST(node.parent, 'describe', 'module');
5554
if (isValid) {
@@ -67,7 +66,6 @@ function jasmineTransform(symbol) {
6766
* @returns {stream.Through} A through stream that performs the operation of a gulp stream
6867
*/
6968
function compile(bannerWidth, transforms) {
70-
'use strict';
7169
var output = [];
7270

7371
/**
@@ -128,7 +126,6 @@ function compile(bannerWidth, transforms) {
128126
// Simulate bower components (and optionally current project) as node modules that may be require()'d
129127
var anonymised = trackFilenames().create();
130128
function requireTransform(allowProjectRelative) {
131-
'use strict';
132129
var BOWER = path.relative(process.cwd(), bowerDir.sync());
133130
return transformTools.makeRequireTransform('requireTransform', null, function (args, opts, done) {
134131

lib/build/node-sass.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
'use strict';
2+
13
var path = require('path'),
24
fs = require('fs'),
35
through = require('through2'),
@@ -18,7 +20,6 @@ var path = require('path'),
1820
* @returns {string} dataURI of the file where found or <code>undefined</code> otherwise
1921
*/
2022
function encodeRelativeURL(startPath, uri) {
21-
'use strict';
2223

2324
/**
2425
* Test whether the given directory is the root of its own package
@@ -93,7 +94,6 @@ function encodeRelativeURL(startPath, uri) {
9394
* @returns {stream.Through} A through stream that performs the operation of a gulp stream
9495
*/
9596
module.exports = function (bannerWidth, libraryPaths) {
96-
'use strict';
9797
var output = [ ];
9898
var libList = (libraryPaths || [ ]).filter(function isString(value) {
9999
return (typeof value === 'string');

lib/inject/adjacent-files.js

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1-
var path = require('path');
2-
var through = require('through2');
3-
var throughPipes = require('through-pipes');
4-
var gulp = require('gulp');
5-
var inject = require('gulp-inject');
6-
var slash = require('gulp-slash');
7-
var semiflat = require('gulp-semiflat');
1+
'use strict';
2+
3+
var path = require('path'),
4+
through = require('through2'),
5+
throughPipes = require('through-pipes'),
6+
gulp = require('gulp'),
7+
inject = require('gulp-inject'),
8+
slash = require('gulp-slash'),
9+
semiflat = require('gulp-semiflat');
810

911
/**
1012
* Inject all files found in the same relative directory as the HTML file of the stream.
@@ -17,7 +19,6 @@ var semiflat = require('gulp-semiflat');
1719
* @returns {stream.Through} A through stream that performs the operation of a gulp stream
1820
*/
1921
module.exports = function (extension, opts, recurse) {
20-
'use strict';
2122
var extensions = extension ? extension.split('|') : [ '*' ];
2223
return through.obj(function (file, encoding, done) {
2324
var stream = this;

lib/inject/bower-files.js

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
1-
var combined = require('combined-stream');
2-
var gulp = require('gulp');
3-
var gutil = require('gulp-util');
4-
var spigot = require('stream-spigot');
5-
var defaults = require('lodash.defaults');
6-
var flatten = require("lodash.flatten");
7-
var through = require('through2');
8-
var path = require('path');
9-
var fs = require('fs');
1+
'use strict';
2+
3+
var combined = require('combined-stream'),
4+
gulp = require('gulp'),
5+
gutil = require('gulp-util'),
6+
spigot = require('stream-spigot'),
7+
defaults = require('lodash.defaults'),
8+
flatten = require("lodash.flatten"),
9+
through = require('through2'),
10+
path = require('path'),
11+
fs = require('fs');
1012

1113
/**
1214
* Retrieve version details of bower files as a stream
@@ -15,7 +17,6 @@ var fs = require('fs');
1517
* @returns {stream.Readable} A readable stream containing only the manifest file
1618
*/
1719
function json(includeDev) {
18-
'use strict';
1920
function read(filename) {
2021
try {
2122
return fs.existsSync(filename) && require(path.resolve(filename));
@@ -39,7 +40,6 @@ function json(includeDev) {
3940
* @returns {stream.Readable} A readable stream containing only the manifest file
4041
*/
4142
function manifest(useComment, includeDev) {
42-
'use strict';
4343
var bower = json(includeDev);
4444
var versions = { };
4545
for (var key in bower) {
@@ -59,7 +59,6 @@ function manifest(useComment, includeDev) {
5959
}
6060

6161
module.exports = function () {
62-
'use strict';
6362
var before = [ ];
6463
var after = [ ];
6564

lib/inject/relative-transform.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
var path = require('path');
2-
var slash = require('gulp-slash');
1+
'use strict';
2+
3+
var path = require('path'),
4+
slash = require('gulp-slash');
35

46
/**
57
* An inject transform that constructs html using relative file locations.
68
*/
79
module.exports = function relativeTransform(filepath, file, index, length, targetFile) {
8-
'use strict';
910
var relative = slash(path.relative(path.dirname(targetFile.path), file.path));
1011
switch(path.extname(relative)) {
1112
case '.css':

lib/release/version-directory.js

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1-
var fs = require('fs');
2-
var path = require('path');
3-
var crypto = require('crypto');
4-
var through = require('through2');
5-
var gutil = require('gulp-util');
1+
'use strict';
2+
3+
var fs = require('fs'),
4+
path = require('path'),
5+
crypto = require('crypto'),
6+
through = require('through2'),
7+
gutil = require('gulp-util');
68

79
/**
810
* Rename the base directory of the given file stream with a hash of its content.
@@ -11,7 +13,6 @@ var gutil = require('gulp-util');
1113
* @returns {stream.Through} A through stream that performs the operation of a gulp stream
1214
*/
1315
module.exports = function (hashKeyword, isVerbose) {
14-
'use strict';
1516
var baseDirectory;
1617
var hash = crypto.createHash('md5');
1718
var pathList = [ ];

lib/util/hr.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
'use strict';
2+
13
/**
24
* Create a text banner with a title that is centred and double spaced
35
* @param {string} char The character that makes up the banner

lib/util/jshint-reporter.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
'use strict';
22

3-
var path = require('path');
4-
5-
var gulpJshint = require('gulp-jshint');
3+
var path = require('path'),
4+
gulpJshint = require('gulp-jshint');
65

76
var yargs = require('./yargs');
87

tasks/webstorm.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ var defaults = require('../lib/config/defaults'),
1818
var TEMPLATE_PATH = path.join(__dirname, '..', 'templates', 'webstorm');
1919

2020
var cliArgs;
21+
2122
// Load the global config for defaults
2223
var config = defaults.getInstance('webstorm')
2324
.file(platform.userHomeDirectory(), '.angularity')
@@ -118,9 +119,6 @@ gulp.task('webstorm', function (done) {
118119

119120
// Find the yargs instance that is most appropriate for the given command line parameters
120121
cliArgs = validateLaunchPath(yargs.resolveArgv());
121-
122-
cliArgs = yargs.resolveArgv();
123-
124122
if (cliArgs.taskName === 'init') {
125123
cliArgs = config.get(); // default arguments when called by the "init" task
126124
}

0 commit comments

Comments
 (0)