diff --git a/.oxlintrc.json b/.oxlintrc.json index 086ee7f601..13ad20514d 100644 --- a/.oxlintrc.json +++ b/.oxlintrc.json @@ -91,6 +91,7 @@ "import/no-named-as-default": "off", "import/no-named-as-default-member": "off", "typescript/consistent-type-imports": "error", + "typescript/restrict-template-expressions": "error", "typescript/no-floating-promises": "error", "no-unused-vars": [ "error", diff --git a/app/components/HoverPreview/Components.tsx b/app/components/HoverPreview/Components.tsx index 426c10f685..3701d0271a 100644 --- a/app/components/HoverPreview/Components.tsx +++ b/app/components/HoverPreview/Components.tsx @@ -88,6 +88,7 @@ export const CardContent = styled.div` // &:after — gradient mask for overflow text export const Card = styled.div<{ fadeOut?: boolean; $borderRadius?: string }>` + ${sharedVars} backdrop-filter: blur(10px); background: ${s("menuBackground")}; padding: 16px; @@ -112,7 +113,6 @@ export const Card = styled.div<{ fadeOut?: boolean; $borderRadius?: string }>` ${(props) => props.fadeOut !== false ? `&:after { - ${sharedVars} content: ""; display: block; position: absolute; diff --git a/app/components/Menu/transformer.tsx b/app/components/Menu/transformer.tsx index d31bd1cef3..0ede28d900 100644 --- a/app/components/Menu/transformer.tsx +++ b/app/components/Menu/transformer.tsx @@ -42,7 +42,7 @@ export function toMenuItems(items: MenuItem[]) { case "button": return ( + @@ -171,7 +171,7 @@ export function toMobileMenuItems( case "button": return ( { @@ -192,7 +192,7 @@ export function toMobileMenuItems( case "route": return ( { openSubmenu(item.title as string); @@ -256,7 +256,7 @@ export function toMobileMenuItems( } return ( -
+
{item.title} {groupItems}
diff --git a/app/components/PageTitle.tsx b/app/components/PageTitle.tsx index 6092c1b1f7..9de1cf5c65 100644 --- a/app/components/PageTitle.tsx +++ b/app/components/PageTitle.tsx @@ -1,12 +1,11 @@ import { observer } from "mobx-react"; -import * as React from "react"; import { Helmet } from "react-helmet-async"; import env from "~/env"; import useStores from "~/hooks/useStores"; import { useTeamContext } from "./TeamContext"; type Props = { - title: React.ReactNode; + title: string; favicon?: string; }; diff --git a/app/components/Scene.tsx b/app/components/Scene.tsx index d01ce177ab..4f1049a5a4 100644 --- a/app/components/Scene.tsx +++ b/app/components/Scene.tsx @@ -34,7 +34,7 @@ const Scene: React.FC = ({ wide, }: Props) => ( - +
`${name}:${permission}` + ([name, permission]) => `${name}:${String(permission)}` ); await sequelize.transaction(async (transaction) => { diff --git a/plugins/github/server/api/github.ts b/plugins/github/server/api/github.ts index 3756b3d2ee..928a892e35 100644 --- a/plugins/github/server/api/github.ts +++ b/plugins/github/server/api/github.ts @@ -64,7 +64,7 @@ router.get( } const scopes = Object.entries(installation.permissions).map( - ([name, permission]) => `${name}:${permission}` + ([name, permission]) => `${name}:${String(permission)}` ); const authentication = await IntegrationAuthentication.create( diff --git a/server/logging/Logger.ts b/server/logging/Logger.ts index b4b281f1a3..e0843f9a99 100644 --- a/server/logging/Logger.ts +++ b/server/logging/Logger.ts @@ -60,8 +60,8 @@ class Logger { winston.format.printf( ({ message, level, label, ...extra }) => `${level}: ${ - label ? styleText("bold", `[${label}] `) : "" - }${message} ${isEmpty(extra) ? "" : JSON.stringify(extra)}` + label ? styleText("bold", `[${String(label)}] `) : "" + }${String(message)} ${isEmpty(extra) ? "" : JSON.stringify(extra)}` ) ), }) diff --git a/server/middlewares/rateLimiter.ts b/server/middlewares/rateLimiter.ts index 9dc545c962..9d2eae4836 100644 --- a/server/middlewares/rateLimiter.ts +++ b/server/middlewares/rateLimiter.ts @@ -75,7 +75,7 @@ export function defaultRateLimiter() { ctx.set("RateLimit-Remaining", `${rateLimiterRes.remainingPoints}`); ctx.set( "RateLimit-Reset", - `${new Date(Date.now() + rateLimiterRes.msBeforeNext)}` + new Date(Date.now() + rateLimiterRes.msBeforeNext).toString() ); Metrics.increment("rate_limit.exceeded", { diff --git a/server/models/decorators/CounterCache.ts b/server/models/decorators/CounterCache.ts index 825d0bf9a0..4aa39b27d6 100644 --- a/server/models/decorators/CounterCache.ts +++ b/server/models/decorators/CounterCache.ts @@ -36,9 +36,9 @@ export function CounterCache< setImmediate(() => { const recalculateCache = (offset: number) => async (model: InstanceType) => { - const cacheKey = `${cacheKeyPrefix}:${ + const cacheKey = `${cacheKeyPrefix}:${String( model[options.foreignKey as keyof typeof model] - }`; + )}`; const count = await modelClass.count({ where: { diff --git a/server/queues/queue.ts b/server/queues/queue.ts index 164d1d0ff6..442ae6d5fe 100644 --- a/server/queues/queue.ts +++ b/server/queues/queue.ts @@ -31,7 +31,7 @@ export function createQueue( }); default: - throw new Error(`Unexpected connection type: ${type}`); + throw new Error(`Unexpected connection type: ${String(type)}`); } }, defaultJobOptions: { diff --git a/server/storage/database.ts b/server/storage/database.ts index 41c5bc5d1d..a6b078f197 100644 --- a/server/storage/database.ts +++ b/server/storage/database.ts @@ -214,15 +214,15 @@ export function createMigrationRunner( Logger.info( "database", params.event === "migrating" - ? `Migrating ${params.name}…` - : `Migrated ${params.name} in ${params.durationSeconds}s` + ? `Migrating ${String(params.name)}…` + : `Migrated ${String(params.name)} in ${String(params.durationSeconds)}s` ), debug: (params) => Logger.debug( "database", params.event === "migrating" - ? `Migrating ${params.name}…` - : `Migrated ${params.name} in ${params.durationSeconds}s` + ? `Migrating ${String(params.name)}…` + : `Migrated ${String(params.name)} in ${String(params.durationSeconds)}s` ), }, }); diff --git a/shared/utils/rfc6902/patch.ts b/shared/utils/rfc6902/patch.ts index d3096dd09c..22c81e56d4 100644 --- a/shared/utils/rfc6902/patch.ts +++ b/shared/utils/rfc6902/patch.ts @@ -23,7 +23,7 @@ export class TestError extends Error { public actual: unknown, public expected: unknown ) { - super(`Test failed: ${actual} != ${expected}`); + super(`Test failed: ${String(actual)} != ${String(expected)}`); this.name = "TestError"; } }