diff options
| -rw-r--r-- | Gruntfile.js | 72 | ||||
| -rwxr-xr-x | angularFiles.js | 58 | ||||
| -rw-r--r-- | package.json | 5 | ||||
| -rw-r--r-- | src/.jshintrc | 164 | ||||
| -rw-r--r-- | src/ngAnimate/.jshintrc | 22 | ||||
| -rw-r--r-- | src/ngCookies/.jshintrc | 22 | ||||
| -rw-r--r-- | src/ngLocale/.jshintrc | 23 | ||||
| -rw-r--r-- | src/ngMock/.jshintrc | 25 | ||||
| -rw-r--r-- | src/ngResource/.jshintrc | 22 | ||||
| -rw-r--r-- | src/ngRoute/.jshintrc | 23 | ||||
| -rw-r--r-- | src/ngSanitize/.jshintrc | 23 | ||||
| -rw-r--r-- | src/ngScenario/.jshintrc | 38 | ||||
| -rw-r--r-- | src/ngTouch/.jshintrc | 23 |
13 files changed, 482 insertions, 38 deletions
diff --git a/Gruntfile.js b/Gruntfile.js index 8c957e63..1b7b198c 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -13,6 +13,7 @@ module.exports = function(grunt) { grunt.loadNpmTasks('grunt-merge-conflict'); grunt.loadNpmTasks('grunt-parallel'); grunt.loadNpmTasks('grunt-shell'); + grunt.loadNpmTasks('grunt-contrib-jshint'); grunt.loadTasks('lib/grunt'); var NG_VERSION = util.getVersion(); @@ -104,6 +105,48 @@ module.exports = function(grunt) { tmp: ['tmp'] }, + jshint: { + ng: { + files: { src: files['angularSrc'] }, + options: { jshintrc: 'src/.jshintrc' } + }, + ngAnimate: { + files: { src: 'src/ngAnimate/**/*.js' }, + options: { jshintrc: 'src/ngAnimate/.jshintrc' } + }, + ngCookies: { + files: { src: 'src/ngCookies/**/*.js' }, + options: { jshintrc: 'src/ngCookies/.jshintrc' } + }, + ngLocale: { + files: { src: 'src/ngLocale/**/*.js' }, + options: { jshintrc: 'src/ngLocale/.jshintrc' } + }, + ngMock: { + files: { src: 'src/ngMock/**/*.js' }, + options: { jshintrc: 'src/ngMock/.jshintrc' } + }, + ngResource: { + files: { src: 'src/ngResource/**/*.js' }, + options: { jshintrc: 'src/ngResource/.jshintrc' } + }, + ngRoute: { + files: { src: 'src/ngRoute/**/*.js' }, + options: { jshintrc: 'src/ngRoute/.jshintrc' } + }, + ngSanitize: { + files: { src: 'src/ngSanitize/**/*.js' }, + options: { jshintrc: 'src/ngSanitize/.jshintrc' } + }, + ngScenario: { + files: { src: 'src/ngScenario/**/*.js' }, + options: { jshintrc: 'src/ngScenario/.jshintrc' } + }, + ngTouch: { + files: { src: 'src/ngTouch/**/*.js' }, + options: { jshintrc: 'src/ngTouch/.jshintrc' } + } + }, build: { scenario: { @@ -127,49 +170,36 @@ module.exports = function(grunt) { }, loader: { dest: 'build/angular-loader.js', - src: util.wrap(['src/loader.js'], 'loader') + src: util.wrap(files['angularLoader'], 'loader') }, touch: { dest: 'build/angular-touch.js', - src: util.wrap([ - 'src/ngTouch/touch.js', - 'src/ngTouch/swipe.js', - 'src/ngTouch/directive/ngClick.js', - 'src/ngTouch/directive/ngSwipe.js' - ], 'module') + src: util.wrap(files['angularModules']['ngTouch'], 'module') }, mocks: { dest: 'build/angular-mocks.js', - src: ['src/ngMock/angular-mocks.js'], + src: files['angularModules']['ngMock'], strict: false }, sanitize: { dest: 'build/angular-sanitize.js', - src: util.wrap([ - 'src/ngSanitize/sanitize.js', - 'src/ngSanitize/filter/linky.js' - ], 'module') + src: util.wrap(files['angularModules']['ngSanitize'], 'module') }, resource: { dest: 'build/angular-resource.js', - src: util.wrap(['src/ngResource/resource.js'], 'module') + src: util.wrap(files['angularModules']['ngResource'], 'module') }, animate: { dest: 'build/angular-animate.js', - src: util.wrap(['src/ngAnimate/animate.js'], 'module') + src: util.wrap(files['angularModules']['ngAnimate'], 'module') }, route: { dest: 'build/angular-route.js', - src: util.wrap([ - 'src/ngRoute/routeUtils.js', - 'src/ngRoute/route.js', - 'src/ngRoute/routeParams.js', - 'src/ngRoute/directive/ngView.js' - ], 'module') + src: util.wrap(files['angularModules']['ngRoute'], 'module') }, cookies: { dest: 'build/angular-cookies.js', - src: util.wrap(['src/ngCookies/cookies.js'], 'module') + src: util.wrap(files['angularModules']['ngCookies'], 'module') }, "promises-aplus-adapter": { dest:'tmp/promises-aplus-adapter++.js', diff --git a/angularFiles.js b/angularFiles.js index 946cff45..9603c289 100755 --- a/angularFiles.js +++ b/angularFiles.js @@ -65,24 +65,40 @@ angularFiles = { 'src/ng/directive/style.js' ], - 'angularSrcModules': [ - 'src/ngAnimate/animate.js', - 'src/ngCookies/cookies.js', - 'src/ngResource/resource.js', - 'src/ngRoute/routeUtils.js', - 'src/ngRoute/route.js', - 'src/ngRoute/routeParams.js', - 'src/ngRoute/directive/ngView.js', - 'src/ngSanitize/sanitize.js', - 'src/ngSanitize/filter/linky.js', - 'src/ngMock/angular-mocks.js', - 'src/ngTouch/touch.js', - 'src/ngTouch/swipe.js', - 'src/ngTouch/directive/ngClick.js', - 'src/ngTouch/directive/ngSwipe.js', - 'docs/components/angular-bootstrap/bootstrap.js', + 'angularLoader': [ + 'src/loader.js' ], + 'angularModules': { + 'ngAnimate': [ + 'src/ngAnimate/animate.js' + ], + 'ngCookies': [ + 'src/ngCookies/cookies.js' + ], + 'ngResource': [ + 'src/ngResource/resource.js' + ], + 'ngRoute': [ + 'src/ngRoute/route.js', + 'src/ngRoute/routeParams.js', + 'src/ngRoute/directive/ngView.js' + ], + 'ngSanitize': [ + 'src/ngSanitize/sanitize.js', + 'src/ngSanitize/filter/linky.js' + ], + 'ngMock': [ + 'src/ngMock/angular-mocks.js' + ], + 'ngTouch': [ + 'src/ngTouch/touch.js', + 'src/ngTouch/swipe.js', + 'src/ngTouch/directive/ngClick.js', + 'src/ngTouch/directive/ngSwipe.js' + ], + }, + 'angularScenario': [ 'src/ngScenario/Scenario.js', 'src/ngScenario/browserTrigger.js', @@ -172,6 +188,16 @@ angularFiles = { ] }; +angularFiles['angularSrcModules'] = [].concat( + angularFiles['angularModules']['ngAnimate'], + angularFiles['angularModules']['ngCookies'], + angularFiles['angularModules']['ngResource'], + angularFiles['angularModules']['ngRoute'], + angularFiles['angularModules']['ngSanitize'], + angularFiles['angularModules']['ngMock'], + angularFiles['angularModules']['ngTouch'] +); + if (exports) { exports.files = angularFiles; exports.mergeFilesFor = function() { diff --git a/package.json b/package.json index 068f63ba..fdd99a95 100644 --- a/package.json +++ b/package.json @@ -44,5 +44,8 @@ "type": "MIT", "url": "https://github.com/angular/angular.js/blob/master/LICENSE" } - ] + ], + "dependencies": { + "grunt-contrib-jshint": "~0.6.4" + } } diff --git a/src/.jshintrc b/src/.jshintrc new file mode 100644 index 00000000..754c27dc --- /dev/null +++ b/src/.jshintrc @@ -0,0 +1,164 @@ +{ + "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, + "browser": true, + "globals": { + /* auto/injector.js */ + "createInjector": false, + + /* angular.js */ + "angular": false, + "msie": false, + "jqLite": false, + "jQuery": false, + "slice": false, + "push": false, + "toString": false, + "ngMinErr": false, + "_angular": false, + "angularModule": false, + "nodeName_": false, + "uid": false, + + "lowercase": false, + "uppercase": false, + "manualLowercase": false, + "manualUppercase": false, + "nodeName_": false, + "isArrayLike": false, + "forEach": false, + "sortedKeys": false, + "forEachSorted": false, + "reverseParams": false, + "nextUid": false, + "setHashKey": false, + "extend": false, + "int": false, + "inherit": false, + "noop": false, + "identity": false, + "valueFn": false, + "isUndefined": false, + "isDefined": false, + "isObject": false, + "isString": false, + "isNumber": false, + "isDate": false, + "isArray": false, + "isFunction": false, + "isRegExp": false, + "isWindow": false, + "isScope": false, + "isFile": false, + "isBoolean": false, + "trim": false, + "isElement": false, + "makeMap": false, + "map": false, + "size": false, + "includes": false, + "indexOf": false, + "arrayRemove": false, + "isLeafNode": false, + "copy": false, + "shallowCopy": false, + "equals": false, + "csp": false, + "concat": false, + "sliceArgs": false, + "bind": false, + "toJsonReplacer": false, + "toJson": false, + "fromJson": false, + "toBoolean": false, + "startingTag": false, + "tryDecodeURIComponent": false, + "parseKeyValue": false, + "toKeyValue": false, + "encodeUriSegment": false, + "encodeUriQuery": false, + "angularInit": false, + "bootstrap": false, + "snake_case": false, + "bindJQuery": false, + "assertArg": false, + "assertArgFn": false, + "assertNotHasOwnProperty": false, + "getter": false, + + /* AngularPublic.js */ + "version": false, + "publishExternalAPI": false, + + /* minerr.js */ + "minErr": false, + + /* loader.js */ + "setupModuleLoader": false, + + /* jqLite.js */ + "BOOLEAN_ATTR": false, + "jqNextId": false, + "camelCase": false, + "jqLitePatchJQueryRemove": false, + "JQLite": false, + "jqLiteClone": false, + "jqLiteDealoc": false, + "jqLiteOff": false, + "jqLiteRemoveData": false, + "jqLiteExpandoStore": false, + "jqLiteData": false, + "jqLiteHasClass": false, + "jqLiteRemoveClass": false, + "jqLiteAddClass": false, + "jqLiteAddNodes": false, + "jqLiteController": false, + "jqLiteInheritedData": false, + "getBooleanAttrName": false, + "createEventHandler": false, + "JQLitePrototype": false, + "addEventListenerFn": false, + "removeEventListenerFn": false, + + /* apis.js */ + "hashKey": false, + "HashMap": false, + + /* urlUtils.js */ + "urlResolve": false, + "urlIsSameOrigin": false, + + /* ng/compile.js */ + "directiveNormalize": false, + + /* ng/parse.js */ + "setter": false, + + /* ng/directive/directives.js */ + "ngDirective": false, + + /* ng/directive/input.js */ + "VALID_CLASS": false, + "INVALID_CLASS": false, + "PRISTINE_CLASS": false, + "DIRTY_CLASS": false, + + /* ng/directive/form.js */ + "nullFormCtrl": false + + } +}
\ No newline at end of file diff --git a/src/ngAnimate/.jshintrc b/src/ngAnimate/.jshintrc new file mode 100644 index 00000000..6a4072b2 --- /dev/null +++ b/src/ngAnimate/.jshintrc @@ -0,0 +1,22 @@ +{ + "bitwise": true, + "immed": true, + "newcap": true, + "noarg": true, + "noempty": true, + "nonew": true, + "trailing": true, + "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 + } +}
\ No newline at end of file diff --git a/src/ngCookies/.jshintrc b/src/ngCookies/.jshintrc new file mode 100644 index 00000000..fc5bd37b --- /dev/null +++ b/src/ngCookies/.jshintrc @@ -0,0 +1,22 @@ +{ + "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, + "browser": true, + "globals": { + "angular": false + } +}
\ No newline at end of file diff --git a/src/ngLocale/.jshintrc b/src/ngLocale/.jshintrc new file mode 100644 index 00000000..baa41012 --- /dev/null +++ b/src/ngLocale/.jshintrc @@ -0,0 +1,23 @@ +{ + "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 + }, + "-W041": false +}
\ No newline at end of file diff --git a/src/ngMock/.jshintrc b/src/ngMock/.jshintrc new file mode 100644 index 00000000..46d8799b --- /dev/null +++ b/src/ngMock/.jshintrc @@ -0,0 +1,25 @@ +{ + "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, + "browser": true, + "globals": { + "angular": false, + "expect": false, + "beforeEach": false, + "afterEach": false + } +}
\ No newline at end of file diff --git a/src/ngResource/.jshintrc b/src/ngResource/.jshintrc new file mode 100644 index 00000000..fc5bd37b --- /dev/null +++ b/src/ngResource/.jshintrc @@ -0,0 +1,22 @@ +{ + "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, + "browser": true, + "globals": { + "angular": false + } +}
\ No newline at end of file diff --git a/src/ngRoute/.jshintrc b/src/ngRoute/.jshintrc new file mode 100644 index 00000000..4d47ea83 --- /dev/null +++ b/src/ngRoute/.jshintrc @@ -0,0 +1,23 @@ +{ + "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, + "browser": true, + "globals": { + "angular": false, + "ngRouteModule": false + } +}
\ No newline at end of file diff --git a/src/ngSanitize/.jshintrc b/src/ngSanitize/.jshintrc new file mode 100644 index 00000000..d75712a2 --- /dev/null +++ b/src/ngSanitize/.jshintrc @@ -0,0 +1,23 @@ +{ + "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, + "browser": true, + "globals": { + "angular": false, + "htmlSanitizeWriter": false + } +}
\ No newline at end of file diff --git a/src/ngScenario/.jshintrc b/src/ngScenario/.jshintrc new file mode 100644 index 00000000..06dd6f58 --- /dev/null +++ b/src/ngScenario/.jshintrc @@ -0,0 +1,38 @@ +{ + "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, + "browser": true, + "globals": { + "angular": false, + "includes": false, + "asyncForEach": false, + "msie": false, + "browserTrigger": false, + "console": false, + "alert": false, + "indexOf": false, + "_jQuery": false, + "angularInit": false, + "formatException": false, + "AnimationEvent": false, + "TransitionEvent": false, + "WebKitAnimationEvent": false, + "WebKitTransitionEvent": false, + "$runner": false, + "callerFile": false + } +}
\ No newline at end of file diff --git a/src/ngTouch/.jshintrc b/src/ngTouch/.jshintrc new file mode 100644 index 00000000..cf30c37f --- /dev/null +++ b/src/ngTouch/.jshintrc @@ -0,0 +1,23 @@ +{ + "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, + "browser": true, + "globals": { + "angular": false, + "ngTouch": false + } +}
\ No newline at end of file |
