From 93f832118ef7c5cd259092558e8cb9ac5d6244f7 Mon Sep 17 00:00:00 2001 From: Paul Gschwendtner Date: Tue, 25 Sep 2018 01:47:34 +0200 Subject: [PATCH] build: stylelint should not check node_modules (#13258) Currently, if someone runs `gulp stylelint` and has the dashboard node modules installed, stylelint will lint the `tools/dashboard/node_modules/`. This causes stylelint to report thousands of failures due to some minified CSS files in the `node_modules/`. --- tools/gulp/tasks/lint.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tools/gulp/tasks/lint.ts b/tools/gulp/tasks/lint.ts index 1bd29f469d8..a7e868526f6 100644 --- a/tools/gulp/tasks/lint.ts +++ b/tools/gulp/tasks/lint.ts @@ -5,8 +5,11 @@ import {IMinimatch, Minimatch} from 'minimatch'; import {join} from 'path'; import {execNodeTask} from '../util/task_helpers'; -/** Glob that matches all SCSS or CSS files that should be linted. */ -const stylesGlob = '+(tools|src)/**/!(*.bundle).+(css|scss)'; +/** Globs that matchall SCSS or CSS files that should be linted. */ +const styleGlobs = [ + 'src/**/*.+(css|scss)', + 'tools/dashboard/src/*.+(css|scss)', +]; /** List of flags that will passed to the different TSLint tasks. */ const tsLintBaseFlags = ['-c', 'tslint.json', '--project', './tsconfig.json']; @@ -21,7 +24,7 @@ task('lint', ['tslint', 'stylelint', 'ownerslint']); /** Task to lint Angular Material's scss stylesheets. */ task('stylelint', execNodeTask( - 'stylelint', [stylesGlob, '--config', 'stylelint-config.json', '--syntax', 'scss'] + 'stylelint', [...styleGlobs, '--config', 'stylelint-config.json', '--syntax', 'scss'] )); /** Task to run TSLint against the e2e/ and src/ directories. */