Skip to content

Commit 0711278

Browse files
committed
Run yarn lint:fix
1 parent 3e57264 commit 0711278

File tree

136 files changed

+2184
-1208
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

136 files changed

+2184
-1208
lines changed

app/adapters/application.js

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import { pluralize } from 'ember-inflector';
66
import { isBlank } from '@ember/utils';
77

88
export default JSONAPIAdapter.extend({
9-
109
host: ENV.API_HOST,
1110

1211
currentProject: '',
@@ -26,7 +25,9 @@ export default JSONAPIAdapter.extend({
2625
}
2726
return; // return undefined so auto determinated
2827
},
29-
shouldBackgroundReloadAll() { return false; },
28+
shouldBackgroundReloadAll() {
29+
return false;
30+
},
3031
shouldBackgroundReloadRecord(store, { modelName, id }) {
3132
let key = `${modelName}-${id}`;
3233
let hasId = this.ids[key];
@@ -59,14 +60,18 @@ export default JSONAPIAdapter.extend({
5960

6061
if (typeof revId !== 'undefined') {
6162
let encodedRevId = encodeURIComponent(revId);
62-
url = `json-docs/${projectName}/${version}/${pluralize(modelNameToUse)}/${encodedRevId}`;
63+
url = `json-docs/${projectName}/${version}/${pluralize(
64+
modelNameToUse
65+
)}/${encodedRevId}`;
6366
} else {
6467
throw new Error('Documentation item not found');
6568
}
6669
} else if (modelName === 'missing') {
6770
let version = this.get('projectService.version');
6871
let revId = this.metaStore.getRevId(projectName, version, modelName, id);
69-
url = `json-docs/${projectName}/${version}/${pluralize(modelName)}/${revId}`;
72+
url = `json-docs/${projectName}/${version}/${pluralize(
73+
modelName
74+
)}/${revId}`;
7075
} else if (modelName === 'project') {
7176
this.currentProject = id;
7277
url = `rev-index/${id}`;
@@ -82,6 +87,5 @@ export default JSONAPIAdapter.extend({
8287
let response = await fetch(url);
8388
let json = await response.json();
8489
return json;
85-
}
86-
90+
},
8791
});

app/components/api-index-filter.js

Lines changed: 55 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -2,60 +2,78 @@ import { computed } from '@ember/object';
22
import Component from '@ember/component';
33
import sortBy from 'lodash.sortby';
44

5-
const filterDataComputedParams = 'filterData.{showInherited,showProtected,showPrivate,showDeprecated}';
5+
const filterDataComputedParams =
6+
'filterData.{showInherited,showProtected,showPrivate,showDeprecated}';
67

78
export default Component.extend({
89
classNames: ['api-index-filter'],
910

10-
filteredMethods: computed('model.methods.[]', filterDataComputedParams,
11-
function() {
11+
filteredMethods: computed(
12+
'model.methods.[]',
13+
filterDataComputedParams,
14+
function () {
1215
return this.filterItems('methods');
13-
}),
16+
}
17+
),
1418

15-
filteredEvents: computed('model.events.[]', filterDataComputedParams,
16-
function() {
19+
filteredEvents: computed(
20+
'model.events.[]',
21+
filterDataComputedParams,
22+
function () {
1723
return this.filterItems('events');
18-
}),
24+
}
25+
),
1926

20-
filteredProperties: computed('model.properties.[]', filterDataComputedParams,
21-
function() {
27+
filteredProperties: computed(
28+
'model.properties.[]',
29+
filterDataComputedParams,
30+
function () {
2231
return this.filterItems('properties');
23-
}),
32+
}
33+
),
2434

2535
filterItems(itemType) {
26-
let items = this.getWithDefault(`model.${itemType}`, []);
36+
let items =
37+
this.get(`model.${itemType}`) === undefined
38+
? []
39+
: this.get(`model.${itemType}`);
2740
if (!this.get('filterData.showInherited')) {
28-
items = items.filter(item => item.inherited !== true);
41+
items = items.filter((item) => item.inherited !== true);
2942
}
3043
if (!this.get('filterData.showProtected')) {
31-
items = items.filter(item => item.access !== 'protected');
44+
items = items.filter((item) => item.access !== 'protected');
3245
}
3346
if (!this.get('filterData.showPrivate')) {
34-
items = items.filter(item => item.access !== 'private');
47+
items = items.filter((item) => item.access !== 'private');
3548
}
3649
if (!this.get('filterData.showDeprecated')) {
37-
items = items.filter(item => item.deprecated !== true);
50+
items = items.filter((item) => item.deprecated !== true);
3851
}
3952

40-
let sortedItems = sortBy(items, (item => item.name));
53+
let sortedItems = sortBy(items, (item) => item.name);
4154
return this.filterMultipleInheritance(sortedItems);
4255
},
4356

44-
filteredData: computed('filteredMethods', 'filteredProperties', 'filteredEvents', function() {
45-
return {
46-
methods: this.filteredMethods,
47-
properties: this.filteredProperties,
48-
events: this.filteredEvents
49-
};
50-
}),
57+
filteredData: computed(
58+
'filteredMethods',
59+
'filteredProperties',
60+
'filteredEvents',
61+
function () {
62+
return {
63+
methods: this.filteredMethods,
64+
properties: this.filteredProperties,
65+
events: this.filteredEvents,
66+
};
67+
}
68+
),
5169

5270
/**
53-
* Returns an array where duplicate methods (by name) are removed.
54-
* The docs for the nearest inheritance are typically more helpful to users,
55-
* so in cases of duplicates, "more local" is preferred.
56-
* Without this, multiple entries for some methods will show up.
57-
* @method filterMultipleInheritance
58-
*/
71+
* Returns an array where duplicate methods (by name) are removed.
72+
* The docs for the nearest inheritance are typically more helpful to users,
73+
* so in cases of duplicates, "more local" is preferred.
74+
* Without this, multiple entries for some methods will show up.
75+
* @method filterMultipleInheritance
76+
*/
5977
filterMultipleInheritance(items) {
6078
let dedupedArray = [];
6179
for (let i = 0; i < items.length; i++) {
@@ -67,7 +85,7 @@ export default Component.extend({
6785
let nextItem = items[i + 1];
6886
if (currentItem.name === nextItem.name) {
6987
// if the method would be listed twice, find the more local documentation
70-
let mostLocal = this.findMostLocal(currentItem, nextItem)
88+
let mostLocal = this.findMostLocal(currentItem, nextItem);
7189
dedupedArray.push(mostLocal);
7290
i += 1; // skip the next item with duplicate name
7391
} else {
@@ -78,11 +96,11 @@ export default Component.extend({
7896
return dedupedArray;
7997
},
8098
/**
81-
* Returns whichever item is most local.
82-
* What is "most local" is determined by looking at the file path for the
83-
* method, the file path for the class being viewed, and the parent if needed.
84-
* @method findMostLocal
85-
*/
99+
* Returns whichever item is most local.
100+
* What is "most local" is determined by looking at the file path for the
101+
* method, the file path for the class being viewed, and the parent if needed.
102+
* @method findMostLocal
103+
*/
86104
findMostLocal(currentItem, nextItem) {
87105
let currentScope = this.get('model.file');
88106
let parentClassScope = this.get('model.parentClass.file');
@@ -96,5 +114,5 @@ export default Component.extend({
96114
// otherwise, the next item must be "more local"
97115
return nextItem;
98116
}
99-
}
100-
})
117+
},
118+
});

app/components/api-index.js

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,30 +2,29 @@ import { computed } from '@ember/object';
22
import Component from '@ember/component';
33

44
export default Component.extend({
5-
65
sections: computed('itemData.{methods,properties,events}', function () {
76
return [
87
{
98
title: 'Methods',
109
tab: 'methods',
1110
items: this.get('itemData.methods'),
1211
class: 'spec-method-list',
13-
routeSuffix: '.methods.method'
12+
routeSuffix: '.methods.method',
1413
},
1514
{
1615
title: 'Properties',
1716
tab: 'properties',
1817
items: this.get('itemData.properties'),
1918
class: 'spec-property-list',
20-
routeSuffix: '.properties.property'
19+
routeSuffix: '.properties.property',
2120
},
2221
{
2322
title: 'Events',
2423
tab: 'events',
2524
items: this.get('itemData.events'),
2625
class: 'spec-event-list',
27-
routeSuffix: '.events.event'
28-
}
26+
routeSuffix: '.events.event',
27+
},
2928
];
30-
})
29+
}),
3130
});

app/components/class-field-description.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,10 @@ export default Component.extend({
66
legacyModuleMappings: service(),
77

88
hasImportExample: computed('field.{name,class}', function () {
9-
return this.legacyModuleMappings.hasFunctionMapping(this.get('field.name'), this.get('field.class'));
9+
return this.legacyModuleMappings.hasFunctionMapping(
10+
this.get('field.name'),
11+
this.get('field.class')
12+
);
1013
}),
1114

1215
/**
@@ -15,5 +18,5 @@ export default Component.extend({
1518
* @method updateAnchor
1619
* @method fieldName String The name representing the field that was clicked.
1720
*/
18-
updateAnchor() {}
21+
updateAnchor() {},
1922
});

app/components/ember-anchor.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,19 @@ export default AnchorComponent.extend({
1111
let elem = document.querySelector(`[data-${qp}="${qpVal}"]`);
1212

1313
if (elem && elem.offsetHeight) {
14-
const offsetToScroll = getOffset(elem, config.APP.scrollContainerSelector);
15-
const scrollContainer = document.querySelector(config.APP.scrollContainerSelector);
14+
const offsetToScroll = getOffset(
15+
elem,
16+
config.APP.scrollContainerSelector
17+
);
18+
const scrollContainer = document.querySelector(
19+
config.APP.scrollContainerSelector
20+
);
1621
if (scrollContainer.scrollTo) {
1722
scrollContainer.scrollTo(0, offsetToScroll);
1823
} else {
1924
// fallback for IE11
2025
scrollContainer.scrollTop = offsetToScroll;
2126
}
2227
}
23-
}
28+
},
2429
});

app/components/import-example.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ export default Component.extend({
66
showSuccess() {
77
this.toggleProperty('showClipboardSuccessIcon');
88
later(this, () => this.toggleProperty('showClipboardSuccessIcon'), 950);
9-
}
10-
}
9+
},
10+
},
1111
});

