build: modularize the gulp file to be easier to maintain (#14259)
This is a precursor to bringing in some of the gulp tasks from angular.io, which could lead to the gulpfile becoming unwieldy.
This commit is contained in:

committed by
Igor Minar

parent
a9096437fd
commit
0ba5bebf61
29
tools/gulp-tasks/lint.js
Normal file
29
tools/gulp-tasks/lint.js
Normal file
@ -0,0 +1,29 @@
|
||||
// Check the coding standards and programming errors
|
||||
module.exports = (gulp) => () => {
|
||||
const tslint = require('gulp-tslint');
|
||||
// Built-in rules are at
|
||||
// https://palantir.github.io/tslint/rules/
|
||||
const tslintConfig = require('../../tslint.json');
|
||||
return gulp
|
||||
.src([
|
||||
// todo(vicb): add .js files when supported
|
||||
// see https://github.com/palantir/tslint/pull/1515
|
||||
'./modules/**/*.ts',
|
||||
'./tools/**/*.ts',
|
||||
'./*.ts',
|
||||
|
||||
// Ignore TypeScript mocks because it's not managed by us
|
||||
'!./tools/@angular/tsc-wrapped/test/typescript.mocks.ts',
|
||||
|
||||
// Ignore generated files due to lack of copyright header
|
||||
// todo(alfaproject): make generated files lintable
|
||||
'!**/*.d.ts',
|
||||
'!**/*.ngfactory.ts',
|
||||
])
|
||||
.pipe(tslint({
|
||||
tslint: require('tslint').default,
|
||||
configuration: tslintConfig,
|
||||
formatter: 'prose',
|
||||
}))
|
||||
.pipe(tslint.report({emitError: true}));
|
||||
};
|
Reference in New Issue
Block a user