Skip to content

Commit

Permalink
- Fixing up Less Linting error's or issues.
Browse files Browse the repository at this point in the history
  • Loading branch information
John Miller committed Jan 13, 2016
1 parent c885b74 commit 79e0aa6
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 24 deletions.
10 changes: 9 additions & 1 deletion .lesshintrc
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,14 @@
},
"trailingSemicolon": {
"enabled": true

},
"zeroUnit": {
"no_unit": true
},
"qualifyingElement": {
"allowWithClass": true
},
"propertyOrdering": {
"style": false
}
}
13 changes: 11 additions & 2 deletions gulp/ComponentSamples.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,15 @@ gulp.task('ComponentSamples-moveJS', function() {
// LESS tasks
// ----------------------------------------------------------------------------

gulp.task('ComponentSamples-less', function() {
gulp.task('ComponentSamples-styleHinting', function() {
return gulp.src(Config.paths.componentsPath + '/**/*.less')
.pipe(Plugins.lesshint({
configPath: './.lesshintrc'
}))
.pipe(ErrorHandling.LESSHintErrors());
});

gulp.task('ComponentSamples-less', ['ComponentSamples-styleHinting'], function() {
return folderList.map(function(componentName) {

var srcTemplate = Config.paths.templatePath + '/'+ 'component-manifest-template.less';
Expand Down Expand Up @@ -155,7 +163,8 @@ gulp.task('ComponentSamples-build', function() {
var ComponentSamplesTasks = [
'ComponentSamples-build',
'ComponentSamples-copyAssets',
'ComponentSamples-less',
'ComponentSamples-less',
'ComponentSamples-styleHinting',
'ComponentSamples-moveJS',
'ComponentSamples-copyIgnoredFiles'
];
Expand Down
14 changes: 7 additions & 7 deletions gulp/FabricBuild.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,9 @@ gulp.task('Fabric-copyAssets', function () {
// ----------------------------------------------------------------------------

// Build LESS files for core Fabric into LTR and RTL CSS files.
gulp.task('Fabric-buildLess', function () {
gulp.task('Fabric-buildStyles', function () {

return gulp.src(srcPath + '/' + 'Fabric.' + fileExtension)
var fabric = gulp.src(srcPath + '/' + 'Fabric.' + fileExtension)
.pipe(Plugins.plumber(ErrorHandling.onErrorInPipe))
.pipe(Plugins.gulpif(Config.debugMode, Plugins.debug({
title: "Building Core Fabric " + fileExtension + " File"
Expand All @@ -73,10 +73,10 @@ gulp.task('Fabric-buildLess', function () {
.pipe(Plugins.rename('fabric.css'))
.pipe(Plugins.header(Banners.getBannerTemplate(), Banners.getBannerData()))
.pipe(Plugins.changed(Config.paths.distCSS, {extension: '.css'}))
.pipe(Plugins.autoprefixer({
browsers: ['last 2 versions', 'ie >= 9'],
cascade: false
}))
// .pipe(Plugins.autoprefixer({
// browsers: ['last 2 versions', 'ie >= 9'],
// cascade: false
// }))
.pipe(Plugins.cssbeautify())
.pipe(Plugins.csscomb())
.pipe(gulp.dest(Config.paths.distCSS))
Expand Down Expand Up @@ -113,7 +113,7 @@ gulp.task('Fabric-buildLess', function () {
// Rolled up Build tasks
// ----------------------------------------------------------------------------

gulp.task('Fabric', ['Fabric-copyAssets', 'Fabric-buildLess']);
gulp.task('Fabric', ['Fabric-copyAssets', 'Fabric-buildStyles']);

//
// Fabric Messages
Expand Down
29 changes: 16 additions & 13 deletions gulp/modules/ErrorHandling.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,15 +134,19 @@ var ErrorHandling = function() {
*/
this.onErrorInPipe = function(error) {
if(error) {
if(error.plugin == 'gulp-less') {
// We have a custom error handler specifically for less but this still will get triggered
return;
} else {
that.generateBuildError(error[0]);
that.addError(error[0]);
console.log(error);
return;
switch(error.plugin) {
case 'gulp-autoprefixer':
console.log("Auto prefixer");
break;
case 'gulp-less':
break;
default:
that.generateBuildError(error[0]);
that.addError(error[0]);
console.log(error.plugin);
break;
}
return;
}

that.generateBuildError(Config.genericBuildError);
Expand Down Expand Up @@ -194,18 +198,17 @@ var ErrorHandling = function() {
if (err) {
var errorString = that.createLineErrorMessage(
gulputil.colors.yellow(err.severity) + ' ' + err.message,
err.file,
' ' + err.file,
err.line,
err.source,
'NA',
''
);

if(err.severity == "Error") {
that.generatePluginError('lessHint', errorString);
} else {
if(err.severity == "warning") {
gulputil.log(errorString);
that.addWarning(errorString);
} else {
that.generatePluginError('lessHint', errorString);
}
}
});
Expand Down
2 changes: 1 addition & 1 deletion src/components/Dialog/Dialog.less
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
}

.ms-Dialog {
background-color: transparent;
background-color:
position: fixed;
height: 100%;
width: 100%;
Expand Down

0 comments on commit 79e0aa6

Please sign in to comment.