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

Commit c67ae9b

Browse files
Splaktarandrewseguin
authored andcommitted
style(eslint): enable spaced-comment rule (#11585)
reformat .eslintrc.json
1 parent 7878d23 commit c67ae9b

34 files changed

+373
-376
lines changed

.eslintrc.json

Lines changed: 307 additions & 307 deletions
Large diffs are not rendered by default.

config/karma-sauce.conf.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ module.exports = function(config) {
1616
// Maximum 10 browsers - SauceLabs limit
1717
// Those pre-configured browsers will always run in the CI Release Mode to confirm, that all
1818
// previous jobs have passed.
19-
browsers: ['SL_CHROME'], //, 'SL_FIREFOX', 'SL_IE11'],
19+
browsers: ['SL_CHROME'], // , 'SL_FIREFOX', 'SL_IE11'],
2020
customLaunchers: sauceBrowsers,
2121

2222
captureTimeout: 180 * 1000,

config/karma.conf.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ module.exports = function(config) {
66

77
// To enable use of `gulp karma-watch`,
88
// don't use the dist/angular-material.js.
9-
//'dist/angular-material.js', // Un-minified source
9+
// 'dist/angular-material.js', // Un-minified source
1010

1111

1212
// Test utilities, source, and specifications.

config/ngModuleData.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ function buildScanner(pattern) {
2828

2929
if (depsMatch) {
3030
dependencies = depsMatch.split(/\s*,\s*/).map(function(dep) {
31-
dep = dep.trim().slice(1, -1); //remove quotes
31+
dep = dep.trim().slice(1, -1); // remove quotes
3232
return dep;
3333
});
3434
}

docs/app/js/app.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -614,7 +614,7 @@ function($scope, COMPONENTS, BUILDCONFIG, $mdSidenav, $timeout, $mdDialog, menu,
614614
$rootScope.$on('$locationChangeSuccess', openPage);
615615
$scope.focusMainContent = focusMainContent;
616616

617-
//-- Define a fake model for the related page selector
617+
// Define a fake model for the related page selector
618618
Object.defineProperty($rootScope, "relatedPage", {
619619
get: function () { return null; },
620620
set: angular.noop,

docs/app/js/demoInclude.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ function($q, $compile, $timeout) {
6868
return file.contentsPromise;
6969
}))
7070
.then(function(styles) {
71-
styles = styles.join('\n'); //join styles as one string
71+
styles = styles.join('\n'); // join styles as one string
7272

7373
var styleElement = angular.element('<style>' + styles + '</style>');
7474
document.body.appendChild(styleElement[0]);

docs/app/js/highlight-angular.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ angular.module('docsApp')
44
restrict: 'E',
55
compile: function(element, attr) {
66
var code;
7-
//No attribute? code is the content
7+
// No attribute? code is the content
88
if (!attr.code) {
99
code = element.html();
1010
element.empty();

docs/config/processors/componentsData.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ module.exports = function componentsGenerateProcessor() {
8080
});
8181

8282
})
83-
.filter() //remove null items
83+
.filter() // remove null items
8484
.value();
8585

8686
const EXPOSED_CORE_SERVICES = '$mdMedia';

gulp/tasks/ddescribe-iit.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,8 @@ const kDisallowedFunctions = [
77
// Allow xit/xdescribe --- disabling tests is okay
88
'fit',
99
'iit',
10-
//'xit',
1110
'fdescribe',
1211
'ddescribe',
13-
//'xdescribe',
1412
'describe.only',
1513
'it.only'
1614
];

gulpfile.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
const gulp = require('gulp');
22
const fs = require('fs');
33

4-
//-- include docs gulpfile (should eventually be factored out)
4+
// include docs gulpfile (should eventually be factored out)
55
require('./docs/gulpfile');
66

7-
//-- read in all files from gulp/tasks and create tasks for them
7+
// read in all files from gulp/tasks and create tasks for them
88
fs.readdirSync('./gulp/tasks')
99
.filter(function (filename) {
1010
return filename.match(/\.js$/i);

release.js

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
log('If you would like to cancel this release, please run "./abort"');
5757
}
5858

59-
//-- utility methods
59+
// utility methods
6060

6161
/** confirms that you will be able to perform the release before attempting */
6262
function validate () {
@@ -146,7 +146,7 @@
146146
}
147147
} else {
148148
version[ type ]++;
149-
//-- reset any version numbers lower than the one changed
149+
// reset any version numbers lower than the one changed
150150
switch (type) {
151151
case 'minor': version.patch = 0;
152152
case 'patch': version.rc = 0;
@@ -216,13 +216,13 @@
216216
const options = { cwd: './bower-material' };
217217
const bower = require(options.cwd + '/bower.json'),
218218
pkg = require(options.cwd + '/package.json');
219-
//-- update versions in config files
219+
// update versions in config files
220220
bower.version = pkg.version = newVersion;
221221
fs.writeFileSync(options.cwd + '/package.json', JSON.stringify(pkg, null, 2));
222222
fs.writeFileSync(options.cwd + '/bower.json', JSON.stringify(bower, null, 2));
223223
done();
224224
start('Building bower files...');
225-
//-- build files for bower
225+
// build files for bower
226226
exec([
227227
'rm -rf dist',
228228
'gulp build',
@@ -232,15 +232,15 @@
232232
]);
233233
done();
234234
start('Copy files into bower repo...');
235-
//-- copy files over to bower repo
235+
// copy files over to bower repo
236236
exec([
237237
'cp -Rf ../dist/* ./',
238238
'git add -A',
239239
`git commit -m "release: version ${newVersion}"`,
240240
'rm -rf ../dist'
241241
], options);
242242
done();
243-
//-- add steps to push script
243+
// add steps to push script
244244
pushCmds.push(
245245
comment('push to bower (master and tag) and publish to npm'),
246246
'cd ' + options.cwd,
@@ -262,14 +262,14 @@
262262
const options = { cwd: './code.material.angularjs.org' };
263263
writeDocsJson();
264264

265-
//-- build files for bower
265+
// build files for bower
266266
exec([
267267
'rm -rf dist',
268268
'gulp docs'
269269
]);
270270
replaceFilePaths();
271271

272-
//-- copy files over to site repo
272+
// copy files over to site repo
273273
exec([
274274
`cp -Rf ../dist/docs ${newVersion}`,
275275
'rm -rf latest && cp -Rf ../dist/docs latest',
@@ -280,12 +280,12 @@
280280
replaceBaseHref(newVersion);
281281
replaceBaseHref('latest');
282282

283-
//-- update firebase.json file
283+
// update firebase.json file
284284
updateFirebaseJson();
285285
exec([ 'git commit --amend --no-edit -a' ], options);
286286
done();
287287

288-
//-- add steps to push script
288+
// add steps to push script
289289
pushCmds.push(
290290
comment('push the site'),
291291
'cd ' + options.cwd,
@@ -323,15 +323,15 @@
323323
const config = require(options.cwd + '/docs.json');
324324
config.versions.unshift(newVersion);
325325

326-
//-- only set to default if not a release candidate
326+
// only set to default if not a release candidate
327327
config.latest = newVersion;
328328
fs.writeFileSync(options.cwd + '/docs.json', JSON.stringify(config, null, 2));
329329
}
330330
}
331331

332332
/** replaces localhost file paths with public URLs */
333333
function replaceFilePaths () {
334-
//-- handle docs.js
334+
// handle docs.js
335335
const filePath = path.join(__dirname, '/dist/docs/docs.js');
336336
const file = fs.readFileSync(filePath);
337337
const contents = file.toString()
@@ -342,7 +342,7 @@
342342

343343
/** replaces base href in index.html for new version as well as latest */
344344
function replaceBaseHref (folder) {
345-
//-- handle index.html
345+
// handle index.html
346346
const filePath = path.join(__dirname, '/code.material.angularjs.org/', folder, '/index.html');
347347
const file = fs.readFileSync(filePath);
348348
const contents = file.toString().replace(/base href="\//g, 'base href="/' + folder + '/');

src/components/autocomplete/js/autocompleteController.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ function MdAutocompleteCtrl ($scope, $element, $mdUtil, $mdConstant, $mdTheming,
6969

7070
return init();
7171

72-
//-- initialization methods
72+
// initialization methods
7373

7474
/**
7575
* Initialize the controller, setup watchers, gather elements
@@ -325,7 +325,7 @@ function MdAutocompleteCtrl ($scope, $element, $mdUtil, $mdConstant, $mdTheming,
325325
return obj;
326326
}
327327

328-
//-- event/change handlers
328+
// event/change handlers
329329

330330
/**
331331
* Handles changes to the `hidden` property.
@@ -610,7 +610,7 @@ function MdAutocompleteCtrl ($scope, $element, $mdUtil, $mdConstant, $mdTheming,
610610
}
611611
}
612612

613-
//-- getters
613+
// getters
614614

615615
/**
616616
* Returns the minimum length needed to display the dropdown.
@@ -780,7 +780,7 @@ function MdAutocompleteCtrl ($scope, $element, $mdUtil, $mdConstant, $mdTheming,
780780
return ($scope.searchText || '').length >= getMinLength();
781781
}
782782

783-
//-- actions
783+
// actions
784784

785785
/**
786786
* Defines a public property with a handler and a default value.
@@ -804,7 +804,7 @@ function MdAutocompleteCtrl ($scope, $element, $mdUtil, $mdConstant, $mdTheming,
804804
* @param {number} index to select
805805
*/
806806
function select (index) {
807-
//-- force form to update state for validation
807+
// force form to update state for validation
808808
$mdUtil.nextTick(function () {
809809
getDisplayValue(ctrl.matches[ index ]).then(function (val) {
810810
var ngModel = elements.$.input.controller('ngModel');

src/components/button/button.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ function MdButtonDirective($mdButtonInkRipple, $mdTheming, $mdAria, $mdInteracti
133133
if (isAnchor(attr)) {
134134
return '<a class="md-button" ng-transclude></a>';
135135
} else {
136-
//If buttons don't have type="button", they will submit forms automatically.
136+
// If buttons don't have type="button", they will submit forms automatically.
137137
var btnType = (typeof attr.type === 'undefined') ? 'button' : attr.type;
138138
return '<button class="md-button" type="' + btnType + '" ng-transclude></button>';
139139
}

src/components/datepicker/js/calendarMonth.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@
112112
};
113113
}
114114

115-
/*** Initialization ***/
115+
/** Initialization **/
116116

117117
/**
118118
* Initialize the controller by saving a reference to the calendar and

src/components/dialog/dialog.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ function MdDialogDirective($$rAF, $mdTheming, $mdDialog) {
6161
if (content) {
6262
images = content.getElementsByTagName('img');
6363
addOverflowClass();
64-
//-- delayed image loading may impact scroll height, check after images are loaded
64+
// delayed image loading may impact scroll height, check after images are loaded
6565
angular.element(images).on('load', addOverflowClass);
6666
}
6767

src/components/dialog/dialog.spec.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1428,9 +1428,9 @@ describe('$mdDialog', function() {
14281428
template: '<md-dialog class="two">',
14291429
parent: parent
14301430
});
1431-
//First run is for the old dialog being hidden.
1431+
// First run is for the old dialog being hidden.
14321432
runAnimation();
1433-
//Second run is for the new dialog being shown.
1433+
// Second run is for the new dialog being shown.
14341434
runAnimation();
14351435
$mdDialog.hide();
14361436
runAnimation();

src/components/fabSpeedDial/fabController.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@
180180

181181
// TODO: On desktop, we should be able to reset the indexes so you cannot tab through, but
182182
// this breaks accessibility, especially on mobile, since you have no arrow keys to press
183-
//resetActionTabIndexes();
183+
// resetActionTabIndexes();
184184
}
185185

186186
function disableKeyboard() {

src/components/menu/js/menuServiceProvider.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ angular
22
.module('material.components.menu')
33
.provider('$mdMenu', MenuProvider);
44

5-
/*
5+
/**
66
* Interim element provider for the menu.
77
* Handles behavior for a menu while it is open, including:
88
* - handling animating the menu opening/closing
@@ -180,7 +180,7 @@ function MenuProvider($$interimElementProvider) {
180180
angular.extend(opts, {
181181
alreadyOpen: false,
182182
isRemoved: false,
183-
target: angular.element(opts.target), //make sure it's not a naked dom node
183+
target: angular.element(opts.target), // make sure it's not a naked DOM node
184184
parent: angular.element(opts.parent),
185185
menuContentEl: angular.element(element[0].querySelector('md-menu-content'))
186186
});

src/components/progressLinear/progress-linear.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -149,9 +149,6 @@ function MdProgressLinearDirective($mdTheming, $mdUtil, $log) {
149149
var hasValue = angular.isDefined(attr.value);
150150
var mode = hasValue ? MODE_DETERMINATE : MODE_INDETERMINATE;
151151
var info = "Auto-adding the missing md-mode='{0}' to the ProgressLinear element";
152-
153-
//$log.debug( $mdUtil.supplant(info, [mode]) );
154-
155152
element.attr("md-mode", mode);
156153
attr.mdMode = mode;
157154
}

src/components/select/select.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1406,7 +1406,7 @@ function SelectProvider($$interimElementProvider) {
14061406

14071407
angular.extend(options, {
14081408
isRemoved: false,
1409-
target: angular.element(options.target), //make sure it's not a naked dom node
1409+
target: angular.element(options.target), // make sure it's not a naked DOM node
14101410
parent: angular.element(options.parent),
14111411
selectEl: selectEl,
14121412
contentEl: element.find('md-content'),

src/components/select/select.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ describe('<md-select>', function() {
217217
$material.flushInterimElement();
218218

219219
// FIXME- does not work with minified, jquery
220-
//expect($document[0].activeElement).toBe(select[0]);
220+
// expect($document[0].activeElement).toBe(select[0]);
221221

222222
// Clean up the DOM after the test.
223223
$document[0].body.removeChild(select[0]);

src/components/sticky/sticky.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ function MdSticky($mdConstant, $$rAF, $mdUtil, $compile) {
119119
var self;
120120
return self = {
121121
prev: null,
122-
current: null, //the currently stickied item
122+
current: null, // the currently stickied item
123123
next: null,
124124
items: [],
125125
add: add,
@@ -194,8 +194,9 @@ function MdSticky($mdConstant, $$rAF, $mdUtil, $compile) {
194194
while (current && current !== contentEl[0]) {
195195
item.top += current.offsetTop;
196196
item.left += current.offsetLeft;
197-
if (current.offsetParent){
198-
item.right += current.offsetParent.offsetWidth - current.offsetWidth - current.offsetLeft; //Compute offsetRight
197+
if (current.offsetParent) {
198+
// Compute offsetRight
199+
item.right += current.offsetParent.offsetWidth - current.offsetWidth - current.offsetLeft;
199200
}
200201
current = current.offsetParent;
201202
}

src/components/switch/switch.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ function MdSwitch(mdCheckboxDirective, $mdUtil, $mdConstant, $parse, $$rAF, $mdG
133133

134134
var percent = ev.pointer.distanceX / drag.width;
135135

136-
//if checked, start from right. else, start from left
136+
// if checked, start from right. else, start from left
137137
var translate = ngModel.$viewValue ? 1 + percent : percent;
138138
// Make sure the switch stays inside its bounds, 0-1%
139139
translate = Math.max(0, Math.min(1, translate));

src/components/tabs/js/tabsController.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -636,10 +636,10 @@ function MdTabsController ($scope, $element, $window, $mdConstant, $mdTabInkRipp
636636
var width = 0;
637637

638638
angular.forEach(tabs, function (tab) {
639-
//-- Uses the larger value between `getBoundingClientRect().width` and `offsetWidth`. This
640-
// prevents `offsetWidth` value from being rounded down and causing wrapping issues, but
641-
// also handles scenarios where `getBoundingClientRect()` is inaccurate (ie. tabs inside
642-
// of a dialog)
639+
// Uses the larger value between `getBoundingClientRect().width` and `offsetWidth`. This
640+
// prevents `offsetWidth` value from being rounded down and causing wrapping issues, but
641+
// also handles scenarios where `getBoundingClientRect()` is inaccurate (ie. tabs inside
642+
// of a dialog).
643643
width += Math.max(tab.offsetWidth, tab.getBoundingClientRect().width);
644644
});
645645

src/components/tabs/tabs.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,7 @@ describe('<md-tabs>', function () {
382382
expect(tabContent.attr('role')).toBe('tabpanel');
383383
expect(tabContent.attr('aria-labelledby')).toBe(tabItem.attr('id'));
384384

385-
//Unique ids check
385+
// Unique ids check
386386
expect(tabContent.attr('id')).not.toEqual(tabItem.attr('id'));
387387
});
388388

src/components/toast/toast.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -470,7 +470,7 @@ function MdToastProvider($$interimElementProvider) {
470470
options.element = element;
471471

472472
options.onSwipe = function(ev, gesture) {
473-
//Add the relevant swipe class to the element so it can animate correctly
473+
// Add the relevant swipe class to the element so it can animate correctly
474474
var swipe = ev.type.replace('$md.','');
475475
var direction = swipe.replace('swipe', '');
476476

0 commit comments

Comments
 (0)