Skip to content

Commit 06bd92d

Browse files
Foxandxsspkozlowski-opensource
authored andcommitted
style(all): enforce single quotes
Closes angular-ui#1608
1 parent 9c43ae7 commit 06bd92d

File tree

25 files changed

+159
-158
lines changed

25 files changed

+159
-158
lines changed

Gruntfile.js

+19-18
Original file line numberDiff line numberDiff line change
@@ -73,18 +73,18 @@ module.exports = function(grunt) {
7373
},
7474
files: [{
7575
expand: true,
76-
src: ["**/*.html"],
77-
cwd: "misc/demo/",
78-
dest: "dist/"
76+
src: ['**/*.html'],
77+
cwd: 'misc/demo/',
78+
dest: 'dist/'
7979
}]
8080
},
8181
demoassets: {
8282
files: [{
8383
expand: true,
8484
//Don't re-copy html files, we process those
85-
src: ["**/**/*", "!**/*.html"],
86-
cwd: "misc/demo",
87-
dest: "dist/"
85+
src: ['**/**/*', '!**/*.html'],
86+
cwd: 'misc/demo',
87+
dest: 'dist/'
8888
}]
8989
}
9090
},
@@ -124,6 +124,7 @@ module.exports = function(grunt) {
124124
sub: true,
125125
boss: true,
126126
eqnull: true,
127+
quotmark: 'single',
127128
globals: {
128129
angular: true
129130
}
@@ -195,8 +196,8 @@ module.exports = function(grunt) {
195196
html5Mode: false
196197
},
197198
api: {
198-
src: ["src/**/*.js", "src/**/*.ngdoc"],
199-
title: "API Documentation"
199+
src: ['src/**/*.js', 'src/**/*.ngdoc'],
200+
title: 'API Documentation'
200201
}
201202
}
202203
});
@@ -246,18 +247,18 @@ module.exports = function(grunt) {
246247
name: name,
247248
moduleName: enquote('ui.bootstrap.' + name),
248249
displayName: ucwords(breakup(name, ' ')),
249-
srcFiles: grunt.file.expand("src/"+name+"/*.js"),
250-
tplFiles: grunt.file.expand("template/"+name+"/*.html"),
251-
tpljsFiles: grunt.file.expand("template/"+name+"/*.html.js"),
252-
tplModules: grunt.file.expand("template/"+name+"/*.html").map(enquote),
250+
srcFiles: grunt.file.expand('src/'+name+'/*.js'),
251+
tplFiles: grunt.file.expand('template/'+name+'/*.html'),
252+
tpljsFiles: grunt.file.expand('template/'+name+'/*.html.js'),
253+
tplModules: grunt.file.expand('template/'+name+'/*.html').map(enquote),
253254
dependencies: dependenciesForModule(name),
254255
docs: {
255-
md: grunt.file.expand("src/"+name+"/docs/*.md")
256-
.map(grunt.file.read).map(markdown).join("\n"),
257-
js: grunt.file.expand("src/"+name+"/docs/*.js")
258-
.map(grunt.file.read).join("\n"),
259-
html: grunt.file.expand("src/"+name+"/docs/*.html")
260-
.map(grunt.file.read).join("\n")
256+
md: grunt.file.expand('src/'+name+'/docs/*.md')
257+
.map(grunt.file.read).map(markdown).join('\n'),
258+
js: grunt.file.expand('src/'+name+'/docs/*.js')
259+
.map(grunt.file.read).join('\n'),
260+
html: grunt.file.expand('src/'+name+'/docs/*.html')
261+
.map(grunt.file.read).join('\n')
261262
}
262263
};
263264
module.dependencies.forEach(findModule);

