mirror of
https://github.com/chillpadclub/bedolaga-cabinet.git
synced 2026-07-28 17:43:47 +00:00
- telegram-webview-guards.grit: исключение сузил с подстроки "platform" до якорного "src/platform/" — прежний eslint-override действовал ровно на src/platform/**, а bare-substring щадил бы любой файл с "platform" в имени (проверено: src/platform всё ещё exempt, гвард срабатывает в обычных файлах) - biome.json: вернул исключения *.min.js/*.min.css из .prettierignore - lint-staged: вернул форматирование *.css в pre-commit (biome format --write) — иначе CI-формат-чек ловил бы css, который хук не трогал - lint.yml: метка шага "Run ESLint" → "Run linter" (выполняет biome)
36 lines
1.8 KiB
Plaintext
36 lines
1.8 KiB
Plaintext
language js
|
|
|
|
// Cross-platform guard (was eslint no-restricted-properties): these browser
|
|
// APIs misbehave inside the Telegram WebView. Route them through the platform
|
|
// abstraction instead. The platform adapters and the clipboard util (the
|
|
// canonical implementations) are exempted by the filename conditions below.
|
|
|
|
file(name=$name, body=$body) where {
|
|
// Exempt the canonical implementations only, matching the old eslint override
|
|
// scope (`src/platform/**`, `src/utils/clipboard.ts`) — an anchored path
|
|
// fragment, not a bare "platform" substring that would also spare any
|
|
// unrelated file with "platform" in its name.
|
|
$name <: not includes "src/platform/",
|
|
$name <: not includes or {
|
|
"utils/clipboard.ts",
|
|
"utils/clipboard.js"
|
|
},
|
|
$body <: contains bubble or {
|
|
`window.confirm` as $use where {
|
|
register_diagnostic(span=$use, message="Use useNativeDialog().confirm — window.confirm is silently ignored in the Telegram WebView.", severity="error")
|
|
},
|
|
`window.alert` as $use where {
|
|
register_diagnostic(span=$use, message="Use useNativeDialog().alert — window.alert is silently ignored in the Telegram WebView.", severity="error")
|
|
},
|
|
`window.open` as $use where {
|
|
register_diagnostic(span=$use, message="Use usePlatform().openLink / openTelegramLink — window.open is intercepted by the Telegram WebView.", severity="error")
|
|
},
|
|
`window.prompt` as $use where {
|
|
register_diagnostic(span=$use, message="Use usePrompt() (PromptDialogHost) — window.prompt is not supported in the Telegram WebView.", severity="error")
|
|
},
|
|
`navigator.clipboard` as $use where {
|
|
register_diagnostic(span=$use, message="Use copyToClipboard from @/utils/clipboard — it falls back to execCommand when the Clipboard API is unavailable (Telegram WebView).", severity="error")
|
|
}
|
|
}
|
|
}
|