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

Commit cec409a

Browse files
5earlemmalerba
authored andcommitted
Fix jshint warnings (#11109)
add sub:true and multistr=true to .jshintrc revert and remove confusing use of ! warning update fix fix space exclude warnings
1 parent 1f6d1b2 commit cec409a

File tree

22 files changed

+39
-35
lines changed

22 files changed

+39
-35
lines changed

.jshintrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
{
2+
"sub": true,
3+
"multistr": true,
4+
"-W018": true,
25
"expr": true,
36
"boss": true,
47
"laxbreak": true,

src/components/autocomplete/demoInsideDialog/script.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
parent: angular.element(document.body),
1616
targetEvent: $event,
1717
clickOutsideToClose:true
18-
})
19-
}
18+
});
19+
};
2020
}
2121

2222
function DialogCtrl ($timeout, $q, $scope, $mdDialog) {

src/components/autocomplete/js/autocompleteDirective.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ function MdAutocomplete ($$mdSvgRegistry) {
277277
if (!angular.isDefined(attrs.mdClearButton) && !scope.floatingLabel) {
278278
scope.clearButton = true;
279279
}
280-
}
280+
};
281281
},
282282
template: function (element, attr) {
283283
var noItemsTemplate = getNoItemsTemplate(),

src/components/chips/demoContactChips/script.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
resolve( self.querySearch(criteria) );
5050

5151
refreshDebounce();
52-
}, Math.random() * 500, true)
52+
}, Math.random() * 500, true);
5353
});
5454
}
5555

src/components/chips/demoCustomInputs/script.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
}
3030

3131
// Otherwise, create a new one
32-
return { name: chip, type: 'new' }
32+
return { name: chip, type: 'new' };
3333
}
3434

3535
/**

src/components/chips/js/chipDirective.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ angular
2121

2222
// This hint text is hidden within a chip but used by screen readers to
2323
// inform the user how they can interact with a chip.
24+
2425
var DELETE_HINT_TEMPLATE = '\
2526
<span ng-if="!$mdChipsCtrl.readonly" class="md-visually-hidden">\
2627
{{$mdChipsCtrl.deleteHint}}\

src/components/chips/js/chipsDirective.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
*
1010
* @description
1111
* `<md-chips>` is an input component for building lists of strings or objects. The list items are
12-
* displayed as 'chips'. This component can make use of an `<input>` element or an
12+
* displayed as 'chips'. This component can make use of an `<input>` element or an
1313
* `<md-autocomplete>` element.
1414
*
1515
* ### Custom templates
@@ -106,7 +106,7 @@
106106
* the input and delete buttons. If no `ng-model` is provided, the chips will automatically be
107107
* marked as readonly.<br/><br/>
108108
* When `md-removable` is not defined, the `md-remove` behavior will be overwritten and disabled.
109-
* @param {string=} md-enable-chip-edit Set this to "true" to enable editing of chip contents. The user can
109+
* @param {string=} md-enable-chip-edit Set this to "true" to enable editing of chip contents. The user can
110110
* go into edit mode with pressing "space", "enter", or double clicking on the chip. Chip edit is only
111111
* supported for chips with basic template.
112112
* @param {boolean=} ng-required Whether ng-model is allowed to be empty or not.

src/components/colors/demoBasicUsage/script.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ angular.module('colorsDemo', ['ngMaterial'])
1414
scope: {
1515
name: '@',
1616
}
17-
}
17+
};
1818
})
1919
.directive('userCard', function () {
2020
return {
@@ -27,5 +27,5 @@ angular.module('colorsDemo', ['ngMaterial'])
2727
controller: function ($scope) {
2828
$scope.theme = $scope.theme || 'default';
2929
}
30-
}
30+
};
3131
});

src/components/colors/demoThemePicker/script.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
angular
22
.module('colorsThemePickerDemo', ['ngMaterial'])
33
.controller('ThemeDemoCtrl', function ($scope, $mdColorPalette) {
4-
$scope.colors = Object.keys($mdColorPalette);
4+
$scope.colors = Object.keys($mdColorPalette);
55

66
$scope.mdURL = 'https://material.google.com/style/color.html#color-color-palette';
77
$scope.primary = 'purple';
@@ -32,10 +32,10 @@ angular
3232
},
3333
controller: function ($scope, $mdColors, $mdColorUtil) {
3434
$scope.getColor = function (color) {
35-
return $mdColorUtil.rgbaToHex($mdColors.getThemeColor(color))
35+
return $mdColorUtil.rgbaToHex($mdColors.getThemeColor(color));
3636
};
3737
}
38-
}
38+
};
3939
})
4040
.directive('mdJustified', function() {
4141
return {

src/components/gridList/grid-list.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ function GridListDirective($interpolate, $mdConstant, $mdGridLayout, $mdMedia) {
105105

106106
function postLink(scope, element, attrs, ctrl) {
107107
element.addClass('_md'); // private md component indicator for styling
108-
108+
109109
// Apply semantics
110110
element.attr('role', 'list');
111111

@@ -193,9 +193,9 @@ function GridListDirective($interpolate, $mdConstant, $mdGridLayout, $mdMedia) {
193193
style: getTileStyle(ps.position, ps.spans,
194194
props.colCount, rowCount,
195195
props.gutter, props.rowMode, props.rowHeight)
196-
}
196+
};
197197
})
198-
}
198+
};
199199
})
200200
.reflow()
201201
.performance();
@@ -550,7 +550,7 @@ function GridLayoutFactory($mdUtil) {
550550
grid.element.css(grid.style);
551551
tiles.forEach(function(t) {
552552
t.element.css(t.style);
553-
})
553+
});
554554
}
555555

556556
/**

src/components/icon/demoLoadSvgIconsFromUrl/script.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@ angular.module('appDemoSvgIcons', ['ngMaterial'])
1515
/* Returns decoded SVG */
1616
$scope.getCartDecoded = function() {
1717
return '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><g id="add-shopping-cart"><path d="M11 9h2V6h3V4h-3V1h-2v3H8v2h3v3zm-4 9c-1.1 0-1.99.9-1.99 2S5.9 22 7 22s2-.9 2-2-.9-2-2-2zm10 0c-1.1 0-1.99.9-1.99 2s.89 2 1.99 2 2-.9 2-2-.9-2-2-2zm-9.83-3.25l.03-.12.9-1.63h7.45c.75 0 1.41-.41 1.75-1.03l3.86-7.01L19.42 4h-.01l-1.1 2-2.76 5H8.53l-.13-.27L6.16 6l-.95-2-.94-2H1v2h2l3.6 7.59-1.35 2.45c-.16.28-.25.61-.25.96 0 1.1.9 2 2 2h12v-2H7.42c-.13 0-.25-.11-.25-.25z"/></g></svg>';
18-
}
18+
};
1919
});

