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

Commit ecf1705

Browse files
Splaktarandrewseguin
authored andcommitted
style(eslint): enable keyword-spacing rule (#11586)
1 parent aa172b7 commit ecf1705

File tree

24 files changed

+35
-35
lines changed

24 files changed

+35
-35
lines changed

Diff for: .eslintrc.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
"init-declarations": "off",
5757
"jsx-quotes": "error",
5858
"key-spacing": "off",
59-
"keyword-spacing": "off",
59+
"keyword-spacing": ["error", {"before": true, "after": true}],
6060
"line-comment-position": "off",
6161
"linebreak-style": "off",
6262
"lines-around-comment": "off",

Diff for: docs/app/js/app.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -469,7 +469,7 @@ function(SERVICES, COMPONENTS, DEMOS, PAGES, $location, $rootScope, $http, $wind
469469
if (section.children) {
470470
// matches nested section toggles, such as API or Customization
471471
section.children.forEach(function(childSection){
472-
if(childSection.pages){
472+
if (childSection.pages){
473473
childSection.pages.forEach(function(page){
474474
matchPage(childSection, page);
475475
});
@@ -575,7 +575,7 @@ function(SERVICES, COMPONENTS, DEMOS, PAGES, $location, $rootScope, $http, $wind
575575
});
576576

577577
var parentNode = $element[0].parentNode.parentNode.parentNode;
578-
if(parentNode.classList.contains('parent-list-item')) {
578+
if (parentNode.classList.contains('parent-list-item')) {
579579
var heading = parentNode.querySelector('h2');
580580
$element[0].firstChild.setAttribute('aria-describedby', heading.id);
581581
}
@@ -689,12 +689,12 @@ function($scope, COMPONENTS, BUILDCONFIG, $mdSidenav, $timeout, $mdDialog, menu,
689689
function isSectionSelected(section) {
690690
var selected = false;
691691
var openedSection = menu.openedSection;
692-
if(openedSection === section){
692+
if (openedSection === section){
693693
selected = true;
694694
}
695-
else if(section.children) {
695+
else if (section.children) {
696696
section.children.forEach(function(childSection) {
697-
if(childSection === openedSection){
697+
if (childSection === openedSection){
698698
selected = true;
699699
}
700700
});

Diff for: docs/app/js/codepen.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@
124124
function appendLicenseFor(content, lang) {
125125
var commentStart = '', commentEnd = '';
126126

127-
switch(lang) {
127+
switch (lang) {
128128
case 'html' : commentStart = '<!--'; commentEnd = '-->'; break;
129129
case 'js' : commentStart = '/**'; commentEnd = '**/'; break;
130130
case 'css' : commentStart = '/*'; commentEnd = '*/'; break;

Diff for: docs/app/js/demo.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ angular.module('docsApp')
6565
};
6666

6767
function convertName(name) {
68-
switch(name) {
68+
switch (name) {
6969
case "index.html" : return "HTML";
7070
case "script.js" : return "JS";
7171
case "style.css" : return "CSS";

Diff for: scripts/gulp-utils.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ exports.hoistScssVariables = function() {
267267
let closeCount = 0;
268268
let openBlock = false;
269269

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

273273
if (openBlock || /^\s*\$/.test(line) && !/^\s+/.test(line)) {

Diff for: src/components/datepicker/js/datepickerDirective.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@
179179

180180
if (!mdInputContainer.label) {
181181
$mdAria.expect(element, 'aria-label', attr.mdPlaceholder);
182-
} else if(!mdNoAsterisk) {
182+
} else if (!mdNoAsterisk) {
183183
attr.$observe('required', function(value) {
184184
mdInputContainer.label.toggleClass('md-required', !!value);
185185
});

Diff for: src/components/gridList/demoDynamicTiles/script.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ angular
1919
it.title = it.title + (j+1);
2020
it.span = { row : 1, col : 1 };
2121

22-
switch(j+1) {
22+
switch (j+1) {
2323
case 1:
2424
it.background = "red";
2525
it.span.row = it.span.col = 2;

Diff for: src/components/gridList/grid-list.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ function GridListDirective($interpolate, $mdConstant, $mdGridLayout, $mdMedia) {
332332
function getGridStyle(colCount, rowCount, gutter, rowMode, rowHeight) {
333333
var style = {};
334334

335-
switch(rowMode) {
335+
switch (rowMode) {
336336
case 'fixed':
337337
style.height = DIMENSION({ unit: rowHeight, span: rowCount, gutter: gutter });
338338
style.paddingBottom = '';

Diff for: src/components/icon/icon.spec.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ describe('MdIcon directive', function() {
207207

208208
return {
209209
then: function(fn) {
210-
switch(id) {
210+
switch (id) {
211211
case 'android' : fn('<svg><g id="android"></g></svg>');
212212
break;
213213
case 'cake' : fn('<svg><g id="cake"></g></svg>');

Diff for: src/components/input/input.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -868,7 +868,7 @@ function mdSelectOnFocusDirective($document, $timeout) {
868868
// The debounce is here for Edge's sake, otherwise the selection doesn't work.
869869
// Since focus may already have been lost on the input (and because `select()`
870870
// will re-focus), make sure the element is still active before applying.
871-
if($document[0].activeElement === element[0]) {
871+
if ($document[0].activeElement === element[0]) {
872872
element[0].select();
873873
}
874874

Diff for: src/components/menu/js/menuServiceProvider.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ function MenuProvider($$interimElementProvider) {
261261

262262
if (!focusTarget) {
263263
var childrenLen = opts.menuContentEl[0].children.length;
264-
for(var childIndex = 0; childIndex < childrenLen; childIndex++) {
264+
for (var childIndex = 0; childIndex < childrenLen; childIndex++) {
265265
var child = opts.menuContentEl[0].children[childIndex];
266266
focusTarget = child.querySelector('.md-button:not([disabled])');
267267
if (focusTarget) {

Diff for: src/components/panel/demoPanelAnimations/script.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ AnimationCtrl.prototype.showDialog = function() {
2929

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

32-
switch(this.openFrom) {
32+
switch (this.openFrom) {
3333
case 'button':
3434
animation.openFrom('.animation-target');
3535
break;
@@ -42,7 +42,7 @@ AnimationCtrl.prototype.showDialog = function() {
4242
left: document.documentElement.clientWidth / 2 - 250
4343
});
4444
}
45-
switch(this.closeTo) {
45+
switch (this.closeTo) {
4646
case 'button':
4747
animation.closeTo('.animation-target');
4848
break;
@@ -56,7 +56,7 @@ AnimationCtrl.prototype.showDialog = function() {
5656
});
5757
}
5858

59-
switch(this.animationType) {
59+
switch (this.animationType) {
6060
case 'custom':
6161
animation.withAnimation({
6262
open: 'demo-dialog-custom-animation-open',

Diff for: src/components/panel/panel.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -2426,7 +2426,7 @@ MdPanelRef.prototype._callInterceptors = function(type) {
24262426
if (!response) {
24272427
try {
24282428
response = interceptor(self);
2429-
} catch(e) {
2429+
} catch (e) {
24302430
response = $q.reject(e);
24312431
}
24322432
}

Diff for: src/components/progressCircular/js/progressCircularDirective.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ function MdProgressCircularDirective($window, $mdProgressCircular, $mdTheming,
112112

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

Diff for: src/components/progressLinear/progress-linear.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ function MdProgressLinearDirective($mdTheming, $mdUtil, $log) {
127127
attr.$observe('mdMode', function(mode) {
128128
if (lastMode) container.removeClass(lastMode);
129129

130-
switch(mode) {
130+
switch (mode) {
131131
case MODE_QUERY:
132132
case MODE_BUFFER:
133133
case MODE_DETERMINATE:
@@ -160,7 +160,7 @@ function MdProgressLinearDirective($mdTheming, $mdUtil, $log) {
160160
function mode() {
161161
var value = (attr.mdMode || "").trim();
162162
if (value) {
163-
switch(value) {
163+
switch (value) {
164164
case MODE_DETERMINATE:
165165
case MODE_INDETERMINATE:
166166
case MODE_BUFFER:

Diff for: src/components/radioButton/radio-button.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ function mdRadioGroupDirective($mdUtil, $mdConstant, $mdTheming, $timeout) {
7878
}, 100);
7979
})
8080
.on('focus', function() {
81-
if(scope.mouseActive === false) {
81+
if (scope.mouseActive === false) {
8282
rgCtrl.$element.addClass('md-focused');
8383
}
8484
})

Diff for: src/components/select/select.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ function SelectDirective($mdSelect, $mdUtil, $mdConstant, $mdTheming, $mdAria, $
244244
element.empty().append(valueEl);
245245
element.append(selectTemplate);
246246

247-
if(!attr.tabindex){
247+
if (!attr.tabindex){
248248
attr.$set('tabindex', 0);
249249
}
250250

Diff for: src/components/tabs/js/tabsDummyWrapperDirective.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ function MdTabsDummyWrapper ($mdUtil, $window) {
2626
ctrl.updateInkBarStyles();
2727
};
2828

29-
if('MutationObserver' in $window) {
29+
if ('MutationObserver' in $window) {
3030
var config = {
3131
childList: true,
3232
subtree: true,

Diff for: src/components/virtualRepeat/demoScrollTo/script.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
// Whenever a different year is selected, scroll to that year
2222
$scope.$watch('ctrl.selectedYear', angular.bind(this, function(yearIndex) {
2323
var scrollYear = Math.floor(this.topIndex / 13);
24-
if(scrollYear !== yearIndex) {
24+
if (scrollYear !== yearIndex) {
2525
this.topIndex = yearIndex * 13;
2626
}
2727
}));

Diff for: src/components/virtualRepeat/virtual-repeater.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,7 @@ VirtualRepeatContainerController.prototype.scrollTo = function(position) {
373373
VirtualRepeatContainerController.prototype.scrollToIndex = function(index) {
374374
var itemSize = this.repeater.getItemSize();
375375
var itemsLength = this.repeater.itemsLength;
376-
if(index > itemsLength) {
376+
if (index > itemsLength) {
377377
index = itemsLength - 1;
378378
}
379379
this.scrollTo(itemSize * index);
@@ -386,7 +386,7 @@ VirtualRepeatContainerController.prototype.resetScroll = function() {
386386

387387
VirtualRepeatContainerController.prototype.handleScroll_ = function() {
388388
var ltr = document.dir !== 'rtl' && document.body.dir !== 'rtl';
389-
if(!ltr && !this.maxSize) {
389+
if (!ltr && !this.maxSize) {
390390
this.scroller.scrollLeft = this.scrollSize;
391391
this.maxSize = this.scroller.scrollLeft;
392392
}
@@ -681,7 +681,7 @@ VirtualRepeatController.prototype.containerUpdated = function() {
681681
// If itemSize is unknown, attempt to measure it.
682682
if (!this.itemSize) {
683683
// Make sure to clean up watchers if we can (see #8178)
684-
if(this.unwatchItemSize_ && this.unwatchItemSize_ !== angular.noop){
684+
if (this.unwatchItemSize_ && this.unwatchItemSize_ !== angular.noop){
685685
this.unwatchItemSize_();
686686
}
687687
this.unwatchItemSize_ = this.$scope.$watchCollection(

Diff for: src/core/services/aria/aria.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ function MdAriaService($$rAF, $log, $window, $interpolate) {
216216
}
217217
/* Perform role blacklist check */
218218
if (parentNode.hasAttribute('role')) {
219-
switch(parentNode.getAttribute('role').toLowerCase()) {
219+
switch (parentNode.getAttribute('role').toLowerCase()) {
220220
case 'command':
221221
case 'definition':
222222
case 'directory':
@@ -237,7 +237,7 @@ function MdAriaService($$rAF, $log, $window, $interpolate) {
237237
}
238238
}
239239
/* Perform tagName blacklist check */
240-
switch(parentNode.tagName.toLowerCase()) {
240+
switch (parentNode.tagName.toLowerCase()) {
241241
case 'abbr':
242242
case 'acronym':
243243
case 'address':

Diff for: src/core/services/gesture/gesture.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -631,7 +631,7 @@ function attachToDocument($mdGesture, $$MdGestureHandler) {
631631
var handler;
632632
for (var name in HANDLERS) {
633633
handler = HANDLERS[name];
634-
if(handler instanceof $$MdGestureHandler) {
634+
if (handler instanceof $$MdGestureHandler) {
635635

636636
if (handlerEvent === 'start') {
637637
// Run cancel to reset any handlers' state

Diff for: src/core/services/layout/layout.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,7 @@
385385
var message, usage, url;
386386
var nodeName = element[0].nodeName.toLowerCase();
387387

388-
switch(className.replace(SUFFIXES,"")) {
388+
switch (className.replace(SUFFIXES,"")) {
389389
case "flex":
390390
if ((nodeName == "md-button") || (nodeName == "fieldset")){
391391
// @see https://github.com/philipwalton/flexbugs#9-some-html-elements-cant-be-flex-containers

Diff for: src/core/services/registry/componentRegistry.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,9 @@
4444
if (!isValidID(handle)) return null;
4545

4646
var i, j, instance;
47-
for(i = 0, j = instances.length; i < j; i++) {
47+
for (i = 0, j = instances.length; i < j; i++) {
4848
instance = instances[i];
49-
if(instance.$$mdHandle === handle) {
49+
if (instance.$$mdHandle === handle) {
5050
return instance;
5151
}
5252
}

0 commit comments

Comments
 (0)