Add fixes for ESLint getter-return
…I GUESS
This commit is contained in:
parent
89136cbf6a
commit
6efc64818b
|
@ -28,7 +28,7 @@ export default class Application extends RESTAdapter {
|
|||
};
|
||||
}
|
||||
|
||||
return;
|
||||
return undefined;
|
||||
}
|
||||
|
||||
handleResponse(status, headers, payload) {
|
||||
|
|
|
@ -30,7 +30,7 @@ export default class AllocationRow extends Component {
|
|||
|
||||
@computed('allocation', 'allocation.isRunning')
|
||||
get stats() {
|
||||
if (!this.get('allocation.isRunning')) return;
|
||||
if (!this.get('allocation.isRunning')) return undefined;
|
||||
|
||||
return AllocationStatsTracker.create({
|
||||
fetch: url => this.token.authorizedRequest(url),
|
||||
|
|
|
@ -29,12 +29,12 @@ export default class AllocationStat extends Component {
|
|||
return this[this.metric];
|
||||
}
|
||||
|
||||
return;
|
||||
return undefined;
|
||||
}
|
||||
|
||||
@computed('metric', 'stat.used')
|
||||
get formattedStat() {
|
||||
if (!this.stat) return;
|
||||
if (!this.stat) return undefined;
|
||||
if (this.metric === 'memory') return formatBytes([this.stat.used]);
|
||||
return this.stat.used;
|
||||
}
|
||||
|
@ -43,6 +43,6 @@ export default class AllocationStat extends Component {
|
|||
get formattedReserved() {
|
||||
if (this.metric === 'memory') return `${this.statsTracker.reservedMemory} MiB`;
|
||||
if (this.metric === 'cpu') return `${this.statsTracker.reservedCPU} MHz`;
|
||||
return;
|
||||
return undefined;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -24,7 +24,7 @@ export default class Browser extends Component {
|
|||
return this.model;
|
||||
}
|
||||
|
||||
return;
|
||||
return undefined;
|
||||
}
|
||||
|
||||
@computed('taskState')
|
||||
|
|
|
@ -69,7 +69,7 @@ export default class File extends Component {
|
|||
return 'readat';
|
||||
}
|
||||
|
||||
return;
|
||||
return undefined;
|
||||
}
|
||||
|
||||
@computed('allocation.{id,node.httpAddr}', 'fetchMode', 'useServer')
|
||||
|
|
|
@ -19,7 +19,7 @@ export default class ImageFile extends Component {
|
|||
|
||||
@computed('src')
|
||||
get fileName() {
|
||||
if (!this.src) return;
|
||||
if (!this.src) return undefined;
|
||||
return this.src.includes('/') ? this.src.match(/^.*\/(.*)$/)[1] : this.src;
|
||||
}
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@ export default class LifecycleChartRow extends Component {
|
|||
return 'is-active';
|
||||
}
|
||||
|
||||
return;
|
||||
return undefined;
|
||||
}
|
||||
|
||||
@computed('taskState.finishedAt')
|
||||
|
@ -21,6 +21,6 @@ export default class LifecycleChartRow extends Component {
|
|||
return 'is-finished';
|
||||
}
|
||||
|
||||
return;
|
||||
return undefined;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -29,14 +29,14 @@ export default class TaskRow extends Component {
|
|||
// Since all tasks for an allocation share the same tracker, use the registry
|
||||
@computed('task', 'task.isRunning')
|
||||
get stats() {
|
||||
if (!this.get('task.isRunning')) return;
|
||||
if (!this.get('task.isRunning')) return undefined;
|
||||
|
||||
return this.statsTrackersRegistry.getTracker(this.get('task.allocation'));
|
||||
}
|
||||
|
||||
@computed('task.name', 'stats.tasks.[]')
|
||||
get taskStats() {
|
||||
if (!this.stats) return;
|
||||
if (!this.stats) return undefined;
|
||||
|
||||
return this.get('stats.tasks').findBy('task', this.get('task.name'));
|
||||
}
|
||||
|
|
|
@ -174,7 +174,7 @@ export default class Job extends Model {
|
|||
return failureEvaluations.sortBy('modifyIndex').get('lastObject');
|
||||
}
|
||||
|
||||
return;
|
||||
return undefined;
|
||||
}
|
||||
|
||||
@equal('type', 'service') supportsDeployments;
|
||||
|
@ -185,7 +185,7 @@ export default class Job extends Model {
|
|||
get runningDeployment() {
|
||||
const latest = this.latestDeployment;
|
||||
if (latest.get('isRunning')) return latest;
|
||||
return;
|
||||
return undefined;
|
||||
}
|
||||
|
||||
fetchRawDefinition() {
|
||||
|
|
|
@ -13,7 +13,7 @@ export default class NodeAttributes extends Fragment {
|
|||
const original = this.nodeAttributes;
|
||||
|
||||
if (!original) {
|
||||
return;
|
||||
return undefined;
|
||||
}
|
||||
|
||||
// `unflatten` doesn't sort keys before unflattening, so manual preprocessing is necessary.
|
||||
|
|
|
@ -74,7 +74,7 @@ export default class Node extends Model {
|
|||
return allocation.modifyTime;
|
||||
}
|
||||
|
||||
return;
|
||||
return undefined;
|
||||
}
|
||||
|
||||
@fragmentArray('node-driver') drivers;
|
||||
|
|
|
@ -47,7 +47,7 @@ export default class TokenService extends Service {
|
|||
@computed('secret', 'fetchSelfToken.lastSuccessful.value')
|
||||
get selfToken() {
|
||||
if (this.secret) return this.get('fetchSelfToken.lastSuccessful.value');
|
||||
return;
|
||||
return undefined;
|
||||
}
|
||||
|
||||
@task(function*() {
|
||||
|
|
Loading…
Reference in a new issue