Skip to content

Commit f48efb8

Browse files
authored
ref: Use esm imports with localforage and add esModuleInterop (#3403)
1 parent 2bb98c1 commit f48efb8

File tree

4 files changed

+4
-5
lines changed

4 files changed

+4
-5
lines changed

packages/integrations/src/offline.ts

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
22
import { Event, EventProcessor, Hub, Integration } from '@sentry/types';
33
import { getGlobalObject, logger, normalize, uuid4 } from '@sentry/utils';
4-
import * as localForageType from 'localforage';
4+
import localForage from 'localforage';
55

6-
// eslint-disable-next-line @typescript-eslint/no-var-requires
7-
const localForage = require('localforage');
86
/**
97
* cache offline errors and send when connected
108
*/
@@ -38,7 +36,7 @@ export class Offline implements Integration {
3836
/**
3937
* event cache
4038
*/
41-
public offlineEventStore: typeof localForageType; // type imported from localforage
39+
public offlineEventStore: typeof localForage;
4240

4341
/**
4442
* @inheritDoc

packages/integrations/tsconfig.build.json

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"extends": "../../tsconfig.json",
33
"compilerOptions": {
44
"declarationMap": false,
5+
"esModuleInterop": true,
56
"baseUrl": ".",
67
"outDir": "dist",
78
"types": ["node"]

packages/integrations/tsconfig.esm.json

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"extends": "../../tsconfig.esm.json",
33
"compilerOptions": {
44
"declarationMap": false,
5+
"esModuleInterop": true,
56
"baseUrl": ".",
67
"outDir": "esm",
78
"types": ["node"]

packages/integrations/tsconfig.json

-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
"include": ["src/**/*.ts", "test/**/*.ts"],
44
"exclude": ["dist"],
55
"compilerOptions": {
6-
"esModuleInterop": true,
76
"declarationMap": false,
87
"rootDir": ".",
98
"types": ["node", "jest"]

0 commit comments

Comments
 (0)