src/accordion/docs/demo.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@ function AccordionDemoCtrl($scope) {
33

44
$scope.groups = [
55
{
6-
title: "Dynamic Group Header - 1",
7-
content: "Dynamic Group Body - 1"
6+
title: 'Dynamic Group Header - 1',
7+
content: 'Dynamic Group Body - 1'
88
},
99
{
10-
title: "Dynamic Group Header - 2",
11-
content: "Dynamic Group Body - 2"
10+
title: 'Dynamic Group Header - 2',
11+
content: 'Dynamic Group Body - 2'
1212
}
1313
];
1414

src/accordion/test/accordion.spec.js

+11-11
Original file line numberDiff line numberDiff line change
@@ -125,10 +125,10 @@ describe('accordion', function () {
125125
describe('with static panels', function () {
126126
beforeEach(function () {
127127
var tpl =
128-
"<accordion>" +
129-
"<accordion-group heading=\"title 1\">Content 1</accordion-group>" +
130-
"<accordion-group heading=\"title 2\">Content 2</accordion-group>" +
131-
"</accordion>";
128+
'<accordion>' +
129+
'<accordion-group heading="title 1">Content 1</accordion-group>' +
130+
'<accordion-group heading="title 2">Content 2</accordion-group>' +
131+
'</accordion>';
132132
element = angular.element(tpl);
133133
$compile(element)(scope);
134134
scope.$digest();
@@ -171,9 +171,9 @@ describe('accordion', function () {
171171
var model;
172172
beforeEach(function () {
173173
var tpl =
174-
"<accordion>" +
175-
"<accordion-group ng-repeat='group in groups' heading='{{group.name}}'>{{group.content}}</accordion-group>" +
176-
"</accordion>";
174+
'<accordion>' +
175+
'<accordion-group ng-repeat="group in groups" heading="{{group.name}}">{{group.content}}</accordion-group>' +
176+
'</accordion>';
177177
element = angular.element(tpl);
178178
model = [
179179
{name: 'title 1', content: 'Content 1'},
@@ -246,10 +246,10 @@ describe('accordion', function () {
246246
describe('is-open attribute with dynamic content', function() {
247247
beforeEach(function () {
248248
var tpl =
249-
"<accordion>" +
250-
"<accordion-group heading=\"title 1\" is-open=\"open1\"><div ng-repeat='item in items'>{{item}}</div></accordion-group>" +
251-
"<accordion-group heading=\"title 2\" is-open=\"open2\">Static content</accordion-group>" +
252-
"</accordion>";
249+
'<accordion>' +
250+
'<accordion-group heading="title 1" is-open="open1"><div ng-repeat="item in items">{{item}}</div></accordion-group>' +
251+
'<accordion-group heading="title 2" is-open="open2">Static content</accordion-group>' +
252+
'</accordion>';
253253
element = angular.element(tpl);
254254
scope.items = ['Item 1', 'Item 2', 'Item 3'];
255255
scope.open1 = true;

src/alert/alert.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
angular.module("ui.bootstrap.alert", [])
1+
angular.module('ui.bootstrap.alert', [])
22

33
.controller('AlertController', ['$scope', '$attrs', function ($scope, $attrs) {
44
$scope.closeable = 'close' in $attrs;

src/alert/docs/demo.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ function AlertDemoCtrl($scope) {
55
];
66

77
$scope.addAlert = function() {
8-
$scope.alerts.push({msg: "Another alert!"});
8+
$scope.alerts.push({msg: 'Another alert!'});
99
};
1010

1111
$scope.closeAlert = function(index) {

src/alert/test/alert.spec.js

+11-11
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
1-
describe("alert", function () {
1+
describe('alert', function () {
22

33
var scope, $compile;
44
var element;
55

66
beforeEach(module('ui.bootstrap.alert'));
7-
beforeEach(module('template/alert/alert.html'));
7+
beforeEach(module('template/alert/alert.html'));
88

99
beforeEach(inject(function ($rootScope, _$compile_, $controller) {
1010

1111
scope = $rootScope;
1212
$compile = _$compile_;
1313

1414
element = angular.element(
15-
"<div>" +
16-
"<alert ng-repeat='alert in alerts' type='alert.type'" +
17-
"close='removeAlert($index)'>{{alert.msg}}" +
18-
"</alert>" +
19-
"</div>");
15+
'<div>' +
16+
'<alert ng-repeat="alert in alerts" type="alert.type"' +
17+
'close="removeAlert($index)">{{alert.msg}}' +
18+
'</alert>' +
19+
'</div>');
2020

2121
scope.alerts = [
2222
{ msg:'foo', type:'success'},
@@ -39,12 +39,12 @@ describe("alert", function () {
3939
return element.find('span').eq(index);
4040
}
4141

42-
it("should generate alerts using ng-repeat", function () {
42+
it('should generate alerts using ng-repeat', function () {
4343
var alerts = createAlerts();
4444
expect(alerts.length).toEqual(3);
4545
});
4646

47-
it("should use correct classes for different alert types", function () {
47+
it('should use correct classes for different alert types', function () {
4848
var alerts = createAlerts();
4949
expect(alerts.eq(0)).toHaveClass('alert-success');
5050
expect(alerts.eq(1)).toHaveClass('alert-error');
@@ -59,15 +59,15 @@ describe("alert", function () {
5959
}
6060
});
6161

62-
it("should show close buttons", function () {
62+
it('should show close buttons', function () {
6363
var alerts = createAlerts();
6464

6565
for (var i = 0, n = alerts.length; i < n; i++) {
6666
expect(findCloseButton(i).css('display')).not.toBe('none');
6767
}
6868
});
6969

70-
it("should fire callback when closed", function () {
70+
it('should fire callback when closed', function () {
7171

7272
var alerts = createAlerts();
7373

src/buttons/test/buttons.spec.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -119,19 +119,19 @@ describe('buttons', function () {
119119
});
120120

121121
it('should watch btn-radio values and update state accordingly', function () {
122-
$scope.values = ["value1", "value2"];
122+
$scope.values = ['value1', 'value2'];
123123

124124
var btns = compileButtons('<button ng-model="model" btn-radio="values[0]">click1</button><button ng-model="model" btn-radio="values[1]">click2</button>', $scope);
125125
expect(btns.eq(0)).not.toHaveClass('active');
126126
expect(btns.eq(1)).not.toHaveClass('active');
127127

128-
$scope.model = "value2";
128+
$scope.model = 'value2';
129129
$scope.$digest();
130130
expect(btns.eq(0)).not.toHaveClass('active');
131131
expect(btns.eq(1)).toHaveClass('active');
132132

133-
$scope.values[1] = "value3";
134-
$scope.model = "value3";
133+
$scope.values[1] = 'value3';
134+
$scope.model = 'value3';
135135
$scope.$digest();
136136
expect(btns.eq(0)).not.toHaveClass('active');
137137
expect(btns.eq(1)).toHaveClass('active');

src/carousel/carousel.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ angular.module('ui.bootstrap.carousel', ['ui.bootstrap.transition'])
2020
var nextIndex = slides.indexOf(nextSlide);
2121
//Decide direction if it's not given
2222
if (direction === undefined) {
23-
direction = nextIndex > currentIndex ? "next" : "prev";
23+
direction = nextIndex > currentIndex ? 'next' : 'prev';
2424
}
2525
if (nextSlide && nextSlide !== self.currentSlide) {
2626
if ($scope.$currentTransition) {

src/datepicker/docs/demo.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ var DatepickerDemoCtrl = function ($scope) {
3131
};
3232

3333
$scope.dateOptions = {
34-
'year-format': "'yy'",
34+
'year-format': '\'yy\'',
3535
'starting-day': 1
3636
};
3737

src/datepicker/test/datepicker.spec.js

+14-14
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ describe('datepicker directive', function () {
66
beforeEach(inject(function(_$compile_, _$rootScope_) {
77
$compile = _$compile_;
88
$rootScope = _$rootScope_;
9-
$rootScope.date = new Date("September 30, 2010 15:30:00");
9+
$rootScope.date = new Date('September 30, 2010 15:30:00');
1010
}));
1111

1212
function getTitle() {
@@ -502,7 +502,7 @@ describe('datepicker directive', function () {
502502

503503
describe('min attribute', function () {
504504
beforeEach(function() {
505-
$rootScope.mindate = new Date("September 12, 2010");
505+
$rootScope.mindate = new Date('September 12, 2010');
506506
element = $compile('<datepicker ng-model="date" min="mindate"></datepicker>')($rootScope);
507507
$rootScope.$digest();
508508
});
@@ -516,7 +516,7 @@ describe('datepicker directive', function () {
516516
});
517517

518518
it('disables appropriate days when min date changes', function() {
519-
$rootScope.mindate = new Date("September 5, 2010");
519+
$rootScope.mindate = new Date('September 5, 2010');
520520
$rootScope.$digest();
521521
for (var i = 0; i < 5; i ++) {
522522
for (var j = 0; j < 7; j ++) {
@@ -526,8 +526,8 @@ describe('datepicker directive', function () {
526526
});
527527

528528
it('invalidates when model is a disabled date', function() {
529-
$rootScope.mindate = new Date("September 5, 2010");
530-
$rootScope.date = new Date("September 2, 2010");
529+
$rootScope.mindate = new Date('September 5, 2010');
530+
$rootScope.date = new Date('September 2, 2010');
531531
$rootScope.$digest();
532532
expect(element.hasClass('ng-invalid')).toBeTruthy();
533533
expect(element.hasClass('ng-invalid-date-disabled')).toBeTruthy();
@@ -582,7 +582,7 @@ describe('datepicker directive', function () {
582582

583583
it('enables everything before if it is cleared', function() {
584584
$rootScope.mindate = null;
585-
$rootScope.date = new Date("December 20, 1949");
585+
$rootScope.date = new Date('December 20, 1949');
586586
$rootScope.$digest();
587587

588588
clickTitleButton();
@@ -597,7 +597,7 @@ describe('datepicker directive', function () {
597597

598598
describe('max attribute', function () {
599599
beforeEach(function() {
600-
$rootScope.maxdate = new Date("September 25, 2010");
600+
$rootScope.maxdate = new Date('September 25, 2010');
601601
element = $compile('<datepicker ng-model="date" max="maxdate"></datepicker>')($rootScope);
602602
$rootScope.$digest();
603603
});
@@ -611,7 +611,7 @@ describe('datepicker directive', function () {
611611
});
612612

613613
it('disables appropriate days when max date changes', function() {
614-
$rootScope.maxdate = new Date("September 18, 2010");
614+
$rootScope.maxdate = new Date('September 18, 2010');
615615
$rootScope.$digest();
616616
for (var i = 0; i < 5; i ++) {
617617
for (var j = 0; j < 7; j ++) {
@@ -621,7 +621,7 @@ describe('datepicker directive', function () {
621621
});
622622

623623
it('invalidates when model is a disabled date', function() {
624-
$rootScope.maxdate = new Date("September 18, 2010");
624+
$rootScope.maxdate = new Date('September 18, 2010');
625625
$rootScope.$digest();
626626
expect(element.hasClass('ng-invalid')).toBeTruthy();
627627
expect(element.hasClass('ng-invalid-date-disabled')).toBeTruthy();
@@ -912,7 +912,7 @@ describe('datepicker directive', function () {
912912
});
913913

914914
describe('`isDisabled` function', function() {
915-
var date = new Date("September 30, 2010 15:30:00");
915+
var date = new Date('September 30, 2010 15:30:00');
916916

917917
it('to return false if no limit is set', function() {
918918
expect(ctrl.isDisabled(date, 0)).toBeFalsy();
@@ -964,7 +964,7 @@ describe('datepicker directive', function () {
964964
describe('', function () {
965965
beforeEach(inject(function(_$document_, $sniffer) {
966966
$document = _$document_;
967-
$rootScope.date = new Date("September 30, 2010 15:30:00");
967+
$rootScope.date = new Date('September 30, 2010 15:30:00');
968968
var wrapElement = $compile('<div><input ng-model="date" datepicker-popup><div>')($rootScope);
969969
$rootScope.$digest();
970970
assignElements(wrapElement);
@@ -1014,7 +1014,7 @@ describe('datepicker directive', function () {
10141014
});
10151015

10161016
it('updates the input correctly when model changes', function() {
1017-
$rootScope.date = new Date("January 10, 1983 10:00:00");
1017+
$rootScope.date = new Date('January 10, 1983 10:00:00');
10181018
$rootScope.$digest();
10191019
expect(inputEl.val()).toBe('1983-01-10');
10201020
});
@@ -1124,7 +1124,7 @@ describe('datepicker directive', function () {
11241124
});
11251125

11261126
it('updates the input correctly when model changes', function() {
1127-
$rootScope.date = new Date("January 10, 1983 10:00:00");
1127+
$rootScope.date = new Date('January 10, 1983 10:00:00');
11281128
$rootScope.$digest();
11291129
expect(inputEl.val()).toBe('10-January-1983');
11301130
});
@@ -1149,7 +1149,7 @@ describe('datepicker directive', function () {
11491149
});
11501150

11511151
it('updates the input correctly when model changes', function() {
1152-
$rootScope.date = new Date("August 11, 2013 09:09:00");
1152+
$rootScope.date = new Date('August 11, 2013 09:09:00');
11531153
$rootScope.$digest();
11541154
expect(inputEl.val()).toBe('11-August-2013');
11551155
});

src/dropdownToggle/docs/demo.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
function DropdownCtrl($scope) {
22
$scope.items = [
3-
"The first choice!",
4-
"And another choice for you.",
5-
"but wait! A third!"
3+
'The first choice!',
4+
'And another choice for you.',
5+
'but wait! A third!'
66
];
77
}

0 commit comments

Comments
 (0)