Skip to content

Commit 934a95d

Browse files
petebacondarwinvojtajina
authored andcommitted
chore(grunt): add jshint tasks
1 parent 2d8d6dd commit 934a95d

File tree

13 files changed

+482
-38
lines changed

13 files changed

+482
-38
lines changed

Gruntfile.js

+51-21
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ module.exports = function(grunt) {
1313
grunt.loadNpmTasks('grunt-merge-conflict');
1414
grunt.loadNpmTasks('grunt-parallel');
1515
grunt.loadNpmTasks('grunt-shell');
16+
grunt.loadNpmTasks('grunt-contrib-jshint');
1617
grunt.loadTasks('lib/grunt');
1718

1819
var NG_VERSION = util.getVersion();
@@ -104,6 +105,48 @@ module.exports = function(grunt) {
104105
tmp: ['tmp']
105106
},
106107

108+
jshint: {
109+
ng: {
110+
files: { src: files['angularSrc'] },
111+
options: { jshintrc: 'src/.jshintrc' }
112+
},
113+
ngAnimate: {
114+
files: { src: 'src/ngAnimate/**/*.js' },
115+
options: { jshintrc: 'src/ngAnimate/.jshintrc' }
116+
},
117+
ngCookies: {
118+
files: { src: 'src/ngCookies/**/*.js' },
119+
options: { jshintrc: 'src/ngCookies/.jshintrc' }
120+
},
121+
ngLocale: {
122+
files: { src: 'src/ngLocale/**/*.js' },
123+
options: { jshintrc: 'src/ngLocale/.jshintrc' }
124+
},
125+
ngMock: {
126+
files: { src: 'src/ngMock/**/*.js' },
127+
options: { jshintrc: 'src/ngMock/.jshintrc' }
128+
},
129+
ngResource: {
130+
files: { src: 'src/ngResource/**/*.js' },
131+
options: { jshintrc: 'src/ngResource/.jshintrc' }
132+
},
133+
ngRoute: {
134+
files: { src: 'src/ngRoute/**/*.js' },
135+
options: { jshintrc: 'src/ngRoute/.jshintrc' }
136+
},
137+
ngSanitize: {
138+
files: { src: 'src/ngSanitize/**/*.js' },
139+
options: { jshintrc: 'src/ngSanitize/.jshintrc' }
140+
},
141+
ngScenario: {
142+
files: { src: 'src/ngScenario/**/*.js' },
143+
options: { jshintrc: 'src/ngScenario/.jshintrc' }
144+
},
145+
ngTouch: {
146+
files: { src: 'src/ngTouch/**/*.js' },
147+
options: { jshintrc: 'src/ngTouch/.jshintrc' }
148+
}
149+
},
107150

108151
build: {
109152
scenario: {
@@ -127,49 +170,36 @@ module.exports = function(grunt) {
127170
},
128171
loader: {
129172
dest: 'build/angular-loader.js',
130-
src: util.wrap(['src/loader.js'], 'loader')
173+
src: util.wrap(files['angularLoader'], 'loader')
131174
},
132175
touch: {
133176
dest: 'build/angular-touch.js',
134-
src: util.wrap([
135-
'src/ngTouch/touch.js',
136-
'src/ngTouch/swipe.js',
137-
'src/ngTouch/directive/ngClick.js',
138-
'src/ngTouch/directive/ngSwipe.js'
139-
], 'module')
177+
src: util.wrap(files['angularModules']['ngTouch'], 'module')
140178
},
141179
mocks: {
142180
dest: 'build/angular-mocks.js',
143-
src: ['src/ngMock/angular-mocks.js'],
181+
src: files['angularModules']['ngMock'],
144182
strict: false
145183
},
146184
sanitize: {
147185
dest: 'build/angular-sanitize.js',
148-
src: util.wrap([
149-
'src/ngSanitize/sanitize.js',
150-
'src/ngSanitize/filter/linky.js'
151-
], 'module')
186+
src: util.wrap(files['angularModules']['ngSanitize'], 'module')
152187
},
153188
resource: {
154189
dest: 'build/angular-resource.js',
155-
src: util.wrap(['src/ngResource/resource.js'], 'module')
190+
src: util.wrap(files['angularModules']['ngResource'], 'module')
156191
},
157192
animate: {
158193
dest: 'build/angular-animate.js',
159-
src: util.wrap(['src/ngAnimate/animate.js'], 'module')
194+
src: util.wrap(files['angularModules']['ngAnimate'], 'module')
160195
},
161196
route: {
162197
dest: 'build/angular-route.js',
163-
src: util.wrap([
164-
'src/ngRoute/routeUtils.js',
165-
'src/ngRoute/route.js',
166-
'src/ngRoute/routeParams.js',
167-
'src/ngRoute/directive/ngView.js'
168-
], 'module')
198+
src: util.wrap(files['angularModules']['ngRoute'], 'module')
169199
},
170200
cookies: {
171201
dest: 'build/angular-cookies.js',
172-
src: util.wrap(['src/ngCookies/cookies.js'], 'module')
202+
src: util.wrap(files['angularModules']['ngCookies'], 'module')
173203
},
174204
"promises-aplus-adapter": {
175205
dest:'tmp/promises-aplus-adapter++.js',

angularFiles.js

+42-16
Original file line numberDiff line numberDiff line change
@@ -65,24 +65,40 @@ angularFiles = {
6565
'src/ng/directive/style.js'
6666
],
6767

68-
'angularSrcModules': [
69-
'src/ngAnimate/animate.js',
70-
'src/ngCookies/cookies.js',
71-
'src/ngResource/resource.js',
72-
'src/ngRoute/routeUtils.js',
73-
'src/ngRoute/route.js',
74-
'src/ngRoute/routeParams.js',
75-
'src/ngRoute/directive/ngView.js',
76-
'src/ngSanitize/sanitize.js',
77-
'src/ngSanitize/filter/linky.js',
78-
'src/ngMock/angular-mocks.js',
79-
'src/ngTouch/touch.js',
80-
'src/ngTouch/swipe.js',
81-
'src/ngTouch/directive/ngClick.js',
82-
'src/ngTouch/directive/ngSwipe.js',
83-
'docs/components/angular-bootstrap/bootstrap.js',
68+
'angularLoader': [
69+
'src/loader.js'
8470
],
8571

72+
'angularModules': {
73+
'ngAnimate': [
74+
'src/ngAnimate/animate.js'
75+
],
76+
'ngCookies': [
77+
'src/ngCookies/cookies.js'
78+
],
79+
'ngResource': [
80+
'src/ngResource/resource.js'
81+
],
82+
'ngRoute': [
83+
'src/ngRoute/route.js',
84+
'src/ngRoute/routeParams.js',
85+
'src/ngRoute/directive/ngView.js'
86+
],
87+
'ngSanitize': [
88+
'src/ngSanitize/sanitize.js',
89+
'src/ngSanitize/filter/linky.js'
90+
],
91+
'ngMock': [
92+
'src/ngMock/angular-mocks.js'
93+
],
94+
'ngTouch': [
95+
'src/ngTouch/touch.js',
96+
'src/ngTouch/swipe.js',
97+
'src/ngTouch/directive/ngClick.js',
98+
'src/ngTouch/directive/ngSwipe.js'
99+
],
100+
},
101+
86102
'angularScenario': [
87103
'src/ngScenario/Scenario.js',
88104
'src/ngScenario/browserTrigger.js',
@@ -172,6 +188,16 @@ angularFiles = {
172188
]
173189
};
174190

191+
angularFiles['angularSrcModules'] = [].concat(
192+
angularFiles['angularModules']['ngAnimate'],
193+
angularFiles['angularModules']['ngCookies'],
194+
angularFiles['angularModules']['ngResource'],
195+
angularFiles['angularModules']['ngRoute'],
196+
angularFiles['angularModules']['ngSanitize'],
197+
angularFiles['angularModules']['ngMock'],
198+
angularFiles['angularModules']['ngTouch']
199+
);
200+
175201
if (exports) {
176202
exports.files = angularFiles;
177203
exports.mergeFilesFor = function() {

package.json

+4-1
Original file line numberDiff line numberDiff line change
@@ -44,5 +44,8 @@
4444
"type": "MIT",
4545
"url": "https://github.com/angular/angular.js/blob/master/LICENSE"
4646
}
47-
]
47+
],
48+
"dependencies": {
49+
"grunt-contrib-jshint": "~0.6.4"
50+
}
4851
}

src/.jshintrc

+164
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,164 @@
1+
{
2+
"bitwise": true,
3+
"immed": true,
4+
"newcap": true,
5+
"noarg": true,
6+
"noempty": true,
7+
"nonew": true,
8+
"trailing": true,
9+
"maxlen": 200,
10+
"boss": true,
11+
"eqnull": true,
12+
"expr": true,
13+
"globalstrict": true,
14+
"laxbreak": true,
15+
"loopfunc": true,
16+
"sub": true,
17+
"undef": true,
18+
"browser": true,
19+
"globals": {
20+
/* auto/injector.js */
21+
"createInjector": false,
22+
23+
/* angular.js */
24+
"angular": false,
25+
"msie": false,
26+
"jqLite": false,
27+
"jQuery": false,
28+
"slice": false,
29+
"push": false,
30+
"toString": false,
31+
"ngMinErr": false,
32+
"_angular": false,
33+
"angularModule": false,
34+
"nodeName_": false,
35+
"uid": false,
36+
37+
"lowercase": false,
38+
"uppercase": false,
39+
"manualLowercase": false,
40+
"manualUppercase": false,
41+
"nodeName_": false,
42+
"isArrayLike": false,
43+
"forEach": false,
44+
"sortedKeys": false,
45+
"forEachSorted": false,
46+
"reverseParams": false,
47+
"nextUid": false,
48+
"setHashKey": false,
49+
"extend": false,
50+
"int": false,
51+
"inherit": false,
52+
"noop": false,
53+
"identity": false,
54+
"valueFn": false,
55+
"isUndefined": false,
56+
"isDefined": false,
57+
"isObject": false,
58+
"isString": false,
59+
"isNumber": false,
60+
"isDate": false,
61+
"isArray": false,
62+
"isFunction": false,
63+
"isRegExp": false,
64+
"isWindow": false,
65+
"isScope": false,
66+
"isFile": false,
67+
"isBoolean": false,
68+
"trim": false,
69+
"isElement": false,
70+
"makeMap": false,
71+
"map": false,
72+
"size": false,
73+
"includes": false,
74+
"indexOf": false,
75+
"arrayRemove": false,
76+
"isLeafNode": false,
77+
"copy": false,
78+
"shallowCopy": false,
79+
"equals": false,
80+
"csp": false,
81+
"concat": false,
82+
"sliceArgs": false,
83+
"bind": false,
84+
"toJsonReplacer": false,
85+
"toJson": false,
86+
"fromJson": false,
87+
"toBoolean": false,
88+
"startingTag": false,
89+
"tryDecodeURIComponent": false,
90+
"parseKeyValue": false,
91+
"toKeyValue": false,
92+
"encodeUriSegment": false,
93+
"encodeUriQuery": false,
94+
"angularInit": false,
95+
"bootstrap": false,
96+
"snake_case": false,
97+
"bindJQuery": false,
98+
"assertArg": false,
99+
"assertArgFn": false,
100+
"assertNotHasOwnProperty": false,
101+
"getter": false,
102+
103+
/* AngularPublic.js */
104+
"version": false,
105+
"publishExternalAPI": false,
106+
107+
/* minerr.js */
108+
"minErr": false,
109+
110+
/* loader.js */
111+
"setupModuleLoader": false,
112+
113+
/* jqLite.js */
114+
"BOOLEAN_ATTR": false,
115+
"jqNextId": false,
116+
"camelCase": false,
117+
"jqLitePatchJQueryRemove": false,
118+
"JQLite": false,
119+
"jqLiteClone": false,
120+
"jqLiteDealoc": false,
121+
"jqLiteOff": false,
122+
"jqLiteRemoveData": false,
123+
"jqLiteExpandoStore": false,
124+
"jqLiteData": false,
125+
"jqLiteHasClass": false,
126+
"jqLiteRemoveClass": false,
127+
"jqLiteAddClass": false,
128+
"jqLiteAddNodes": false,
129+
"jqLiteController": false,
130+
"jqLiteInheritedData": false,
131+
"getBooleanAttrName": false,
132+
"createEventHandler": false,
133+
"JQLitePrototype": false,
134+
"addEventListenerFn": false,
135+
"removeEventListenerFn": false,
136+
137+
/* apis.js */
138+
"hashKey": false,
139+
"HashMap": false,
140+
141+
/* urlUtils.js */
142+
"urlResolve": false,
143+
"urlIsSameOrigin": false,
144+
145+
/* ng/compile.js */
146+
"directiveNormalize": false,
147+
148+
/* ng/parse.js */
149+
"setter": false,
150+
151+
/* ng/directive/directives.js */
152+
"ngDirective": false,
153+
154+
/* ng/directive/input.js */
155+
"VALID_CLASS": false,
156+
"INVALID_CLASS": false,
157+
"PRISTINE_CLASS": false,
158+
"DIRTY_CLASS": false,
159+
160+
/* ng/directive/form.js */
161+
"nullFormCtrl": false
162+
163+
}
164+
}

src/ngAnimate/.jshintrc

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"bitwise": true,
3+
"immed": true,
4+
"newcap": true,
5+
"noarg": true,
6+
"noempty": true,
7+
"nonew": true,
8+
"trailing": true,
9+
"maxlen": false, /* ngAnimate docs contain wide tables */
10+
"boss": true,
11+
"eqnull": true,
12+
"expr": true,
13+
"globalstrict": true,
14+
"laxbreak": true,
15+
"loopfunc": true,
16+
"sub": true,
17+
"undef": true,
18+
"browser": true,
19+
"globals": {
20+
"angular": false
21+
}
22+
}

0 commit comments

Comments
 (0)