diff --git a/.jshintignore b/.jshintignore new file mode 100644 index 000000000000..e9cc4f260316 --- /dev/null +++ b/.jshintignore @@ -0,0 +1,2 @@ +node_modules/** +lib/htmlparser/** diff --git a/.jshintrc b/.jshintrc new file mode 100644 index 000000000000..7fbaafbc0a8c --- /dev/null +++ b/.jshintrc @@ -0,0 +1,5 @@ +{ + "extends": ".jshintrc-base", + "node": true, + "globals": {} +} diff --git a/.jshintrc-base b/.jshintrc-base new file mode 100644 index 000000000000..c4ac5e2666bf --- /dev/null +++ b/.jshintrc-base @@ -0,0 +1,19 @@ +{ + "bitwise": true, + "immed": true, + "newcap": true, + "noarg": true, + "noempty": true, + "nonew": true, + "trailing": true, + "maxlen": 200, + "boss": true, + "eqnull": true, + "expr": true, + "globalstrict": true, + "laxbreak": true, + "loopfunc": true, + "sub": true, + "undef": true, + "indent": 2 +} diff --git a/Gruntfile.js b/Gruntfile.js index dc9a7c95341e..fb934d0b7850 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -1,3 +1,5 @@ +'use strict'; + var files = require('./angularFiles').files; var util = require('./lib/grunt/utils.js'); var versionInfo = require('./lib/versions/version-info'); @@ -107,6 +109,9 @@ module.exports = function(grunt) { options: { jshintrc: true, }, + node: { + files: { src: ['*.js', 'lib/**/*.js'] }, + }, tests: { files: { src: 'test/**/*.js' }, }, @@ -260,7 +265,11 @@ module.exports = function(grunt) { compress: { build: { options: {archive: 'build/' + dist +'.zip', mode: 'zip'}, - src: ['**'], cwd: 'build', expand: true, dot: true, dest: dist + '/' + src: ['**'], + cwd: 'build', + expand: true, + dot: true, + dest: dist + '/' } }, diff --git a/angularFiles.js b/angularFiles.js index 60fdf3f8964a..b1d5fd1c5527 100755 --- a/angularFiles.js +++ b/angularFiles.js @@ -1,4 +1,6 @@ -angularFiles = { +'use strict'; + +var angularFiles = { 'angularSrc': [ 'src/minErr.js', 'src/Angular.js', diff --git a/changelog.js b/changelog.js index fd30a1851e72..cc0a5ce93c32 100755 --- a/changelog.js +++ b/changelog.js @@ -3,6 +3,8 @@ // TODO(vojta): pre-commit hook for validating messages // TODO(vojta): report errors, currently Q silence everything which really sucks +'use strict'; + var child = require('child_process'); var fs = require('fs'); var util = require('util'); @@ -164,7 +166,7 @@ var writeChangelog = function(stream, commits, version) { hash: commit.hash, closes: [] }); - }; + } }); stream.write(util.format(HEADER_TPL, version, version, currentDate())); @@ -172,7 +174,7 @@ var writeChangelog = function(stream, commits, version) { printSection(stream, 'Features', sections.feat); printSection(stream, 'Performance Improvements', sections.perf); printSection(stream, 'Breaking Changes', sections.breaks, false); -} +}; var getPreviousTag = function() { diff --git a/changelog.spec.js b/changelog.spec.js index 595ed84d6fab..f8f4a6cc19e0 100644 --- a/changelog.spec.js +++ b/changelog.spec.js @@ -1,3 +1,7 @@ +/* global describe: false, it: false, expect: false */ + +'use strict'; + describe('changelog.js', function() { var ch = require('./changelog'); @@ -13,7 +17,7 @@ describe('changelog.js', function() { expect(msg.hash).toBe('9b1aff905b638aa274a5fc8f88662df446d374bd'); expect(msg.subject).toBe('broadcast $destroy event on scope destruction'); expect(msg.body).toBe('perf testing shows that in chrome this change adds 5-15% overhead\n' + - 'when destroying 10k nested scopes where each scope has a $destroy listener\n') + 'when destroying 10k nested scopes where each scope has a $destroy listener\n'); expect(msg.component).toBe('scope'); }); diff --git a/compare-master-to-stable.js b/compare-master-to-stable.js index 278926d7346e..c550d03252a5 100755 --- a/compare-master-to-stable.js +++ b/compare-master-to-stable.js @@ -1,5 +1,7 @@ #!/usr/bin/env node +'use strict'; + var util = require('util'); var cp = require('child_process'); @@ -146,7 +148,7 @@ then(allInSeries(function (branch) { return sha + (msg.toLowerCase().indexOf('fix') === -1 ? ' ' : ' * ') + msg; }); branch.log = log.map(function (line) { - return line.substr(41) + return line.substr(41); }); return branch; }); diff --git a/gdocs.js b/gdocs.js index 31377df29208..96357923257b 100755 --- a/gdocs.js +++ b/gdocs.js @@ -1,5 +1,7 @@ #!/usr/bin/env node +'use strict'; + var http = require('http'); var https = require('https'); var fs = require('fs'); @@ -41,63 +43,63 @@ function help() { console.log('gdocs.js --login '); console.log('gdocs.js --fetch []'); process.exit(-1); -}; +} function fetch(collection, url){ console.log('fetching a list of docs in collection ' + collection + '...'); request('GET', url, { - headers: { - 'Gdata-Version': '3.0', - 'Authorization': 'GoogleLogin auth=' + getAuthToken() - } - }, - function(chunk){ - var entries = chunk.split('(.*?)<\/title>/)[1]; - if (title.match(/\.ngdoc$/)) { - var exportUrl = entry.match(//)[1]; - download(collection, title, exportUrl); - }; - }); + headers: { + 'Gdata-Version': '3.0', + 'Authorization': 'GoogleLogin auth=' + getAuthToken() } - ); + }, + function(chunk){ + var entries = chunk.split('(.*?)<\/title>/)[1]; + if (title.match(/\.ngdoc$/)) { + var exportUrl = entry.match(//)[1]; + download(collection, title, exportUrl); + } + }); + } + ); } function download(collection, name, url) { console.log('Downloading:', name, '...'); request('GET', url + '&exportFormat=txt', - { - headers: { - 'Gdata-Version': '3.0', - 'Authorization': 'GoogleLogin auth=' + getAuthToken() - } - }, - function(data){ - data = data.replace('\ufeff', ''); - data = data.replace(/\r\n/mg, '\n'); + { + headers: { + 'Gdata-Version': '3.0', + 'Authorization': 'GoogleLogin auth=' + getAuthToken() + } + }, + function(data){ + data = data.replace('\ufeff', ''); + data = data.replace(/\r\n/mg, '\n'); - // strip out all text annotations - data = data.replace(/\[[a-zA-Z]{1,2}\]/mg, ''); + // strip out all text annotations + data = data.replace(/\[[a-zA-Z]{1,2}\]/mg, ''); - // strip out all docos comments - data = data.replace(/^[^\s_]+:\n\S+[\S\s]*$/m, ''); + // strip out all docos comments + data = data.replace(/^[^\s_]+:\n\S+[\S\s]*$/m, ''); - // fix smart-quotes - data = data.replace(/[“”]/g, '"'); - data = data.replace(/[‘’]/g, "'"); + // fix smart-quotes + data = data.replace(/[“”]/g, '"'); + data = data.replace(/[‘’]/g, "'"); - data = data + '\n'; + data = data + '\n'; - //this should be a bug in Google Doc API, hence need to remove this once the bug is fixed - data = data.replace(/\n\n/g, '\n'); + //this should be a bug in Google Doc API, hence need to remove this once the bug is fixed + data = data.replace(/\n\n/g, '\n'); - fs.writeFileSync('docs/content/' + collection + '/' + name, reflow(data, 100)); - } - ); + fs.writeFileSync('docs/content/' + collection + '/' + name, reflow(data, 100)); + } + ); } /** @@ -111,34 +113,34 @@ function download(collection, name, url) { */ function login(username, password){ request('POST', 'https://www.google.com/accounts/ClientLogin', - { - data: { - Email: username, - Passwd: password, - accountType: 'GOOGLE', - service: 'writely', - 'Gdata-version': '3.0' - }, - headers: { - 'Content-type': 'application/x-www-form-urlencoded' - } + { + data: { + Email: username, + Passwd: password, + accountType: 'GOOGLE', + service: 'writely', + 'Gdata-version': '3.0' }, - function(chunk){ - var token; - chunk.split('\n').forEach(function(line){ - var parts = line.split('='); - if (parts[0] == 'Auth') { - token = parts[1]; - } - }); - if (token) { - fs.writeFileSync('tmp/gdocs.auth', token); - console.log("logged in, token saved in 'tmp/gdocs.auth'"); - } else { - console.log('failed to log in'); + headers: { + 'Content-type': 'application/x-www-form-urlencoded' + } + }, + function(chunk){ + var token; + chunk.split('\n').forEach(function(line){ + var parts = line.split('='); + if (parts[0] == 'Auth') { + token = parts[1]; } + }); + if (token) { + fs.writeFileSync('tmp/gdocs.auth', token); + console.log("logged in, token saved in 'tmp/gdocs.auth'"); + } else { + console.log('failed to log in'); } - ); + } + ); } function getAuthToken() { @@ -152,17 +154,18 @@ function getAuthToken() { } function request(method, url, options, response) { - var url = url.match(/http(s?):\/\/(.+?)(\/.*)/); + url = url.match(/http(s?):\/\/(.+?)(\/.*)/); var isHttps = url[1]; - var request = (isHttps ? https : http).request({ + var req = (isHttps ? https : http).request({ host: url[2], port: (url[1] ? 443 : 80), path: url[3], method: method }, function(res){ + var data; switch (res.statusCode) { case 200: - var data = []; + data = []; res.setEncoding('utf8'); res.on('end', function () { response(data.join('')); }); res.on('close', function () { response(data.join('')); }); // https @@ -173,7 +176,7 @@ function request(method, url, options, response) { console.log('Eror: Login credentials expired! Please login.'); break; default: - var data = []; + data = []; console.log('ERROR: ', res.statusCode); console.log('REQUEST URL: ', url[0]); console.log('REQUEST POST: ', options.data); @@ -186,14 +189,14 @@ function request(method, url, options, response) { } }); for(var header in options.headers) { - request.setHeader(header, options.headers[header]); + req.setHeader(header, options.headers[header]); } if (options.data) - request.write(encodeData(options.data)); - request.on('end', function() { + req.write(encodeData(options.data)); + req.on('end', function() { console.log('end'); }); - request.end(); + req.end(); } function encodeData(obj) { @@ -215,7 +218,9 @@ function askPassword(callback) { stdin.on("data", function(c) { c = c + ""; switch (c) { - case "\n": case "\r": case "\u0004": + case "\n": + case "\r": + case "\u0004": stdio.setRawMode(false); stdin.pause(); callback(password); @@ -227,7 +232,7 @@ function askPassword(callback) { password += c; break; } - }) + }); } diff --git a/karma-docs.conf.js b/karma-docs.conf.js index ea9dfb26a29e..697b1726a0de 100644 --- a/karma-docs.conf.js +++ b/karma-docs.conf.js @@ -1,3 +1,5 @@ +'use strict'; + var sharedConfig = require('./karma-shared.conf'); module.exports = function(config) { diff --git a/karma-jqlite.conf.js b/karma-jqlite.conf.js index 7b511720d212..f198ab41616d 100644 --- a/karma-jqlite.conf.js +++ b/karma-jqlite.conf.js @@ -1,3 +1,5 @@ +'use strict'; + var angularFiles = require('./angularFiles'); var sharedConfig = require('./karma-shared.conf'); diff --git a/karma-jquery.conf.js b/karma-jquery.conf.js index 6a592d6a4704..319fd297cc0a 100644 --- a/karma-jquery.conf.js +++ b/karma-jquery.conf.js @@ -1,3 +1,5 @@ +'use strict'; + var angularFiles = require('./angularFiles'); var sharedConfig = require('./karma-shared.conf'); diff --git a/karma-modules.conf.js b/karma-modules.conf.js index ecbaee212643..aecc0bf865cb 100644 --- a/karma-modules.conf.js +++ b/karma-modules.conf.js @@ -1,3 +1,5 @@ +'use strict'; + var angularFiles = require('./angularFiles'); var sharedConfig = require('./karma-shared.conf'); diff --git a/karma-shared.conf.js b/karma-shared.conf.js index d70b9747fd42..3ef568973e9a 100644 --- a/karma-shared.conf.js +++ b/karma-shared.conf.js @@ -1,3 +1,5 @@ +'use strict'; + module.exports = function(config, specificOptions) { config.set({ frameworks: ['jasmine'], @@ -158,7 +160,7 @@ module.exports = function(config, specificOptions) { // ignore web-server's 404s if (log.categoryName === 'web-server' && log.level.levelStr === config.LOG_WARN && - IGNORED_404.some(function(ignoredLog) {return msg.indexOf(ignoredLog) !== -1})) { + IGNORED_404.some(function(ignoredLog) {return msg.indexOf(ignoredLog) !== -1;})) { return; } diff --git a/lib/browser-stack/start-tunnel.js b/lib/browser-stack/start-tunnel.js index 780f444438a6..ac242df98345 100644 --- a/lib/browser-stack/start-tunnel.js +++ b/lib/browser-stack/start-tunnel.js @@ -1,3 +1,5 @@ +'use strict'; + var fs = require('fs'); var http = require('http'); var BrowserStackTunnel = require('browserstacktunnel-wrapper'); diff --git a/lib/grunt/plugins.js b/lib/grunt/plugins.js index 58455d48d988..cbf32cf360c7 100644 --- a/lib/grunt/plugins.js +++ b/lib/grunt/plugins.js @@ -1,3 +1,5 @@ +'use strict'; + var bower = require('bower'); var util = require('./utils.js'); var shelljs = require('shelljs'); diff --git a/lib/grunt/utils.js b/lib/grunt/utils.js index 53e026bd7fc5..b4889c61bc1e 100644 --- a/lib/grunt/utils.js +++ b/lib/grunt/utils.js @@ -1,3 +1,5 @@ +'use strict'; + var fs = require('fs'); var path = require('path'); var shell = require('shelljs'); diff --git a/lib/promises-aplus/promises-aplus-test-adapter.js b/lib/promises-aplus/promises-aplus-test-adapter.js index 32134161bb6f..2a1fcf1e69af 100644 --- a/lib/promises-aplus/promises-aplus-test-adapter.js +++ b/lib/promises-aplus/promises-aplus-test-adapter.js @@ -1,4 +1,7 @@ -var isFunction = function isFunction(value){return typeof value == 'function';} +/* global qFactory: false */ +'use strict'; + +var isFunction = function isFunction(value){return typeof value == 'function';}; var $q = qFactory(process.nextTick, function noopExceptionHandler() {}); diff --git a/lib/versions/version-info.js b/lib/versions/version-info.js index f81ad006b93b..e20762761323 100644 --- a/lib/versions/version-info.js +++ b/lib/versions/version-info.js @@ -1,10 +1,12 @@ +'use strict'; + var fs = require('fs'); var path = require('path'); var shell = require('shelljs'); var semver = require('semver'); var _ = require('lodash'); -var currentPackage, previousVersions, cdnVersion; +var currentPackage, previousVersions, cdnVersion, gitRepoInfo; /** @@ -154,14 +156,14 @@ var getCdnVersion = function() { } return cdnVersion; }, null); -} +}; /** * Get the unstable snapshot version * @return {SemVer} The snapshot version */ var getSnapshotVersion = function() { - version = _(previousVersions) + var version = _(previousVersions) .filter(function(tag) { return semver.satisfies(tag, currentPackage.branchVersion); }) diff --git a/protractor-conf.js b/protractor-conf.js index 9c937c843432..a3c5e9377c62 100644 --- a/protractor-conf.js +++ b/protractor-conf.js @@ -1,3 +1,5 @@ +'use strict'; + var config = require('./protractor-shared-conf').config; config.specs = [ diff --git a/protractor-jenkins-conf.js b/protractor-jenkins-conf.js index 89750e1586df..8b65a30a9bd8 100644 --- a/protractor-jenkins-conf.js +++ b/protractor-jenkins-conf.js @@ -1,3 +1,5 @@ +'use strict'; + exports.config = { allScriptsTimeout: 11000, @@ -15,6 +17,8 @@ exports.config = { framework: 'jasmine', onPrepare: function() { + /* global angular: false, browser: false, jasmine: false */ + // Disable animations so e2e tests run more quickly var disableNgAnimate = function() { angular.module('disableNgAnimate', []).run(function($animate) { diff --git a/protractor-shared-conf.js b/protractor-shared-conf.js index 5958a663dd95..d2ac3ced7bd8 100644 --- a/protractor-shared-conf.js +++ b/protractor-shared-conf.js @@ -1,3 +1,5 @@ +'use strict'; + exports.config = { allScriptsTimeout: 11000, @@ -6,6 +8,8 @@ exports.config = { framework: 'jasmine', onPrepare: function() { + /* global angular: false, browser: false, jasmine: false */ + // Disable animations so e2e tests run more quickly var disableNgAnimate = function() { angular.module('disableNgAnimate', []).run(function($animate) { diff --git a/protractor-travis-conf.js b/protractor-travis-conf.js index e7f4a9faab1f..c2642bd658f8 100644 --- a/protractor-travis-conf.js +++ b/protractor-travis-conf.js @@ -1,3 +1,5 @@ +'use strict'; + var config = require('./protractor-shared-conf').config; config.sauceUser = process.env.SAUCE_USERNAME; diff --git a/src/.jshintrc b/src/.jshintrc index f1b1c8cc8549..daf4accac47e 100644 --- a/src/.jshintrc +++ b/src/.jshintrc @@ -1,20 +1,5 @@ { - "bitwise": true, - "immed": true, - "newcap": true, - "noarg": true, - "noempty": true, - "nonew": true, - "trailing": true, - "maxlen": 200, - "boss": true, - "eqnull": true, - "expr": true, - "globalstrict": true, - "laxbreak": true, - "loopfunc": true, - "sub": true, - "undef": true, + "extends": "../.jshintrc-base", "browser": true, "globals": { /* auto/injector.js */ @@ -109,7 +94,7 @@ "version": false, "publishExternalAPI": false, - /* minerr.js */ + /* minErr.js */ "minErr": false, /* loader.js */ diff --git a/src/Angular.js b/src/Angular.js index 7e6ab84f6db4..eaaf2f37bc75 100644 --- a/src/Angular.js +++ b/src/Angular.js @@ -1,89 +1,87 @@ 'use strict'; /* We need to tell jshint what variables are being exported */ -/* global - -angular, - -msie, - -jqLite, - -jQuery, - -slice, - -push, - -toString, - -ngMinErr, - -angularModule, - -nodeName_, - -uid, - -REGEX_STRING_REGEXP, - -VALIDITY_STATE_PROPERTY, - - -lowercase, - -uppercase, - -manualLowercase, - -manualUppercase, - -nodeName_, - -isArrayLike, - -forEach, - -sortedKeys, - -forEachSorted, - -reverseParams, - -nextUid, - -setHashKey, - -extend, - -int, - -inherit, - -noop, - -identity, - -valueFn, - -isUndefined, - -isDefined, - -isObject, - -isString, - -isNumber, - -isDate, - -isArray, - -isFunction, - -isRegExp, - -isWindow, - -isScope, - -isFile, - -isBlob, - -isBoolean, - -trim, - -isElement, - -makeMap, - -map, - -size, - -includes, - -indexOf, - -arrayRemove, - -isLeafNode, - -copy, - -shallowCopy, - -equals, - -csp, - -concat, - -sliceArgs, - -bind, - -toJsonReplacer, - -toJson, - -fromJson, - -startingTag, - -tryDecodeURIComponent, - -parseKeyValue, - -toKeyValue, - -encodeUriSegment, - -encodeUriQuery, - -angularInit, - -bootstrap, - -snake_case, - -bindJQuery, - -assertArg, - -assertArgFn, - -assertNotHasOwnProperty, - -getter, - -getBlockElements, - -hasOwnProperty, - +/* global angular: true, + msie: true, + jqLite: true, + jQuery: true, + slice: true, + push: true, + toString: true, + ngMinErr: true, + angularModule: true, + nodeName_: true, + uid: true, + REGEX_STRING_REGEXP: true, + VALIDITY_STATE_PROPERTY: true, + + lowercase: true, + uppercase: true, + manualLowercase: true, + manualUppercase: true, + nodeName_: true, + isArrayLike: true, + forEach: true, + sortedKeys: true, + forEachSorted: true, + reverseParams: true, + nextUid: true, + setHashKey: true, + extend: true, + int: true, + inherit: true, + noop: true, + identity: true, + valueFn: true, + isUndefined: true, + isDefined: true, + isObject: true, + isString: true, + isNumber: true, + isDate: true, + isArray: true, + isFunction: true, + isRegExp: true, + isWindow: true, + isScope: true, + isFile: true, + isBlob: true, + isBoolean: true, + trim: true, + isElement: true, + makeMap: true, + map: true, + size: true, + includes: true, + indexOf: true, + arrayRemove: true, + isLeafNode: true, + copy: true, + shallowCopy: true, + equals: true, + csp: true, + concat: true, + sliceArgs: true, + bind: true, + toJsonReplacer: true, + toJson: true, + fromJson: true, + startingTag: true, + tryDecodeURIComponent: true, + parseKeyValue: true, + toKeyValue: true, + encodeUriSegment: true, + encodeUriQuery: true, + angularInit: true, + bootstrap: true, + snake_case: true, + bindJQuery: true, + assertArg: true, + assertArgFn: true, + assertNotHasOwnProperty: true, + getter: true, + getBlockElements: true, + hasOwnProperty: true, */ //////////////////////////////////// diff --git a/src/AngularPublic.js b/src/AngularPublic.js index 3e741e8ed2e1..c537853ab5b9 100644 --- a/src/AngularPublic.js +++ b/src/AngularPublic.js @@ -1,88 +1,87 @@ 'use strict'; -/* global - angularModule: true, - version: true, +/* global angularModule: true, + version: true, - $LocaleProvider, - $CompileProvider, + $LocaleProvider, + $CompileProvider, - htmlAnchorDirective, - inputDirective, - inputDirective, - formDirective, - scriptDirective, - selectDirective, - styleDirective, - optionDirective, - ngBindDirective, - ngBindHtmlDirective, - ngBindTemplateDirective, - ngClassDirective, - ngClassEvenDirective, - ngClassOddDirective, - ngCspDirective, - ngCloakDirective, - ngControllerDirective, - ngFormDirective, - ngHideDirective, - ngIfDirective, - ngIncludeDirective, - ngIncludeFillContentDirective, - ngInitDirective, - ngNonBindableDirective, - ngPluralizeDirective, - ngRepeatDirective, - ngShowDirective, - ngStyleDirective, - ngSwitchDirective, - ngSwitchWhenDirective, - ngSwitchDefaultDirective, - ngOptionsDirective, - ngTranscludeDirective, - ngModelDirective, - ngListDirective, - ngChangeDirective, - patternDirective, - patternDirective, - requiredDirective, - requiredDirective, - minlengthDirective, - minlengthDirective, - maxlengthDirective, - maxlengthDirective, - ngValueDirective, - ngModelOptionsDirective, - ngAttributeAliasDirectives, - ngEventDirectives, + htmlAnchorDirective, + inputDirective, + inputDirective, + formDirective, + scriptDirective, + selectDirective, + styleDirective, + optionDirective, + ngBindDirective, + ngBindHtmlDirective, + ngBindTemplateDirective, + ngClassDirective, + ngClassEvenDirective, + ngClassOddDirective, + ngCspDirective, + ngCloakDirective, + ngControllerDirective, + ngFormDirective, + ngHideDirective, + ngIfDirective, + ngIncludeDirective, + ngIncludeFillContentDirective, + ngInitDirective, + ngNonBindableDirective, + ngPluralizeDirective, + ngRepeatDirective, + ngShowDirective, + ngStyleDirective, + ngSwitchDirective, + ngSwitchWhenDirective, + ngSwitchDefaultDirective, + ngOptionsDirective, + ngTranscludeDirective, + ngModelDirective, + ngListDirective, + ngChangeDirective, + patternDirective, + patternDirective, + requiredDirective, + requiredDirective, + minlengthDirective, + minlengthDirective, + maxlengthDirective, + maxlengthDirective, + ngValueDirective, + ngModelOptionsDirective, + ngAttributeAliasDirectives, + ngEventDirectives, - $AnchorScrollProvider, - $AnimateProvider, - $BrowserProvider, - $CacheFactoryProvider, - $ControllerProvider, - $DocumentProvider, - $ExceptionHandlerProvider, - $FilterProvider, - $InterpolateProvider, - $IntervalProvider, - $HttpProvider, - $HttpBackendProvider, - $LocationProvider, - $LogProvider, - $ParseProvider, - $RootScopeProvider, - $QProvider, - $$QProvider, - $$SanitizeUriProvider, - $SceProvider, - $SceDelegateProvider, - $SnifferProvider, - $TemplateCacheProvider, - $TimeoutProvider, - $$RAFProvider, - $$AsyncCallbackProvider, - $WindowProvider + $AnchorScrollProvider, + $AnimateProvider, + $BrowserProvider, + $CacheFactoryProvider, + $ControllerProvider, + $DocumentProvider, + $ExceptionHandlerProvider, + $FilterProvider, + $InterpolateProvider, + $IntervalProvider, + $HttpProvider, + $HttpBackendProvider, + $LocationProvider, + $LogProvider, + $ParseProvider, + $RootScopeProvider, + $QProvider, + $$QProvider, + $$SanitizeUriProvider, + $SceProvider, + $SceDelegateProvider, + $SnifferProvider, + $TemplateCacheProvider, + $TimeoutProvider, + $$RAFProvider, + $$AsyncCallbackProvider, + $WindowProvider */ diff --git a/src/jqLite.js b/src/jqLite.js index 0cce8f34afd1..06205b44d80f 100644 --- a/src/jqLite.js +++ b/src/jqLite.js @@ -1,12 +1,10 @@ 'use strict'; -/* global - - -JQLitePrototype, - -addEventListenerFn, - -removeEventListenerFn, - -BOOLEAN_ATTR, - -ALIASED_ATTR +/* global JQLitePrototype: true, + addEventListenerFn: true, + removeEventListenerFn: true, + BOOLEAN_ATTR: true, + ALIASED_ATTR: true, */ ////////////////////////////////// diff --git a/src/ng/directive/input.js b/src/ng/directive/input.js index 558cce14fe7a..bf421bfc56de 100644 --- a/src/ng/directive/input.js +++ b/src/ng/directive/input.js @@ -1,13 +1,11 @@ 'use strict'; -/* global - - -VALID_CLASS, - -INVALID_CLASS, - -PRISTINE_CLASS, - -DIRTY_CLASS, - -UNTOUCHED_CLASS, - -TOUCHED_CLASS +/* global VALID_CLASS: true, + INVALID_CLASS: true, + PRISTINE_CLASS: true, + DIRTY_CLASS: true, + UNTOUCHED_CLASS: true, + TOUCHED_CLASS: true, */ var URL_REGEXP = /^(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?$/; diff --git a/src/ng/filter.js b/src/ng/filter.js index b7fdc8ff2a00..8e32fdb7033a 100644 --- a/src/ng/filter.js +++ b/src/ng/filter.js @@ -1,5 +1,16 @@ 'use strict'; +/* global currencyFilter: true, + dateFilter: true, + filterFilter: true, + jsonFilter: true, + limitToFilter: true, + lowercaseFilter: true, + numberFilter: true, + orderByFilter: true, + uppercaseFilter: true, + */ + /** * @ngdoc provider * @name $filterProvider diff --git a/src/ngAnimate/.jshintrc b/src/ngAnimate/.jshintrc index 6a4072b22efa..b738582198ed 100644 --- a/src/ngAnimate/.jshintrc +++ b/src/ngAnimate/.jshintrc @@ -1,20 +1,6 @@ { - "bitwise": true, - "immed": true, - "newcap": true, - "noarg": true, - "noempty": true, - "nonew": true, - "trailing": true, + "extends": "../../.jshintrc-base", "maxlen": false, /* ngAnimate docs contain wide tables */ - "boss": true, - "eqnull": true, - "expr": true, - "globalstrict": true, - "laxbreak": true, - "loopfunc": true, - "sub": true, - "undef": true, "browser": true, "globals": { "angular": false diff --git a/src/ngCookies/.jshintrc b/src/ngCookies/.jshintrc index fc5bd37b2523..b60c2a92f975 100644 --- a/src/ngCookies/.jshintrc +++ b/src/ngCookies/.jshintrc @@ -1,20 +1,5 @@ { - "bitwise": true, - "immed": true, - "newcap": true, - "noarg": true, - "noempty": true, - "nonew": true, - "trailing": true, - "maxlen": 100, - "boss": true, - "eqnull": true, - "expr": true, - "globalstrict": true, - "laxbreak": true, - "loopfunc": true, - "sub": true, - "undef": true, + "extends": "../../.jshintrc-base", "browser": true, "globals": { "angular": false diff --git a/src/ngLocale/.jshintrc b/src/ngLocale/.jshintrc index baa4101226ed..7d6fdd37a994 100644 --- a/src/ngLocale/.jshintrc +++ b/src/ngLocale/.jshintrc @@ -1,20 +1,7 @@ { + "extends": "../../.jshintrc-base", "bitwise": false, /* locale files use bitwise operators */ - "immed": true, - "newcap": true, - "noarg": true, - "noempty": true, - "nonew": true, - "trailing": true, "maxlen": false, /* locale files are generated from a 3rd party library that has long lines */ - "boss": true, - "eqnull": true, - "expr": true, - "globalstrict": true, - "laxbreak": true, - "loopfunc": true, - "sub": true, - "undef": true, "browser": true, "globals": { "angular": false diff --git a/src/ngMock/.jshintrc b/src/ngMock/.jshintrc index 9d19c8f496ef..415ab1bea7a7 100644 --- a/src/ngMock/.jshintrc +++ b/src/ngMock/.jshintrc @@ -1,20 +1,5 @@ { - "bitwise": true, - "immed": true, - "newcap": true, - "noarg": true, - "noempty": true, - "nonew": true, - "trailing": true, - "maxlen": 100, - "boss": true, - "eqnull": true, - "expr": true, - "globalstrict": true, - "laxbreak": true, - "loopfunc": true, - "sub": true, - "undef": true, + "extends": "../../.jshintrc-base", "browser": true, "globals": { "angular": false, diff --git a/src/ngResource/.jshintrc b/src/ngResource/.jshintrc index fc5bd37b2523..b60c2a92f975 100644 --- a/src/ngResource/.jshintrc +++ b/src/ngResource/.jshintrc @@ -1,20 +1,5 @@ { - "bitwise": true, - "immed": true, - "newcap": true, - "noarg": true, - "noempty": true, - "nonew": true, - "trailing": true, - "maxlen": 100, - "boss": true, - "eqnull": true, - "expr": true, - "globalstrict": true, - "laxbreak": true, - "loopfunc": true, - "sub": true, - "undef": true, + "extends": "../../.jshintrc-base", "browser": true, "globals": { "angular": false diff --git a/src/ngRoute/.jshintrc b/src/ngRoute/.jshintrc index 4d47ea839b95..f9d3dc812290 100644 --- a/src/ngRoute/.jshintrc +++ b/src/ngRoute/.jshintrc @@ -1,20 +1,5 @@ { - "bitwise": true, - "immed": true, - "newcap": true, - "noarg": true, - "noempty": true, - "nonew": true, - "trailing": true, - "maxlen": 100, - "boss": true, - "eqnull": true, - "expr": true, - "globalstrict": true, - "laxbreak": true, - "loopfunc": true, - "sub": true, - "undef": true, + "extends": "../../.jshintrc-base", "browser": true, "globals": { "angular": false, diff --git a/src/ngSanitize/.jshintrc b/src/ngSanitize/.jshintrc index d75712a28609..88488b0b4e56 100644 --- a/src/ngSanitize/.jshintrc +++ b/src/ngSanitize/.jshintrc @@ -1,20 +1,5 @@ { - "bitwise": true, - "immed": true, - "newcap": true, - "noarg": true, - "noempty": true, - "nonew": true, - "trailing": true, - "maxlen": 100, - "boss": true, - "eqnull": true, - "expr": true, - "globalstrict": true, - "laxbreak": true, - "loopfunc": true, - "sub": true, - "undef": true, + "extends": "../../.jshintrc-base", "browser": true, "globals": { "angular": false, diff --git a/src/ngScenario/.jshintrc b/src/ngScenario/.jshintrc index 06dd6f58a07d..59cdd02476c0 100644 --- a/src/ngScenario/.jshintrc +++ b/src/ngScenario/.jshintrc @@ -1,20 +1,5 @@ { - "bitwise": true, - "immed": true, - "newcap": true, - "noarg": true, - "noempty": true, - "nonew": true, - "trailing": true, - "maxlen": 100, - "boss": true, - "eqnull": true, - "expr": true, - "globalstrict": true, - "laxbreak": true, - "loopfunc": true, - "sub": true, - "undef": true, + "extends": "../../.jshintrc-base", "browser": true, "globals": { "angular": false, diff --git a/src/ngTouch/.jshintrc b/src/ngTouch/.jshintrc index cf30c37fa71d..eb74f8abad51 100644 --- a/src/ngTouch/.jshintrc +++ b/src/ngTouch/.jshintrc @@ -1,20 +1,5 @@ { - "bitwise": true, - "immed": true, - "newcap": true, - "noarg": true, - "noempty": true, - "nonew": true, - "trailing": true, - "maxlen": 100, - "boss": true, - "eqnull": true, - "expr": true, - "globalstrict": true, - "laxbreak": true, - "loopfunc": true, - "sub": true, - "undef": true, + "extends": "../../.jshintrc-base", "browser": true, "globals": { "angular": false, diff --git a/test/.jshintrc b/test/.jshintrc index 0127b87819e7..8be371609fdb 100644 --- a/test/.jshintrc +++ b/test/.jshintrc @@ -1,22 +1,6 @@ { - "bitwise": true, - "immed": true, - "newcap": true, - "noarg": true, - "noempty": true, - "nonew": true, - "trailing": true, - "maxlen": 200, - "boss": true, - "eqnull": true, - "expr": true, - "globalstrict": true, - "laxbreak": true, - "loopfunc": true, - "sub": true, - "undef": true, + "extends": "../.jshintrc-base", "browser": true, - "indent": 2, "globals": { /* auto/injector.js */ "createInjector": false, @@ -39,7 +23,6 @@ "uppercase": false, "manualLowercase": false, "manualUppercase": false, - "nodeName_": false, "isArrayLike": false, "forEach": false, "sortedKeys": false, diff --git a/validate-commit-msg.js b/validate-commit-msg.js index c68ebb7466d7..f0c23fda950a 100755 --- a/validate-commit-msg.js +++ b/validate-commit-msg.js @@ -8,12 +8,15 @@ * >> cd * >> ln -s ../../validate-commit-msg.js .git/hooks/commit-msg */ + +'use strict'; + var fs = require('fs'); var util = require('util'); var MAX_LENGTH = 100; -var PATTERN = /^(?:fixup!\s*)?(\w*)(\(([\w\$\.\-\*/]*)\))?\: (.*)$/; +var PATTERN = /^(?:fixup!\s*)?(\w*)(\(([\w\$\.\*/-]*)\))?\: (.*)$/; var IGNORED = /^WIP\:/; var TYPES = { feat: true, diff --git a/validate-commit-msg.spec.js b/validate-commit-msg.spec.js index cc4b4c3c5bac..968ee048fd72 100644 --- a/validate-commit-msg.spec.js +++ b/validate-commit-msg.spec.js @@ -1,3 +1,6 @@ +/* global describe: false, beforeEach: false, it: false, expect: false, spyOn: false */ +'use strict'; + describe('validate-commit-msg.js', function() { var m = require('./validate-commit-msg'); var errors = [];