Skip to content

Commit

Permalink
chore(lint): Fix linting
Browse files Browse the repository at this point in the history
  • Loading branch information
RomRider committed Jan 26, 2021
1 parent 13b6a4e commit 15aa785
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 1 addition & 2 deletions src/apexcharts-card.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { ChartCardConfig, EntityEntryCache } from './types';
import { HomeAssistant } from 'custom-card-helpers';
import localForage from 'localforage';
import * as pjson from '../package.json';
import { computeColors, computeName, computeUom, decompress, getMilli, log, mergeDeep } from './utils';
import { computeColors, computeName, computeUom, decompress, log, mergeDeep } from './utils';
import ApexCharts from 'apexcharts';
import { styles } from './styles';
import { HassEntity } from 'home-assistant-js-websocket';
Expand Down Expand Up @@ -309,7 +309,6 @@ class ChartsCard extends LitElement {

private async _updateData() {
if (!this._config || !this._graphs) return;
const config = this._config;

// const end = this.getEndDate();
const end = new Date();
Expand Down
4 changes: 4 additions & 0 deletions src/graphEntry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,7 @@ export default class GraphEntry {
}

buckets.some((bucket, index) => {
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
if (bucket.timestamp > properEntry![0] && index > 0) {
buckets[index - 1].data.push(properEntry);
return true;
Expand Down Expand Up @@ -261,8 +262,10 @@ export default class GraphEntry {
return items.reduce((sum, entry, index) => {
let val = 0;
if (entry && entry[1] === null) {
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
val = items[lastIndex][1]!;
} else {
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
val = entry[1]!;
lastIndex = index;
}
Expand Down Expand Up @@ -306,6 +309,7 @@ export default class GraphEntry {
}

private _median(items: EntityCachePoints) {
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
const itemsDup = this._filterNulls([...items]).sort((a, b) => a[1]! - b[1]!);
const mid = Math.floor((itemsDup.length - 1) / 2);
if (itemsDup.length % 2 === 1) return itemsDup[mid];
Expand Down

0 comments on commit 15aa785

Please sign in to comment.