Skip to content

Commit

Permalink
- Went through all components and fixed linting errors
Browse files Browse the repository at this point in the history
- Added more linting options
- Added and fixed the less linting task.
  • Loading branch information
John Miller committed Jan 13, 2016
1 parent 79e0aa6 commit 0356b01
Show file tree
Hide file tree
Showing 28 changed files with 238 additions and 252 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,4 @@ ehthumbs.db
*.msi
*.msm
*.msp
.vscode/
16 changes: 9 additions & 7 deletions .lesshintrc
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@
"importantRule": {
"enabled": true
},
"importantRule": {
"enabled": true
},
"spaceAfterPropertyColon": {
"enabled": true,
"style": "one_space"
Expand All @@ -36,19 +33,24 @@
"style": "one_space"
},
"spaceBetweenParens": {
"enabled": true,
"style": "no_space"
"enabled": false
},
"trailingSemicolon": {
"enabled": true
},
"zeroUnit": {
"no_unit": true
"enabled": false
},
"qualifyingElement": {
"allowWithClass": true
},
"propertyOrdering": {
"style": false
"enabled": false
},
"stringQuotes": {
"enabled": false
},
"urlQuotes": {
"enabled": true
}
}
4 changes: 3 additions & 1 deletion gulp/ComponentSamples.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@ gulp.task('ComponentSamples-moveJS', function() {

gulp.task('ComponentSamples-styleHinting', function() {
return gulp.src(Config.paths.componentsPath + '/**/*.less')
.pipe(Plugins.gulpif(Config.debugMode, Plugins.debug({
title: "Checking LESS Compile errors and linting"
})))
.pipe(Plugins.lesshint({
configPath: './.lesshintrc'
}))
Expand All @@ -81,7 +84,6 @@ gulp.task('ComponentSamples-styleHinting', function() {

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

var srcTemplate = Config.paths.templatePath + '/'+ 'component-manifest-template.less';
var destFolder = Config.paths.distSampleComponents + '/' + componentName;
var srcFolderName = Config.paths.componentsPath + '/' + componentName;
Expand Down
10 changes: 5 additions & 5 deletions gulp/FabricBuild.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,10 @@ gulp.task('Fabric-buildStyles', 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 @@ -136,4 +136,4 @@ gulp.task('Fabric-watch', ['Fabric', 'Fabric-finished'], function () {
return gulp.watch(Config.paths.lessPath + '/**/*', Plugins.batch(function (events, done) {
Plugins.runSequence('Fabric', 'Fabric-updated', done);
}));
});
});
2 changes: 1 addition & 1 deletion gulp/modules/ComponentHelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ var Plugins = require('./Plugins');
*/
var ComponentSamplesHelper = function() {
/**
* Builds a commmonly used Gulp task for building a components styles..
* A commmonly used Gulp task for building a component's styles.
* @param {String} destFolder Contains the path to the destination folder.
* @param {String} srcTemplate Contains the path to the source template to be applied.
* @param {String} componentName Name of the component.
Expand Down
7 changes: 3 additions & 4 deletions gulp/modules/ErrorHandling.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,6 @@ var ErrorHandling = function() {
if(error) {
switch(error.plugin) {
case 'gulp-autoprefixer':
console.log("Auto prefixer");
break;
case 'gulp-less':
break;
Expand Down Expand Up @@ -198,17 +197,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 == "warning") {
gulputil.log(errorString);
that.addWarning(errorString);
} else {
that.generatePluginError('lessHint', errorString);
that.generatePluginError('lessHint', errorString);
}
}
});
Expand Down
4 changes: 2 additions & 2 deletions src/components/Breadcrumb/Breadcrumb.less
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
.ms-Breadcrumb-overflowButton {
font-size: @ms-font-size-s;
display: inline-block;
color:@ms-color-themePrimary;
color: @ms-color-themePrimary;
margin-right: -4px;
padding: 12px 8px 3px 8px;
cursor: pointer;
Expand Down Expand Up @@ -86,7 +86,7 @@
}

.ms-ContextualMenu {
border: none;
border: 0;
box-shadow: none;
position: relative;
width: 190px;
Expand Down
46 changes: 23 additions & 23 deletions src/components/Button/Button.less
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
}
}

&:disabled,
&:disabled,
&.is-disabled {
background-color: @ms-color-neutralLighter;
border-color: @ms-color-neutralLighter;
Expand All @@ -56,7 +56,7 @@
color: @ms-color-neutralTertiary;
}

&:hover,
&:hover,
&:focus {
outline: 0;
}
Expand All @@ -74,7 +74,7 @@
font-size: @ms-font-size-m;
}

.ms-Button-icon,
.ms-Button-icon,
.ms-Button-description {
display: none;
}
Expand Down Expand Up @@ -105,7 +105,7 @@
border-color: @ms-color-themePrimary;
}

&:disabled,
&:disabled,
&.is-disabled {
background-color: @ms-color-neutralLighter;
border-color: @ms-color-neutralLighter;
Expand All @@ -121,7 +121,7 @@
//
.ms-Button.ms-Button--hero {
background-color: transparent;
border: none;
border: 0;
vertical-align: top;
line-height: normal;

Expand Down Expand Up @@ -152,7 +152,7 @@
text-decoration: none;
}

&:hover,
&:hover,
&:focus {
.ms-Button-icon {
.ms-Icon {
Expand All @@ -177,7 +177,7 @@
}
}

&:disabled,
&:disabled,
&.is-disabled {
.ms-Button-icon {
.ms-Icon {
Expand Down Expand Up @@ -219,36 +219,36 @@
}

&:hover {
.ms-Button-description {
color: @ms-color-neutralDark;
.ms-Button-description {
color: @ms-color-neutralDark;
}
}

&:focus {
border-color: @ms-color-themePrimary;
background-color: @ms-color-neutralLighter;

.ms-Button-label {
color: @ms-color-neutralPrimary;
.ms-Button-label {
color: @ms-color-neutralPrimary;
}

.ms-Button-description {
color: @ms-color-neutralSecondary;
.ms-Button-description {
color: @ms-color-neutralSecondary;
}
}

&:active {
background-color: @ms-color-themePrimary;

.ms-Button-description,
.ms-Button-label {
color: @ms-color-white;
.ms-Button-description,
.ms-Button-label {
color: @ms-color-white;
}
}

&:disabled,
&:disabled,
&.is-disabled {
.ms-Button-label,
.ms-Button-label,
.ms-Button-description {
color: @ms-color-neutralTertiary;
}
Expand All @@ -260,7 +260,7 @@

.ms-Button-label,
.ms-Button-description {
color: @ms-color-neutralTertiary;
color: @ms-color-neutralTertiary;
}
}
}
Expand All @@ -271,14 +271,14 @@
//
.ms-Button.ms-Button--command {
background-color: transparent;
border: none;
border: 0;
height: 32px;
line-height: 32px;
min-width: 0;
padding: 0 8px;
text-align: left;
font-size: @ms-font-size-m;

.ms-Button-icon {
color: @ms-color-neutralSecondary;
display: inline-block;
Expand All @@ -290,7 +290,7 @@
font-family: @ms-font-family-regular;
}

&:hover,
&:hover,
&:focus {
.ms-Button-icon {
color: @ms-color-neutralDark;
Expand All @@ -308,7 +308,7 @@
}
}

&:disabled,
&:disabled,
&.is-disabled {
.ms-Button-icon {
color: @ms-color-neutralTertiaryAlt;
Expand Down
6 changes: 3 additions & 3 deletions src/components/Callout/Callout.less
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@


//= Modifier: Callout with left and right arrows
//
//
.ms-Callout.ms-Callout--arrowLeft,
.ms-Callout.ms-Callout--arrowRight {
&:before,
Expand Down Expand Up @@ -78,7 +78,7 @@


//= Modifier: Callout with top and bottom arrows
//
//
.ms-Callout.ms-Callout--arrowTop,
.ms-Callout.ms-Callout--arrowBottom {
&:before,
Expand Down Expand Up @@ -175,7 +175,7 @@
position: relative;
top: 4px;
left: -8px;
margin-left: 0 !important;
margin-left: 0;

&:hover .ms-Callout-actionIcon,
&:focus .ms-Callout-actionIcon {
Expand Down
7 changes: 3 additions & 4 deletions src/components/ChoiceField/ChoiceField.less
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
}

// The original unstyled input element
.ms-ChoiceField-input {
.ms-ChoiceField-input {
position: absolute;
opacity: 0;
top: 8px;
Expand All @@ -68,12 +68,11 @@
width: 19px;
height: 19px;
cursor: pointer;
position: relative;
font-weight: normal;
left: -1px;
top: -1px;
border-radius: 50%;
position: absolute;
position: absolute;
}

&:hover {
Expand Down Expand Up @@ -122,7 +121,7 @@
}
}

// A selected checkbox
// A selected checkbox
.ms-ChoiceField-input[type="checkbox"]:checked {
+ .ms-ChoiceField-field {
&:before {
Expand Down
Loading

0 comments on commit 0356b01

Please sign in to comment.