Skip to content

Commit

Permalink
build: combine multiple stylelint tasks (#4335)
Browse files Browse the repository at this point in the history
* Combines the multiple stylelint tasks into a single one. Stylelint supports globs using `globby`.
  • Loading branch information
devversion authored and andrewseguin committed May 2, 2017
1 parent 5d03c1a commit c5680c0
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions tools/gulp/tasks/lint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,24 @@ import gulp = require('gulp');
import {execNodeTask} from '../util/task_helpers';
import {DIST_MATERIAL} from '../constants';

gulp.task('lint', ['tslint', 'stylelint', 'madge', 'dashboardlint']);
/** Glob that matches all SCSS or CSS files that should be linted. */
const stylesGlob = '+(tools|src)/**/*.+(css|scss)';

/** List of flags that will passed to the different TSLint tasks. */
const tsLintBaseFlags = [
'-c', 'tslint.json', '+(src|e2e|tools)/**/*.ts', '--exclude', '**/node_modules/**/*'
];

gulp.task('lint', ['tslint', 'stylelint', 'madge']);

/** Task that runs madge to detect circular dependencies. */
gulp.task('madge', ['material:clean-build'], execNodeTask('madge', ['--circular', DIST_MATERIAL]));

/** Task to lint Angular Material's scss stylesheets. */
gulp.task('stylelint', execNodeTask(
'stylelint', ['src/**/*.scss', '--config', 'stylelint-config.json', '--syntax', 'scss']
'stylelint', [stylesGlob, '--config', 'stylelint-config.json', '--syntax', 'scss']
));

gulp.task('dashboardlint', execNodeTask(
'stylelint', ['tools/screenshot-test/**/*.css', '--config', 'stylelint-config.json',
'--syntax', 'scss']
));

const tsLintBaseFlags = ['-c', 'tslint.json', '+(src|e2e|tools)/**/*.ts', '--exclude',
'**/node_modules/**/*'];

/** Task to run TSLint against the e2e/ and src/ directories. */
gulp.task('tslint', execNodeTask('tslint', tsLintBaseFlags));

Expand Down

0 comments on commit c5680c0

Please sign in to comment.