Skip to content

Commit 93f8321

Browse files
devversionjelbourn
authored andcommitted
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/`.
1 parent 5f1f072 commit 93f8321

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

tools/gulp/tasks/lint.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,11 @@ import {IMinimatch, Minimatch} from 'minimatch';
55
import {join} from 'path';
66
import {execNodeTask} from '../util/task_helpers';
77

8-
/** Glob that matches all SCSS or CSS files that should be linted. */
9-
const stylesGlob = '+(tools|src)/**/!(*.bundle).+(css|scss)';
8+
/** Globs that matchall SCSS or CSS files that should be linted. */
9+
const styleGlobs = [
10+
'src/**/*.+(css|scss)',
11+
'tools/dashboard/src/*.+(css|scss)',
12+
];
1013

1114
/** List of flags that will passed to the different TSLint tasks. */
1215
const tsLintBaseFlags = ['-c', 'tslint.json', '--project', './tsconfig.json'];
@@ -21,7 +24,7 @@ task('lint', ['tslint', 'stylelint', 'ownerslint']);
2124

2225
/** Task to lint Angular Material's scss stylesheets. */
2326
task('stylelint', execNodeTask(
24-
'stylelint', [stylesGlob, '--config', 'stylelint-config.json', '--syntax', 'scss']
27+
'stylelint', [...styleGlobs, '--config', 'stylelint-config.json', '--syntax', 'scss']
2528
));
2629

2730
/** Task to run TSLint against the e2e/ and src/ directories. */

0 commit comments

Comments
 (0)