Skip to content

Commit

Permalink
BC-7807 Adjust tsconfig (#12)
Browse files Browse the repository at this point in the history
  • Loading branch information
bischofmax authored Aug 30, 2024
1 parent 7cd2d4d commit 3bd6e5a
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 9 deletions.
4 changes: 2 additions & 2 deletions nest-cli.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"projects": {
"server": {
"type": "application",
"root": "apps/server",
"root": ".",
"entryFile": "apps/tldraw-server.js",
"sourceRoot": "src",
"compilerOptions": {
Expand All @@ -17,7 +17,7 @@
},
"worker": {
"type": "application",
"root": "apps/worker",
"root": ".",
"entryFile": "apps/tldraw-worker.js",
"sourceRoot": "src",
"compilerOptions": {
Expand Down
3 changes: 2 additions & 1 deletion src/infra/metrics/metrics.service.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Injectable } from '@nestjs/common';
// @ts-expect-error - @y/redis is only having jsdoc types
import { Api } from '@y/redis';
import { Gauge, Histogram, register } from 'prom-client';

Expand All @@ -25,7 +26,7 @@ const methodDurationHistogram = new Histogram({

const originalGetDoc = Api.prototype.getDoc;

Api.prototype.getDoc = async function (room, docId) {
Api.prototype.getDoc = async function (room: string, docId: string) {
const end = methodDurationHistogram.startTimer();

const result = await originalGetDoc.call(this, room, docId);
Expand Down
2 changes: 2 additions & 0 deletions src/infra/storage/storage.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export class StorageService {

if (s3Endpoint) {
this.logger.log('using s3 store');
// @ts-expect-error - @y/redis is only having jsdoc types
const { createS3Storage } = await import('@y/redis/storage/s3');

store = createS3Storage(bucketName);
Expand All @@ -28,6 +29,7 @@ export class StorageService {
} catch (e) {}
} else {
this.logger.log('ATTENTION! using in-memory store');
// @ts-expect-error - @y/redis is only having jsdoc types
const { createMemoryStorage } = await import('@y/redis/storage/memory');
store = createMemoryStorage();
}
Expand Down
1 change: 1 addition & 0 deletions src/modules/server/api/websocket.gateway.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { Inject, Injectable, OnModuleDestroy, OnModuleInit } from '@nestjs/common';
import { ConfigService } from '@nestjs/config';
// @ts-expect-error - @y/redis is only having jsdoc types
import { registerYWebsocketServer } from '@y/redis';
import { TemplatedApp } from 'uws';
import { AuthorizationService } from '../../../infra/authorization/authorization.service.js';
Expand Down
1 change: 1 addition & 0 deletions src/modules/worker/worker.service.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { Injectable, OnModuleInit } from '@nestjs/common';
import { ConfigService } from '@nestjs/config';
// @ts-expect-error - @y/redis is only having jsdoc types
import { createWorker } from '@y/redis';
import { RedisService } from '../../infra/redis/redis.service.js';
import { StorageService } from '../../infra/storage/storage.service.js';
Expand Down
14 changes: 8 additions & 6 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,14 @@
"allowSyntheticDefaultImports": true,
"sourceMap": true,
"outDir": "./dist",
"baseUrl": "./",
"baseUrl": "./src",
"incremental": true,
"strictNullChecks": false,
"noImplicitAny": false,
"strictBindCallApply": false,
"forceConsistentCasingInFileNames": false,
"noFallthroughCasesInSwitch": false,
"strictNullChecks": true,
"noImplicitAny": true,
"strictBindCallApply": true,
"forceConsistentCasingInFileNames": true,
"noFallthroughCasesInSwitch": true,
"strictFunctionTypes": true,
"strictPropertyInitialization": true,
}
}

0 comments on commit 3bd6e5a

Please sign in to comment.