diff --git a/.config/tsconfig.base.json b/.config/tsconfig.base.json index 8183730d..84e14628 100644 --- a/.config/tsconfig.base.json +++ b/.config/tsconfig.base.json @@ -4,21 +4,29 @@ ], "compilerOptions": { "noFallthroughCasesInSwitch": true, + "noImplicitAny": true, "noImplicitOverride": true, "noImplicitReturns": true, + "noImplicitThis": true, "noPropertyAccessFromIndexSignature": true, "noUnusedLocals": true, "noUnusedParameters": true, "strict": true, - "moduleResolution": "node", + "module": "CommonJS", + "moduleResolution": "Node", "resolveJsonModule": true, - "strictNullChecks": true, + "declaration": true, + "declarationMap": true, + "sourceMap": true, "allowJs": true, "checkJs": true, - "allowSyntheticDefaultImports": true, + "esModuleInterop": true, "forceConsistentCasingInFileNames": true, + "isolatedModules": true, "jsx": "react", "target": "ESNext", - "skipLibCheck": true + "pretty": true, + "skipLibCheck": true, + "skipDefaultLibCheck": true } } diff --git a/packages/api/package.json b/packages/api/package.json index 9d252309..3f6f7f87 100644 --- a/packages/api/package.json +++ b/packages/api/package.json @@ -34,6 +34,7 @@ "@types/jest": "29.5.4", "eslint": "^8.54.0", "jest": "29.5.0", + "prettier": "^2.8.8", "react-native-builder-bob": "0.20.0", "ts-jest": "29.1.1", "typescript": "^5.3.0" diff --git a/packages/api/src/index.ts b/packages/api/src/index.ts index 55a35205..1c1405b8 100644 --- a/packages/api/src/index.ts +++ b/packages/api/src/index.ts @@ -1,3 +1,3 @@ -export { AsyncStorage } from "./AsyncStorage"; +export type { AsyncStorage } from "./AsyncStorage"; export type { StorageExtension } from "./StorageExtension"; export type { StorageKeys, StorageModel } from "./StorageModel"; diff --git a/packages/api/tsconfig.json b/packages/api/tsconfig.json index 007485ac..0d50e36e 100644 --- a/packages/api/tsconfig.json +++ b/packages/api/tsconfig.json @@ -1,7 +1,7 @@ { - "extends": "../../.config/tsconfig.base.json", - "include": ["./src/**/*", "./example/**/*"], - "compilerOptions": { - "types": ["jest"] - } + "extends": "../../.config/tsconfig.base.json", + "compilerOptions": { + "types": ["jest"] + }, + "include": ["example", "src"] } diff --git a/packages/default-storage/src/helpers.ts b/packages/default-storage/src/helpers.ts index 5bea188a..60fbffed 100644 --- a/packages/default-storage/src/helpers.ts +++ b/packages/default-storage/src/helpers.ts @@ -53,7 +53,7 @@ export function convertError(error?: ErrorLike): Error | null { return null; } - const out = new Error(error.message); + const out = new Error(error.message) as Error & ErrorLike; out["key"] = error.key; return out; } diff --git a/packages/default-storage/src/types.ts b/packages/default-storage/src/types.ts index 06248d09..f000f8cb 100644 --- a/packages/default-storage/src/types.ts +++ b/packages/default-storage/src/types.ts @@ -1,6 +1,6 @@ export type ErrorLike = { message: string; - key: string; + key?: string; }; export type Callback = (error?: Error | null) => void; diff --git a/packages/default-storage/tsconfig.json b/packages/default-storage/tsconfig.json index e2d92b76..c0496615 100644 --- a/packages/default-storage/tsconfig.json +++ b/packages/default-storage/tsconfig.json @@ -3,12 +3,12 @@ "compilerOptions": { "noEmit": true, "types": [ - "node", - "mocha", "@wdio/globals/types", "@wdio/mocha-framework", - "expect-webdriverio" + "expect-webdriverio", + "mocha", + "node" ] }, - "include": ["example/**/*.ts", "example/**/*.tsx"] + "include": ["example/**/*.ts", "example/**/*.tsx", "src"] } diff --git a/yarn.lock b/yarn.lock index 76b98f69..d9b58d67 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4159,6 +4159,7 @@ __metadata: "@types/jest": 29.5.4 eslint: ^8.54.0 jest: 29.5.0 + prettier: ^2.8.8 react-native-builder-bob: 0.20.0 ts-jest: 29.1.1 typescript: ^5.3.0