Skip to content
This repository has been archived by the owner on Sep 5, 2024. It is now read-only.

Commit

Permalink
style(eslint): enable keyword-spacing rule (#11586)
Browse files Browse the repository at this point in the history
  • Loading branch information
Splaktar authored and andrewseguin committed Jan 11, 2019
1 parent aa172b7 commit ecf1705
Show file tree
Hide file tree
Showing 24 changed files with 35 additions and 35 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
"init-declarations": "off",
"jsx-quotes": "error",
"key-spacing": "off",
"keyword-spacing": "off",
"keyword-spacing": ["error", {"before": true, "after": true}],
"line-comment-position": "off",
"linebreak-style": "off",
"lines-around-comment": "off",
Expand Down
10 changes: 5 additions & 5 deletions docs/app/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,7 @@ function(SERVICES, COMPONENTS, DEMOS, PAGES, $location, $rootScope, $http, $wind
if (section.children) {
// matches nested section toggles, such as API or Customization
section.children.forEach(function(childSection){
if(childSection.pages){
if (childSection.pages){
childSection.pages.forEach(function(page){
matchPage(childSection, page);
});
Expand Down Expand Up @@ -575,7 +575,7 @@ function(SERVICES, COMPONENTS, DEMOS, PAGES, $location, $rootScope, $http, $wind
});

var parentNode = $element[0].parentNode.parentNode.parentNode;
if(parentNode.classList.contains('parent-list-item')) {
if (parentNode.classList.contains('parent-list-item')) {
var heading = parentNode.querySelector('h2');
$element[0].firstChild.setAttribute('aria-describedby', heading.id);
}
Expand Down Expand Up @@ -689,12 +689,12 @@ function($scope, COMPONENTS, BUILDCONFIG, $mdSidenav, $timeout, $mdDialog, menu,
function isSectionSelected(section) {
var selected = false;
var openedSection = menu.openedSection;
if(openedSection === section){
if (openedSection === section){
selected = true;
}
else if(section.children) {
else if (section.children) {
section.children.forEach(function(childSection) {
if(childSection === openedSection){
if (childSection === openedSection){
selected = true;
}
});
Expand Down
2 changes: 1 addition & 1 deletion docs/app/js/codepen.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@
function appendLicenseFor(content, lang) {
var commentStart = '', commentEnd = '';

switch(lang) {
switch (lang) {
case 'html' : commentStart = '<!--'; commentEnd = '-->'; break;
case 'js' : commentStart = '/**'; commentEnd = '**/'; break;
case 'css' : commentStart = '/*'; commentEnd = '*/'; break;
Expand Down
2 changes: 1 addition & 1 deletion docs/app/js/demo.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ angular.module('docsApp')
};

function convertName(name) {
switch(name) {
switch (name) {
case "index.html" : return "HTML";
case "script.js" : return "JS";
case "style.css" : return "CSS";
Expand Down
2 changes: 1 addition & 1 deletion scripts/gulp-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ exports.hoistScssVariables = function() {
let closeCount = 0;
let openBlock = false;

for(let currentLine = 0; currentLine < contents.length; ++currentLine) {
for (let currentLine = 0; currentLine < contents.length; ++currentLine) {
const line = contents[currentLine];

if (openBlock || /^\s*\$/.test(line) && !/^\s+/.test(line)) {
Expand Down
2 changes: 1 addition & 1 deletion src/components/datepicker/js/datepickerDirective.js
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@

if (!mdInputContainer.label) {
$mdAria.expect(element, 'aria-label', attr.mdPlaceholder);
} else if(!mdNoAsterisk) {
} else if (!mdNoAsterisk) {
attr.$observe('required', function(value) {
mdInputContainer.label.toggleClass('md-required', !!value);
});
Expand Down
2 changes: 1 addition & 1 deletion src/components/gridList/demoDynamicTiles/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ angular
it.title = it.title + (j+1);
it.span = { row : 1, col : 1 };

switch(j+1) {
switch (j+1) {
case 1:
it.background = "red";
it.span.row = it.span.col = 2;
Expand Down
2 changes: 1 addition & 1 deletion src/components/gridList/grid-list.js
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ function GridListDirective($interpolate, $mdConstant, $mdGridLayout, $mdMedia) {
function getGridStyle(colCount, rowCount, gutter, rowMode, rowHeight) {
var style = {};

switch(rowMode) {
switch (rowMode) {
case 'fixed':
style.height = DIMENSION({ unit: rowHeight, span: rowCount, gutter: gutter });
style.paddingBottom = '';
Expand Down
2 changes: 1 addition & 1 deletion src/components/icon/icon.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ describe('MdIcon directive', function() {

return {
then: function(fn) {
switch(id) {
switch (id) {
case 'android' : fn('<svg><g id="android"></g></svg>');
break;
case 'cake' : fn('<svg><g id="cake"></g></svg>');
Expand Down
2 changes: 1 addition & 1 deletion src/components/input/input.js
Original file line number Diff line number Diff line change
Expand Up @@ -868,7 +868,7 @@ function mdSelectOnFocusDirective($document, $timeout) {
// The debounce is here for Edge's sake, otherwise the selection doesn't work.
// Since focus may already have been lost on the input (and because `select()`
// will re-focus), make sure the element is still active before applying.
if($document[0].activeElement === element[0]) {
if ($document[0].activeElement === element[0]) {
element[0].select();
}

Expand Down
2 changes: 1 addition & 1 deletion src/components/menu/js/menuServiceProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ function MenuProvider($$interimElementProvider) {

if (!focusTarget) {
var childrenLen = opts.menuContentEl[0].children.length;
for(var childIndex = 0; childIndex < childrenLen; childIndex++) {
for (var childIndex = 0; childIndex < childrenLen; childIndex++) {
var child = opts.menuContentEl[0].children[childIndex];
focusTarget = child.querySelector('.md-button:not([disabled])');
if (focusTarget) {
Expand Down
6 changes: 3 additions & 3 deletions src/components/panel/demoPanelAnimations/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ AnimationCtrl.prototype.showDialog = function() {

animation.duration(this.duration || this.separateDurations);

switch(this.openFrom) {
switch (this.openFrom) {
case 'button':
animation.openFrom('.animation-target');
break;
Expand All @@ -42,7 +42,7 @@ AnimationCtrl.prototype.showDialog = function() {
left: document.documentElement.clientWidth / 2 - 250
});
}
switch(this.closeTo) {
switch (this.closeTo) {
case 'button':
animation.closeTo('.animation-target');
break;
Expand All @@ -56,7 +56,7 @@ AnimationCtrl.prototype.showDialog = function() {
});
}

switch(this.animationType) {
switch (this.animationType) {
case 'custom':
animation.withAnimation({
open: 'demo-dialog-custom-animation-open',
Expand Down
2 changes: 1 addition & 1 deletion src/components/panel/panel.js
Original file line number Diff line number Diff line change
Expand Up @@ -2426,7 +2426,7 @@ MdPanelRef.prototype._callInterceptors = function(type) {
if (!response) {
try {
response = interceptor(self);
} catch(e) {
} catch (e) {
response = $q.reject(e);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ function MdProgressCircularDirective($window, $mdProgressCircular, $mdTheming,

// If the mode is indeterminate, it doesn't need to
// wait for the next digest. It can start right away.
if(scope.mdMode === MODE_INDETERMINATE){
if (scope.mdMode === MODE_INDETERMINATE){
startIndeterminateAnimation();
}

Expand Down
4 changes: 2 additions & 2 deletions src/components/progressLinear/progress-linear.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ function MdProgressLinearDirective($mdTheming, $mdUtil, $log) {
attr.$observe('mdMode', function(mode) {
if (lastMode) container.removeClass(lastMode);

switch(mode) {
switch (mode) {
case MODE_QUERY:
case MODE_BUFFER:
case MODE_DETERMINATE:
Expand Down Expand Up @@ -160,7 +160,7 @@ function MdProgressLinearDirective($mdTheming, $mdUtil, $log) {
function mode() {
var value = (attr.mdMode || "").trim();
if (value) {
switch(value) {
switch (value) {
case MODE_DETERMINATE:
case MODE_INDETERMINATE:
case MODE_BUFFER:
Expand Down
2 changes: 1 addition & 1 deletion src/components/radioButton/radio-button.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ function mdRadioGroupDirective($mdUtil, $mdConstant, $mdTheming, $timeout) {
}, 100);
})
.on('focus', function() {
if(scope.mouseActive === false) {
if (scope.mouseActive === false) {
rgCtrl.$element.addClass('md-focused');
}
})
Expand Down
2 changes: 1 addition & 1 deletion src/components/select/select.js
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ function SelectDirective($mdSelect, $mdUtil, $mdConstant, $mdTheming, $mdAria, $
element.empty().append(valueEl);
element.append(selectTemplate);

if(!attr.tabindex){
if (!attr.tabindex){
attr.$set('tabindex', 0);
}

Expand Down
2 changes: 1 addition & 1 deletion src/components/tabs/js/tabsDummyWrapperDirective.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ function MdTabsDummyWrapper ($mdUtil, $window) {
ctrl.updateInkBarStyles();
};

if('MutationObserver' in $window) {
if ('MutationObserver' in $window) {
var config = {
childList: true,
subtree: true,
Expand Down
2 changes: 1 addition & 1 deletion src/components/virtualRepeat/demoScrollTo/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
// Whenever a different year is selected, scroll to that year
$scope.$watch('ctrl.selectedYear', angular.bind(this, function(yearIndex) {
var scrollYear = Math.floor(this.topIndex / 13);
if(scrollYear !== yearIndex) {
if (scrollYear !== yearIndex) {
this.topIndex = yearIndex * 13;
}
}));
Expand Down
6 changes: 3 additions & 3 deletions src/components/virtualRepeat/virtual-repeater.js
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ VirtualRepeatContainerController.prototype.scrollTo = function(position) {
VirtualRepeatContainerController.prototype.scrollToIndex = function(index) {
var itemSize = this.repeater.getItemSize();
var itemsLength = this.repeater.itemsLength;
if(index > itemsLength) {
if (index > itemsLength) {
index = itemsLength - 1;
}
this.scrollTo(itemSize * index);
Expand All @@ -386,7 +386,7 @@ VirtualRepeatContainerController.prototype.resetScroll = function() {

VirtualRepeatContainerController.prototype.handleScroll_ = function() {
var ltr = document.dir !== 'rtl' && document.body.dir !== 'rtl';
if(!ltr && !this.maxSize) {
if (!ltr && !this.maxSize) {
this.scroller.scrollLeft = this.scrollSize;
this.maxSize = this.scroller.scrollLeft;
}
Expand Down Expand Up @@ -681,7 +681,7 @@ VirtualRepeatController.prototype.containerUpdated = function() {
// If itemSize is unknown, attempt to measure it.
if (!this.itemSize) {
// Make sure to clean up watchers if we can (see #8178)
if(this.unwatchItemSize_ && this.unwatchItemSize_ !== angular.noop){
if (this.unwatchItemSize_ && this.unwatchItemSize_ !== angular.noop){
this.unwatchItemSize_();
}
this.unwatchItemSize_ = this.$scope.$watchCollection(
Expand Down
4 changes: 2 additions & 2 deletions src/core/services/aria/aria.js
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ function MdAriaService($$rAF, $log, $window, $interpolate) {
}
/* Perform role blacklist check */
if (parentNode.hasAttribute('role')) {
switch(parentNode.getAttribute('role').toLowerCase()) {
switch (parentNode.getAttribute('role').toLowerCase()) {
case 'command':
case 'definition':
case 'directory':
Expand All @@ -237,7 +237,7 @@ function MdAriaService($$rAF, $log, $window, $interpolate) {
}
}
/* Perform tagName blacklist check */
switch(parentNode.tagName.toLowerCase()) {
switch (parentNode.tagName.toLowerCase()) {
case 'abbr':
case 'acronym':
case 'address':
Expand Down
2 changes: 1 addition & 1 deletion src/core/services/gesture/gesture.js
Original file line number Diff line number Diff line change
Expand Up @@ -631,7 +631,7 @@ function attachToDocument($mdGesture, $$MdGestureHandler) {
var handler;
for (var name in HANDLERS) {
handler = HANDLERS[name];
if(handler instanceof $$MdGestureHandler) {
if (handler instanceof $$MdGestureHandler) {

if (handlerEvent === 'start') {
// Run cancel to reset any handlers' state
Expand Down
2 changes: 1 addition & 1 deletion src/core/services/layout/layout.js
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@
var message, usage, url;
var nodeName = element[0].nodeName.toLowerCase();

switch(className.replace(SUFFIXES,"")) {
switch (className.replace(SUFFIXES,"")) {
case "flex":
if ((nodeName == "md-button") || (nodeName == "fieldset")){
// @see https://github.com/philipwalton/flexbugs#9-some-html-elements-cant-be-flex-containers
Expand Down
4 changes: 2 additions & 2 deletions src/core/services/registry/componentRegistry.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@
if (!isValidID(handle)) return null;

var i, j, instance;
for(i = 0, j = instances.length; i < j; i++) {
for (i = 0, j = instances.length; i < j; i++) {
instance = instances[i];
if(instance.$$mdHandle === handle) {
if (instance.$$mdHandle === handle) {
return instance;
}
}
Expand Down

0 comments on commit ecf1705

Please sign in to comment.