Skip to content

Commit 4535883

Browse files
committed
chore: lint the other files ...
1 parent 7bdaaff commit 4535883

File tree

4 files changed

+97
-97
lines changed

4 files changed

+97
-97
lines changed

src/dev-server.js

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import angular from 'angular';
1+
import angular from 'angular'
22

3-
import './input-tags.component';
3+
import './input-tags.component'
44

55
const mock = {
66
title: 'root',
@@ -53,43 +53,43 @@ const mock = {
5353
}]
5454
}
5555
]
56-
};
56+
}
5757

5858
class DevServer {
59-
$onInit() {
60-
this.tags = [];
61-
this.disabled = false;
62-
this.suggestions = {title: '', data: []};
63-
this.updateSuggestions();
59+
$onInit () {
60+
this.tags = []
61+
this.disabled = false
62+
this.suggestions = {title: '', data: []}
63+
this.updateSuggestions()
6464
}
6565

66-
flat(accumulator, currentValue) {
67-
accumulator.push(currentValue);
66+
flat (accumulator, currentValue) {
67+
accumulator.push(currentValue)
6868
if (Array.isArray(currentValue.data)) {
69-
return currentValue.data.reduce(this.flat, accumulator);
69+
return currentValue.data.reduce(this.flat, accumulator)
7070
}
71-
return accumulator;
71+
return accumulator
7272
}
7373

74-
onTagAdd(tag) {
75-
console.log(tag);
74+
onTagAdd (tag) {
75+
console.log(tag)
7676
}
7777

78-
updateSuggestions(search) {
79-
const newSuggestions = this.searchSuggestions(search);
78+
updateSuggestions (search) {
79+
const newSuggestions = this.searchSuggestions(search)
8080

81-
this.suggestions.data.length = 0;
82-
this.suggestions.title = newSuggestions.title;
83-
Array.prototype.push.apply(this.suggestions.data, newSuggestions.data);
81+
this.suggestions.data.length = 0
82+
this.suggestions.title = newSuggestions.title
83+
Array.prototype.push.apply(this.suggestions.data, newSuggestions.data)
8484
}
8585

86-
searchSuggestions(search) {
86+
searchSuggestions (search) {
8787
return {
8888
title: mock.title,
8989
data: (search ? mock.data.reduce(this.flat, []).filter(elem => {
90-
return String(elem.title).indexOf(String(search)) >= 0;
90+
return String(elem.title).indexOf(String(search)) >= 0
9191
}) : mock.data)
92-
};
92+
}
9393
}
9494
}
9595

@@ -111,4 +111,4 @@ angular.module('dev-server', ['angularjs-input-tags'])
111111
{{$ctrl.tags | json}}
112112
</pre>`,
113113
controller: DevServer
114-
});
114+
})

src/input-tags.constants.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
module.exports = {
22
MAX_SAFE_INTEGER: 9007199254740991
3-
};
3+
}

src/input-tags.spec.js

Lines changed: 69 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -1,107 +1,107 @@
11
describe('Module: angularjs-input-tags -', () => {
2-
let $componentController;
2+
let $componentController
33

4-
beforeEach(angular.mock.module('angularjs-input-tags'));
4+
beforeEach(angular.mock.module('angularjs-input-tags'))
55
beforeEach(angular.mock.inject(_$componentController_ => {
6-
$componentController = _$componentController_;
7-
}));
6+
$componentController = _$componentController_
7+
}))
88

99
describe('Component: inputTags -', () => {
10-
let ctrl;
10+
let ctrl
1111

1212
beforeEach(() => {
1313
ctrl = $componentController('inputTags', {
1414
$element: angular.element('<div></div>')
1515
}, {
1616
onTagAdding: jasmine.createSpy('onTagAdding'),
1717
onTagRemoving: jasmine.createSpy('onTagRemoving')
18-
});
19-
});
18+
})
19+
})
2020
describe('Event: onTagAdding', () => {
2121
it('should be emit', () => {
22-
ctrl.$onInit();
23-
ctrl.addTag({code: 1, text: '1'});
24-
expect(ctrl.onTagAdding).toHaveBeenCalled();
25-
});
22+
ctrl.$onInit()
23+
ctrl.addTag({code: 1, text: '1'})
24+
expect(ctrl.onTagAdding).toHaveBeenCalled()
25+
})
2626

2727
it('should be emit with formatted tag value', () => {
28-
ctrl.$onInit();
29-
ctrl.addTag({code: 1, text: '1'});
30-
expect(ctrl.onTagAdding).toHaveBeenCalledWith({tag: {code: 1, text: '1'}});
31-
});
32-
});
28+
ctrl.$onInit()
29+
ctrl.addTag({code: 1, text: '1'})
30+
expect(ctrl.onTagAdding).toHaveBeenCalledWith({tag: {code: 1, text: '1'}})
31+
})
32+
})
3333

3434
describe('Event: onTagRemoving', () => {
3535
it('should be emit', () => {
36-
ctrl.$onInit();
37-
ctrl.tags = ['Demo'];
38-
ctrl.removeTag({code: 1, text: '1'});
39-
expect(ctrl.onTagRemoving).toHaveBeenCalled();
40-
expect(ctrl.onTagRemoving).toHaveBeenCalledWith({tag: {code: 1, text: '1'}});
41-
});
42-
});
36+
ctrl.$onInit()
37+
ctrl.tags = ['Demo']
38+
ctrl.removeTag({code: 1, text: '1'})
39+
expect(ctrl.onTagRemoving).toHaveBeenCalled()
40+
expect(ctrl.onTagRemoving).toHaveBeenCalledWith({tag: {code: 1, text: '1'}})
41+
})
42+
})
4343

4444
describe('Action: add a tag', () => {
4545
it('should add tag on list', () => {
46-
ctrl.$onInit();
47-
ctrl.addTag({code: 1, text: '1'});
48-
expect(ctrl.tags).toContain({code: 1, text: '1'});
49-
});
46+
ctrl.$onInit()
47+
ctrl.addTag({code: 1, text: '1'})
48+
expect(ctrl.tags).toContain({code: 1, text: '1'})
49+
})
5050

5151
it('should update tag list', () => {
52-
ctrl.$onInit();
53-
ctrl.addTag({code: 1, text: '1'});
54-
ctrl.addTag({code: 1, text: '1'});
55-
ctrl.addTag({code: 1, text: '1'});
56-
expect(ctrl.tags.length).toBe(1);
57-
});
58-
});
52+
ctrl.$onInit()
53+
ctrl.addTag({code: 1, text: '1'})
54+
ctrl.addTag({code: 1, text: '1'})
55+
ctrl.addTag({code: 1, text: '1'})
56+
expect(ctrl.tags.length).toBe(1)
57+
})
58+
})
5959

6060
it('should display autocomplete on focus', () => {
61-
ctrl.$onInit();
62-
ctrl.triggerFocus();
63-
expect(ctrl.autocompleteVisible).toBe(true);
64-
});
61+
ctrl.$onInit()
62+
ctrl.triggerFocus()
63+
expect(ctrl.autocompleteVisible).toBe(true)
64+
})
6565

6666
it('should hide autocomplete on blur', () => {
67-
ctrl.$onInit();
68-
ctrl.triggerBlur();
69-
expect(ctrl.autocompleteVisible).toBe(false);
70-
});
67+
ctrl.$onInit()
68+
ctrl.triggerBlur()
69+
expect(ctrl.autocompleteVisible).toBe(false)
70+
})
7171

7272
it('should remove matching element by code', () => {
73-
ctrl.$onInit();
74-
ctrl.tags.length = 0;
75-
ctrl.addTag({code: 1, text: '1'});
76-
ctrl.removeTag({code: 1});
77-
expect(ctrl.tags.length).toBe(0);
78-
});
73+
ctrl.$onInit()
74+
ctrl.tags.length = 0
75+
ctrl.addTag({code: 1, text: '1'})
76+
ctrl.removeTag({code: 1})
77+
expect(ctrl.tags.length).toBe(0)
78+
})
7979

8080
it('should reset the tag list', () => {
81-
ctrl.$onInit();
82-
expect(ctrl.path.length).toBe(0);
83-
});
81+
ctrl.$onInit()
82+
expect(ctrl.path.length).toBe(0)
83+
})
8484

8585
it('should go to the selected element in the tree', () => {
86-
ctrl.$onInit();
87-
const pathLength = ctrl.path.length;
88-
ctrl.next('subLevel');
89-
expect(ctrl.path.length).toBe(pathLength + 1);
90-
});
86+
ctrl.$onInit()
87+
const pathLength = ctrl.path.length
88+
ctrl.next('subLevel')
89+
expect(ctrl.path.length).toBe(pathLength + 1)
90+
})
9191

9292
it('should back to the previous element in the tree when on the root', () => {
93-
ctrl.$onInit();
94-
ctrl.path = [];
95-
ctrl.previous();
96-
expect(ctrl.path.length).toBe(0);
97-
});
93+
ctrl.$onInit()
94+
ctrl.path = []
95+
ctrl.previous()
96+
expect(ctrl.path.length).toBe(0)
97+
})
9898

9999
it('should back to the previous element in the tree when in 2 sublevels', () => {
100-
ctrl.$onInit();
101-
ctrl.next('subLevel');
102-
ctrl.next('subSubLevel');
103-
ctrl.previous();
104-
expect(ctrl.path.length).toBe(1);
105-
});
106-
});
107-
});
100+
ctrl.$onInit()
101+
ctrl.next('subLevel')
102+
ctrl.next('subSubLevel')
103+
ctrl.previous()
104+
expect(ctrl.path.length).toBe(1)
105+
})
106+
})
107+
})

src/tests.webpack.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import 'angular';
2-
import 'angular-mocks/angular-mocks';
1+
import 'angular'
2+
import 'angular-mocks/angular-mocks'
33

4-
const context = require.context('.', true, /\.js$/);
4+
const context = require.context('.', true, /\.js$/)
55

6-
context.keys().forEach(context);
6+
context.keys().forEach(context)

0 commit comments

Comments
 (0)