src/components/input/input.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ if (window._mdMocksIncluded) {
3030
hide : hideInputMessages,
3131
getElement : getMessagesElement
3232
}
33-
}
33+
};
3434
})
3535

3636
// Register a service for each animation so that we can easily inject them into unit tests

src/components/menu/js/menuServiceProvider.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ function MenuProvider($$interimElementProvider) {
125125
element
126126
);
127127
}
128-
128+
129129
// Register various listeners to move menu on resize/orientation change
130130
opts.cleanupResizing = startRepositioningOnResize();
131131
opts.hideBackdrop = showBackdrop(scope, element, opts);
@@ -224,7 +224,7 @@ function MenuProvider($$interimElementProvider) {
224224

225225
return function() {
226226
opts.backdrop.off('click', onBackdropClick);
227-
}
227+
};
228228
}
229229

230230
/**

src/components/navBar/navBar.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ MdNavBarController.prototype._getTabs = function() {
275275
var controllers = Array.prototype.slice.call(
276276
this._navBarEl.querySelectorAll('.md-nav-item'))
277277
.map(function(el) {
278-
return angular.element(el).controller('mdNavItem')
278+
return angular.element(el).controller('mdNavItem');
279279
});
280280
return controllers.indexOf(undefined) ? controllers : null;
281281
};

src/components/panel/demoGroups/script.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,6 @@
134134
function PanelMenuCtrl(mdPanelRef) {
135135
this.closeMenu = function() {
136136
mdPanelRef && mdPanelRef.close();
137-
}
137+
};
138138
}
139139
})();

src/components/panel/panel.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ angular
245245
* - `locals` - `{Object=}`: An object containing key/value pairs. The keys
246246
* will be used as names of values to inject into the controller. For
247247
* example, `locals: {three: 3}` would inject `three` into the controller,
248-
* with the value 3. 'mdPanelRef' is a reserved key, and will always
248+
* with the value 3. 'mdPanelRef' is a reserved key, and will always
249249
* be set to the created MdPanelRef instance.
250250
* - `resolve` - `{Object=}`: Similar to locals, except it takes promises as
251251
* values. The panel will not open until all of the promises resolve.

src/components/tabs/js/tabsController.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,7 @@ function MdTabsController ($scope, $element, $window, $mdConstant, $mdTabInkRipp
358358
* Slides the tabs over approximately one page forward.
359359
*/
360360
function nextPage () {
361-
if (!ctrl.canPageForward()) { return }
361+
if (!ctrl.canPageForward()) { return; }
362362

363363
var newOffset = MdTabsPaginationService.increasePageOffset(getElements(), ctrl.offsetLeft);
364364

@@ -369,7 +369,7 @@ function MdTabsController ($scope, $element, $window, $mdConstant, $mdTabInkRipp
369369
* Slides the tabs over approximately one page backward.
370370
*/
371371
function previousPage () {
372-
if (!ctrl.canPageBack()) { return }
372+
if (!ctrl.canPageBack()) { return; }
373373

374374
var newOffset = MdTabsPaginationService.decreasePageOffset(getElements(), ctrl.offsetLeft);
375375

src/components/toast/toast.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ function MdToastDirective($mdToast) {
1717
restrict: 'E',
1818
link: function postLink(scope, element) {
1919
element.addClass('_md'); // private md component indicator for styling
20-
20+
2121
// When navigation force destroys an interimElement, then
2222
// listen and $destroy() that interim instance...
2323
scope.$on('$destroy', function() {
@@ -118,7 +118,7 @@ function MdToastDirective($mdToast) {
118118
/**
119119
* @ngdoc method
120120
* @name $mdToast#showSimple
121-
*
121+
*
122122
* @param {string} message The message to display inside the toast
123123
* @description
124124
* Convenience method which builds and shows a simple toast.
@@ -351,7 +351,7 @@ function MdToastProvider($$interimElementProvider) {
351351
$scope.highlightClasses = [
352352
'md-highlight',
353353
self.highlightClass
354-
]
354+
];
355355
}
356356

357357
$scope.$watch(function() { return activeToastContent; }, function() {
@@ -361,7 +361,7 @@ function MdToastProvider($$interimElementProvider) {
361361
this.resolve = function() {
362362
$mdToast.hide( ACTION_RESOLVE );
363363
};
364-
}
364+
};
365365
}
366366

367367
/* @ngInject */

src/components/truncate/truncate.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ function MdTruncateDirective() {
6868
restrict: 'AE',
6969

7070
controller: MdTruncateController
71-
}
71+
};
7272
}
7373

7474
/**

src/components/virtualRepeat/virtual-repeater.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1015,6 +1015,6 @@ function ForceHeightDirective($mdUtil) {
10151015
element[0].style.height = height;
10161016
}
10171017
}
1018-
}
1018+
};
10191019
}
10201020
ForceHeightDirective.$inject = ['$mdUtil'];

src/core/services/compiler/compiler.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -415,7 +415,7 @@ function MdCompilerProvider($compileProvider) {
415415
if (contentEl.parentNode) {
416416
contentEl.parentNode.removeChild(contentEl);
417417
}
418-
}
418+
};
419419
}
420420
}
421421

@@ -439,7 +439,7 @@ function MdCompilerProvider($compileProvider) {
439439
// before.
440440
parent.insertBefore(element, nextSibling);
441441
}
442-
}
442+
};
443443
}
444444
};
445445
}

src/core/util/util.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ function UtilFactory($document, $timeout, $compile, $rootScope, $$mdAnimate, $in
8080

8181
// The newer versions of AngularJS introduced a `getOption function and made the option values no longer
8282
// visible on the $options object.
83-
return $options.getOption ? $options.getOption(optionName) : $options[optionName]
83+
return $options.getOption ? $options.getOption(optionName) : $options[optionName];
8484
},
8585

8686
/**
@@ -573,7 +573,7 @@ function UtilFactory($document, $timeout, $compile, $rootScope, $$mdAnimate, $in
573573
var hasContains = (window.Node && window.Node.prototype && Node.prototype.contains);
574574
var findFn = hasContains ? angular.bind(node, node.contains) : angular.bind(node, function(arg) {
575575
// compares the positions of two nodes and returns a bitmask
576-
return (node === child) || !!(this.compareDocumentPosition(arg) & 16)
576+
return (node === child) || !!(this.compareDocumentPosition(arg) & 16);
577577
});
578578

579579
return findFn(child);

0 commit comments

Comments
 (0)