Skip to content

Commit

Permalink
feat(build): added gulp stylelint task
Browse files Browse the repository at this point in the history
  • Loading branch information
pimenovoleg committed Oct 5, 2018
1 parent adc05ae commit a5dc5eb
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@
"changelog": "gulp changelog",
"publish": "ts-node --project ./scripts/tsconfig.deploy.json ./scripts/deploy/publish-artifacts.ts",
"linter:lib": "gulp tslint",
"linter:styles": "stylelint --syntax scss \"./**/*.scss\"",
"linter:styles": "gulp stylelint",
"server-dev": "webpack-dev-server --config tools/webpack/webpack.config.js",
"server-dev:badge": "npm run server-dev -- --env.component badge",
"server-dev:button": "npm run server-dev -- --env.component button",
Expand Down
9 changes: 9 additions & 0 deletions tools/gulp/tasks/lint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ import { execNodeTask } from '../utils/helpers';
/* tslint:disable:no-var-requires */
const madge = require('madge');

/** Globs that matchall SCSS or CSS files that should be linted. */
const styleGlobs = [
'src/**/*.+(css|scss)'
];

const tsLintBaseFlags = ['-c', 'tslint.json', '--project', './tsconfig.json'];

/** Path to the output of the Mosaic package. */
Expand All @@ -23,6 +28,10 @@ task('lint', ['tslint', 'madge']);

task('tslint', execNodeTask('tslint', tsLintBaseFlags));

task('stylelint', execNodeTask(
'stylelint', [...styleGlobs, '--config', '.stylelintrc', '--syntax', 'scss']
));

task('tslint:fix', execNodeTask('tslint', [...tsLintBaseFlags, '--fix']));

task('madge', ['mosaic:clean-build'], () => {
Expand Down

0 comments on commit a5dc5eb

Please sign in to comment.