refactor: migrate to eslint flat config and format codebase with prettier

- Remove legacy .eslintrc.cjs and .eslintignore
- Add eslint.config.js with flat config, security rules (no-eval, no-implied-eval, no-new-func, no-script-url)
- Add .prettierrc and .prettierignore
- Format entire codebase with prettier
This commit is contained in:
c0mrade
2026-01-27 17:37:31 +03:00
parent 111ccc4e7a
commit bc90ba3779
133 changed files with 19972 additions and 15523 deletions

137
src/vite-env.d.ts vendored
View File

@@ -1,91 +1,94 @@
/// <reference types="vite/client" />
interface ImportMetaEnv {
readonly VITE_API_URL: string
readonly VITE_TELEGRAM_BOT_USERNAME?: string
readonly VITE_APP_NAME?: string
readonly VITE_APP_LOGO?: string
readonly VITE_API_URL: string;
readonly VITE_TELEGRAM_BOT_USERNAME?: string;
readonly VITE_APP_NAME?: string;
readonly VITE_APP_LOGO?: string;
}
interface ImportMeta {
readonly env: ImportMetaEnv
readonly env: ImportMetaEnv;
}
// Telegram WebApp types
interface TelegramWebApp {
initData: string
initData: string;
initDataUnsafe: {
user?: {
id: number
first_name: string
last_name?: string
username?: string
language_code?: string
}
auth_date: number
hash: string
}
version: string
platform: string
isExpanded: boolean
isClosingConfirmationEnabled: boolean
isVerticalSwipesEnabled: boolean
isFullscreen: boolean
isOrientationLocked: boolean
safeAreaInset: { top: number; bottom: number; left: number; right: number }
contentSafeAreaInset: { top: number; bottom: number; left: number; right: number }
ready: () => void
expand: () => void
close: () => void
openLink: (url: string, options?: { try_instant_view?: boolean; try_browser?: boolean }) => void
openTelegramLink: (url: string) => void
openInvoice: (url: string, callback?: (status: 'paid' | 'cancelled' | 'failed' | 'pending') => void) => void
id: number;
first_name: string;
last_name?: string;
username?: string;
language_code?: string;
};
auth_date: number;
hash: string;
};
version: string;
platform: string;
isExpanded: boolean;
isClosingConfirmationEnabled: boolean;
isVerticalSwipesEnabled: boolean;
isFullscreen: boolean;
isOrientationLocked: boolean;
safeAreaInset: { top: number; bottom: number; left: number; right: number };
contentSafeAreaInset: { top: number; bottom: number; left: number; right: number };
ready: () => void;
expand: () => void;
close: () => void;
openLink: (url: string, options?: { try_instant_view?: boolean; try_browser?: boolean }) => void;
openTelegramLink: (url: string) => void;
openInvoice: (
url: string,
callback?: (status: 'paid' | 'cancelled' | 'failed' | 'pending') => void,
) => void;
// Fullscreen API (Bot API 8.0+)
requestFullscreen: () => void
exitFullscreen: () => void
lockOrientation: () => void
unlockOrientation: () => void
requestFullscreen: () => void;
exitFullscreen: () => void;
lockOrientation: () => void;
unlockOrientation: () => void;
// Vertical swipes control
disableVerticalSwipes: () => void
enableVerticalSwipes: () => void
disableVerticalSwipes: () => void;
enableVerticalSwipes: () => void;
// Closing confirmation
enableClosingConfirmation: () => void
disableClosingConfirmation: () => void
enableClosingConfirmation: () => void;
disableClosingConfirmation: () => void;
// Event handlers
onEvent: (eventType: string, callback: () => void) => void
offEvent: (eventType: string, callback: () => void) => void
onEvent: (eventType: string, callback: () => void) => void;
offEvent: (eventType: string, callback: () => void) => void;
MainButton: {
text: string
color: string
textColor: string
isVisible: boolean
isActive: boolean
show: () => void
hide: () => void
enable: () => void
disable: () => void
onClick: (callback: () => void) => void
offClick: (callback: () => void) => void
}
text: string;
color: string;
textColor: string;
isVisible: boolean;
isActive: boolean;
show: () => void;
hide: () => void;
enable: () => void;
disable: () => void;
onClick: (callback: () => void) => void;
offClick: (callback: () => void) => void;
};
BackButton: {
isVisible: boolean
show: () => void
hide: () => void
onClick: (callback: () => void) => void
offClick: (callback: () => void) => void
}
isVisible: boolean;
show: () => void;
hide: () => void;
onClick: (callback: () => void) => void;
offClick: (callback: () => void) => void;
};
themeParams: {
bg_color?: string
text_color?: string
hint_color?: string
link_color?: string
button_color?: string
button_text_color?: string
}
bg_color?: string;
text_color?: string;
hint_color?: string;
link_color?: string;
button_color?: string;
button_text_color?: string;
};
}
interface Window {
Telegram?: {
WebApp: TelegramWebApp
}
WebApp: TelegramWebApp;
};
}