| 
									
										
										
										
											2017-09-22 19:51:03 +02:00
										 |  |  | /** | 
					
						
							|  |  |  |  * @license | 
					
						
							|  |  |  |  * Copyright Google Inc. All Rights Reserved. | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * Use of this source code is governed by an MIT-style license that can be | 
					
						
							|  |  |  |  * found in the LICENSE file at https://angular.io/license
 | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-02-03 08:10:41 +00:00
										 |  |  | // Check the coding standards and programming errors
 | 
					
						
							|  |  |  | module.exports = (gulp) => () => { | 
					
						
							|  |  |  |   const tslint = require('gulp-tslint'); | 
					
						
							| 
									
										
										
										
											2017-09-22 19:51:03 +02:00
										 |  |  |   // Built-in rules are at https://palantir.github.io/tslint/rules/
 | 
					
						
							|  |  |  |   const path = require('path'); | 
					
						
							| 
									
										
										
										
											2017-02-03 08:10:41 +00:00
										 |  |  |   return gulp | 
					
						
							|  |  |  |       .src([ | 
					
						
							|  |  |  |         // todo(vicb): add .js files when supported
 | 
					
						
							|  |  |  |         // see https://github.com/palantir/tslint/pull/1515
 | 
					
						
							|  |  |  |         './modules/**/*.ts', | 
					
						
							| 
									
										
										
										
											2017-09-22 19:51:03 +02:00
										 |  |  |         './modules/**/*.js', | 
					
						
							| 
									
										
										
										
											2017-07-27 16:13:16 -07:00
										 |  |  |         './packages/**/*.ts', | 
					
						
							| 
									
										
										
										
											2017-09-22 19:51:03 +02:00
										 |  |  |         './packages/**/*.js', | 
					
						
							| 
									
										
										
										
											2017-02-03 08:10:41 +00:00
										 |  |  |         './tools/**/*.ts', | 
					
						
							| 
									
										
										
										
											2017-09-22 19:51:03 +02:00
										 |  |  |         './tools/**/*.js', | 
					
						
							| 
									
										
										
										
											2017-02-03 08:10:41 +00:00
										 |  |  |         './*.ts', | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-07-31 17:43:12 -07:00
										 |  |  |         // Ignore node_modules directories
 | 
					
						
							|  |  |  |         '!**/node_modules/**', | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-09-22 19:51:03 +02:00
										 |  |  |         // Ignore built files directories
 | 
					
						
							|  |  |  |         '!**/built/**', | 
					
						
							|  |  |  |         '!**/dist/**', | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         // Ignore special files
 | 
					
						
							|  |  |  |         '!**/*.externs.js', | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-02-03 08:10:41 +00:00
										 |  |  |         // Ignore generated files due to lack of copyright header
 | 
					
						
							|  |  |  |         // todo(alfaproject): make generated files lintable
 | 
					
						
							|  |  |  |         '!**/*.d.ts', | 
					
						
							|  |  |  |         '!**/*.ngfactory.ts', | 
					
						
							|  |  |  |       ]) | 
					
						
							|  |  |  |       .pipe(tslint({ | 
					
						
							| 
									
										
										
										
											2017-09-22 19:51:03 +02:00
										 |  |  |         configuration: path.resolve(__dirname, '../../tslint.json'), | 
					
						
							| 
									
										
										
										
											2017-02-03 08:10:41 +00:00
										 |  |  |         formatter: 'prose', | 
					
						
							|  |  |  |       })) | 
					
						
							|  |  |  |       .pipe(tslint.report({emitError: true})); | 
					
						
							|  |  |  | }; |