app/components/loading-spinner.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import Component from '@ember/component';
22

33
export default Component.extend({
4-
classNames: ['loading-spinner']
4+
classNames: ['loading-spinner'],
55
});

app/components/search-input.js

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -22,21 +22,26 @@ export default Component.extend({
2222
this._resultTetherConstraints = [
2323
{
2424
to: 'window',
25-
pin: ['left','right']
26-
}
25+
pin: ['left', 'right'],
26+
},
2727
];
2828
this._super(...arguments);
2929
},
3030

31-
noResults: computed('query', 'searchService.{results.[],search.isRunning}', function() {
32-
if (get(this, 'searchService.search.isRunning')) {
33-
return false;
31+
noResults: computed(
32+
'query',
33+
'searchService.{results.[],search.isRunning}',
34+
function () {
35+
if (get(this, 'searchService.search.isRunning')) {
36+
return false;
37+
}
38+
return (
39+
isPresent(this.query) && isEmpty(get(this, 'searchService.results'))
40+
);
3441
}
35-
return isPresent(this.query) && isEmpty(get(this, 'searchService.results'));
36-
}),
37-
38-
search: task(function * (query) {
42+
),
3943

44+
search: task(function* (query) {
4045
yield timeout(SEARCH_DEBOUNCE_PERIOD);
4146

4247
set(this, 'query', query);
@@ -50,24 +55,21 @@ export default Component.extend({
5055
set(this, '_focused', true);
5156

5257
yield get(this, 'searchService.search').perform(query);
53-
5458
}).restartable(),
5559

56-
closeMenu: task(function * () {
60+
closeMenu: task(function* () {
5761
yield timeout(SEARCH_CLOSE_PERIOD);
5862

5963
set(this, '_focused', false);
6064
}),
6165

6266
actions: {
63-
6467
onfocus() {
6568
set(this, '_focused', true);
6669
},
6770

6871
onblur() {
6972
this.closeMenu.perform();
70-
}
71-
72-
}
73+
},
74+
},
7375
});
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import Component from '@ember/component';
22

33
export default Component.extend({
4-
classNames: ['ds-suggestion']
4+
classNames: ['ds-suggestion'],
55
});

app/components/search-input/dropdown-result.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,16 @@ export default Component.extend({
2323
classNames: ['ds-suggestion'],
2424
attributeBindings: ['role'],
2525
version: computed('result._tags.[]', function () {
26-
let versionTag = this.get('result._tags').find(_tag => _tag.indexOf('version:') > -1);
26+
let versionTag = this.get('result._tags').find(
27+
(_tag) => _tag.indexOf('version:') > -1
28+
);
2729
let versionSegments = versionTag.replace('version:', '').split('.');
2830
return `${versionSegments[0]}.${versionSegments[1]}`;
2931
}),
3032
// Left sidebar should only be displayed for the first result in the group
3133
_primaryColumn: computed('groupPosition,groupName', function () {
3234
const { groupName, groupPosition } = this;
33-
return groupPosition === 0? groupName : '';
35+
return groupPosition === 0 ? groupName : '';
3436
}),
35-
isSecondary: gt('groupPosition', 0)
36-
37-
37+
isSecondary: gt('groupPosition', 0),
3838
});

0 commit comments

Comments
 (0)