Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,10 @@
// Import/Export rules

// General code quality rules
"no-unused-vars": ["error", { "argsIgnorePattern": "^_", "varsIgnorePattern": "^_" }],
"no-unused-vars": [
"error",
{ "argsIgnorePattern": "^_", "varsIgnorePattern": "^_" }
],
"prefer-const": "error",
"no-var": "error",
"no-console": "warn",
Expand Down Expand Up @@ -95,4 +98,4 @@
}
}
]
}
}
1 change: 0 additions & 1 deletion client/src/components/tournament-card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -201,4 +201,3 @@ export default function TournamentCard({
</Card>
);
}

1 change: 0 additions & 1 deletion client/src/components/ui/carousel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -238,4 +238,3 @@ export {
CarouselPrevious,
CarouselNext,
};

4 changes: 3 additions & 1 deletion client/src/components/ui/chart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,9 @@ const ChartContainer = React.forwardRef<
ChartContainer.displayName = "Chart";

const ChartStyle = ({ id, config }: { id: string; config: ChartConfig }) => {
const colorConfig = Object.entries(config).filter(([, itemConfig]) => itemConfig.theme || itemConfig.color);
const colorConfig = Object.entries(config).filter(
([, itemConfig]) => itemConfig.theme || itemConfig.color,
);

if (!colorConfig.length) {
return null;
Expand Down
4 changes: 1 addition & 3 deletions client/src/components/ui/sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -561,9 +561,7 @@ const SidebarMenuButton = React.forwardRef<
return button;
}

const tooltipConfig = typeof tooltip === "string"
? { children: tooltip }
: tooltip;
const tooltipConfig = typeof tooltip === "string" ? { children: tooltip } : tooltip;

const tooltipProps = {
delayDuration: 0,
Expand Down
8 changes: 4 additions & 4 deletions client/src/lib/websocket.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,10 @@ export function useWebSocket(onMessage?: (message: WebSocketMessage) => void) {
const jitter = Math.random() * 1000; // Add some randomness
const finalDelay = delay + jitter;
reconnectAttempts++;
reconnectTimeoutRef.current = window.setTimeout(connect, finalDelay);
} else {
websocketCallbacks.current.forEach((callback) =>
callback({
reconnectTimeoutRef.current = window.setTimeout(connect, finalDelay);
} else {
websocketCallbacks.current.forEach((callback) =>
callback({
type: "error",
error: "Connection failed after maximum attempts",
}),
Expand Down
1 change: 0 additions & 1 deletion client/src/pages/tournament-detail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -362,4 +362,3 @@ export default function TournamentDetailPage() {
</div>
);
}

1 change: 0 additions & 1 deletion client/src/pages/tournaments.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -240,4 +240,3 @@ export default function TournamentsPage() {
</div>
);
}

1 change: 0 additions & 1 deletion server/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -177,4 +177,3 @@ export function telegramAuthMiddleware(req: Request, res: any, next: any) {

next();
}

1 change: 0 additions & 1 deletion server/db.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,3 @@ export async function checkDatabaseConnection(): Promise<boolean> {
return false;
}
}

3 changes: 1 addition & 2 deletions server/errorHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ function getStatusCode(error: AppError): number {
* Extract user context from request for logging
*/
function extractUserContext(req: Request): Record<string, unknown> {
const { telegramUser } = (req as any);
const { telegramUser } = req as any;
return {
userId: telegramUser?.id,
username: telegramUser?.username,
Expand Down Expand Up @@ -307,4 +307,3 @@ export default {
createSecurityError,
createDatabaseError,
};

11 changes: 6 additions & 5 deletions server/logger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,16 @@ const logger = winston.createLogger({
),
transports: [
new winston.transports.Console({
format: winston.format.combine(
winston.format.colorize(),
winston.format.simple(),
),
format: winston.format.combine(winston.format.colorize(), winston.format.simple()),
}),
],
});

export function logRequest(req: Request, message: string, level: "info" | "warn" | "error" = "info") {
export function logRequest(
req: Request,
message: string,
level: "info" | "warn" | "error" = "info",
) {
const userContext = {
ip: req.ip,
userAgent: req.get("User-Agent"),
Expand Down
1 change: 0 additions & 1 deletion server/middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -239,4 +239,3 @@ export const notFound = (req: Request, res: Response) => {
code: "NOT_FOUND",
});
};

1 change: 0 additions & 1 deletion server/rateLimiter.simple.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,3 @@ export function createSimpleRateLimit() {
// Placeholder for simple rate limiting implementation
return generalLimiter;
}

9 changes: 3 additions & 6 deletions server/rateLimiter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ function shouldSkipRateLimit(): boolean {

// Safe key generator for IPv6 compatibility
function safeKeyGenerator(req: Request, prefix = ""): string {
const { telegramUser } = (req as any);
const { telegramUser } = req as any;
if (telegramUser?.id) {
return `${prefix}${telegramUser.id.toString()}`;
}
Expand All @@ -34,7 +34,7 @@ export const generalLimiter = rateLimit({
legacyHeaders: false, // Disable the `X-RateLimit-*` headers
keyGenerator: (req: Request) => {
// Use Telegram user ID if available, otherwise fall back to IP
const { telegramUser } = (req as any);
const { telegramUser } = req as any;
if (telegramUser?.id) {
return telegramUser.id.toString();
}
Expand Down Expand Up @@ -136,9 +136,7 @@ export function createCustomLimiter(options: {
},
standardHeaders: true,
legacyHeaders: false,
keyGenerator:
options.keyGenerator ||
((req: Request) => safeKeyGenerator(req)),
keyGenerator: options.keyGenerator || ((req: Request) => safeKeyGenerator(req)),
skip: () => {
return shouldSkipRateLimit();
},
Expand Down Expand Up @@ -174,4 +172,3 @@ export default {
search: searchLimiter,
createCustom: createCustomLimiter,
};

1 change: 0 additions & 1 deletion server/routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -299,4 +299,3 @@ declare global {
}
}
}

1 change: 0 additions & 1 deletion server/validation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -429,4 +429,3 @@ export default {
secureString,
sanitizeString,
};

Loading