Skip to content

Commit

Permalink
fixing linting
Browse files Browse the repository at this point in the history
  • Loading branch information
bdomen-ggl committed Aug 4, 2023
1 parent 85b7113 commit 0e99cb9
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,17 @@

// Return a function that is wrapped with the memoization logic
export class Memoizer {
/* eslint-disable @typescript-eslint/no-explicit-any */
cache: Map<string, any> = new Map();

memoizePromiseFn = fn => {
return (...args) => {
const key = JSON.stringify(args);

if (this.cache.has(key)) {
return this.cache.get(key);
}

this.cache.set(
key,
fn(...args).catch(error => {
Expand All @@ -32,8 +33,8 @@ export class Memoizer {
return Promise.reject(error);
})
);

return this.cache.get(key);
};
};
};
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export class RealApi implements ReportingClient {
const reports = await res.json();
const response = Object.freeze({
reports,
})
});
return response;
}

Expand All @@ -42,7 +42,7 @@ export class RealApi implements ReportingClient {
const report = await res.json();
const response = Object.freeze({
report,
})
});
return response;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,12 @@ import './index.css';
import App from './app';
import reportWebVitals from './report_web_vitals';
import AppConfig from '../library/initialize';
import { RealApi } from '../library/reporting_client/real_api';
import {RealApi} from '../library/reporting_client/real_api';

const configProps = {
reportingApi: new RealApi({endpoint: new URL('http://localhost:3000')})
}
// eslint-disable-next-line node/no-unsupported-features/node-builtins
reportingApi: new RealApi({endpoint: new URL('http://localhost:3000')}),
};

AppConfig.initialize(configProps);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

/* eslint-disable @typescript-eslint/no-explicit-any */
const reportWebVitals = (onPerfEntry: any) => {
if (onPerfEntry && onPerfEntry instanceof Function) {
import('web-vitals').then(({getCLS, getFID, getFCP, getLCP, getTTFB}) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

import '@testing-library/jest-dom';
import '@testing-library/jest-dom/extend-expect';
import { render, screen } from '@testing-library/react';
import {render, screen} from '@testing-library/react';
import React from 'react';
import App from '../../../main/react/reporting-ui/src/app';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,11 @@
import {
GetReportRequest,
GetReportResponse,
InitApiProps,
ListReportsResponse,
Report,
UniqueReach,
} from '../../../../../main/react/reporting-ui/library/reporting_client/models';
import { ReportingClient } from '../../../../../main/react/reporting-ui/library/reporting_client/reporting_client';
import {ReportingClient} from '../../../../../main/react/reporting-ui/library/reporting_client/reporting_client';

function regenerateTimeData() {
const chartData: UniqueReach[] = [];
Expand Down Expand Up @@ -297,7 +296,7 @@ export class FakeApi implements ReportingClient {
}

listReports(): Promise<ListReportsResponse> {
const response = Object.freeze({reports: this.reports})
const response = Object.freeze({reports: this.reports});
return Promise.resolve(response);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ import ReactDOM from 'react-dom/client';
import '../../../../../main/react/reporting-ui/src/index.css';
import App from '../../../../../main/react/reporting-ui/src/app';
import AppConfig from '../../../../../main/react/reporting-ui/library/initialize';
import { FakeApi } from './fake_api';
import {FakeApi} from './fake_api';

const configProps = {
reportingApi: new FakeApi()
}
reportingApi: new FakeApi(),
};

AppConfig.initialize(configProps);

Expand Down

0 comments on commit 0e99cb9

Please sign in to comment.