Skip to content
Closed
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
41 changes: 40 additions & 1 deletion .github/workflows/lint-untyped-from.yml
Original file line number Diff line number Diff line change
@@ -1 +1,40 @@
IyBMaW50OiBjcnV6YSBjaGFtYWRhcyB1bnR5cGVkRnJvbSgiWCIpIG5vIHNyYy8gY29udHJhIG8gc2NoZW1hIGdlcmFkbwojIGVtIHNyYy9pbnRlZ3JhdGlvbnMvc3VwYWJhc2UvdHlwZXMudHMuIEV4aXN0ZSBwcmEgZXZpdGFyIGEgcmVncmVzc8OjbwojIGRvIGNvbGFwc28gZGUgMjAyNi0wNS0yNCwgcXVhbmRvIHRhYmVsYXMgaW5leGlzdGVudGVzIG5vIGJhbmNvIGVyYW0KIyBjaGFtYWRhcyBlIHF1ZWJyYXZhbSBmZWF0dXJlcyBlbSBzaWzDqm5jaW8gKGNhdGNoIHsgcmV0dXJuIFtdOyB9KS4KIwojIEVzdGFkbzogYWR2aXNvcnkgKGNvbnRpbnVlLW9uLWVycm9yKSBhdMOpIHR5cGVzLnRzIHNlciByZWdlbmVyYWRvCiMgYXDDs3MgUFJzICMzMTUgZSAjMzE3LiBRdWFuZG8gbyBidWlsZCB2b2x0YXIgYSBwYXNzYXIsIHJlbW92YSBvCiMgY29udGludWUtb24tZXJyb3IgcHJhIHRvcm5hciBlc3RlIGNoZWNrIHJlcXVpcmVkLgoKbmFtZTogTGludCB1bnR5cGVkRnJvbQoKb246CiAgcHVsbF9yZXF1ZXN0OgogICAgcGF0aHM6CiAgICAgIC0gJ3NyYy8qKi8qLnRzJwogICAgICAtICdzcmMvKiovKi50c3gnCiAgICAgIC0gJ3NjcmlwdHMvbGludC11bnR5cGVkLWZyb20uc2gnCiAgICAgIC0gJy5naXRodWIvd29ya2Zsb3dzL2xpbnQtdW50eXBlZC1mcm9tLnltbCcKICBwdXNoOgogICAgYnJhbmNoZXM6IFttYWluXQogIHdvcmtmbG93X2Rpc3BhdGNoOgoKcGVybWlzc2lvbnM6CiAgY29udGVudHM6IHJlYWQKCmNvbmN1cnJlbmN5OgogIGdyb3VwOiBsaW50LXVudHlwZWQtZnJvbS0ke3sgZ2l0aHViLnJlZiB9fQogIGNhbmNlbC1pbi1wcm9ncmVzczogdHJ1ZQoKam9iczoKICBsaW50OgogICAgbmFtZTogQ3J1emEgdW50eXBlZEZyb20gw5cgdHlwZXMudHMKICAgIHJ1bnMtb246IHVidW50dS1sYXRlc3QKICAgIHRpbWVvdXQtbWludXRlczogMgogICAgIyBUT0RPKEBhZG0wMS1kZWJ1Zyk6IHJlbW92ZXIgY29udGludWUtb24tZXJyb3IgYXDDs3MgcmVnZW5lcmFyCiAgICAjIHNyYy9pbnRlZ3JhdGlvbnMvc3VwYWJhc2UvdHlwZXMudHMgKHN1cGFiYXNlIGdlbiB0eXBlcyB0eXBlc2NyaXB0KQogICAgIyBwYXJhIHF1ZSBvIGxpbnQgcGFzc2UgbmF0dXJhbG1lbnRlLiBBIHBhcnRpciBkYcOtLCBxdWFscXVlcgogICAgIyB1bnR5cGVkRnJvbSgpIGFwb250YW5kbyBwYXJhIHRhYmVsYSBmYWx0YW50ZSBibG9xdWVpYSBvIFBSLgogICAgY29udGludWUtb24tZXJyb3I6IHRydWUKICAgIHN0ZXBzOgogICAgICAtIG5hbWU6IENoZWNrb3V0CiAgICAgICAgdXNlczogYWN0aW9ucy9jaGVja291dEB2NQoKICAgICAgLSBuYW1lOiBSdW4gbGludAogICAgICAgIHJ1bjogYmFzaCBzY3JpcHRzL2xpbnQtdW50eXBlZC1mcm9tLnNoCg==
# Lint: cruza chamadas untypedFrom("X") no src/ contra o schema gerado
# em src/integrations/supabase/types.ts. Existe pra evitar a regressão
# do colapso de 2026-05-24, quando tabelas inexistentes no banco eram
# chamadas e quebravam features em silêncio (catch { return []; }).
#
# Estado: required. types.ts foi regenerado a partir do schema ao vivo,
# então o lint passa naturalmente. Qualquer untypedFrom() apontando para
# tabela faltante no schema gerado bloqueia o PR.

name: Lint untypedFrom

on:
pull_request:
paths:
- 'src/**/*.ts'
- 'src/**/*.tsx'
- 'scripts/lint-untyped-from.sh'
- '.github/workflows/lint-untyped-from.yml'
push:
branches: [main]
workflow_dispatch:

permissions:
contents: read

concurrency:
group: lint-untyped-from-${{ github.ref }}
cancel-in-progress: true

jobs:
lint:
name: Cruza untypedFrom × types.ts
runs-on: ubuntu-latest
timeout-minutes: 2
steps:
- name: Checkout
uses: actions/checkout@v5

- name: Run lint
run: bash scripts/lint-untyped-from.sh
119 changes: 90 additions & 29 deletions .tsc-baseline.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,41 @@
{
"generatedAt": "2026-05-24T19:40:05.304Z",
"totalErrors": 508,
"generatedAt": "2026-05-25T00:45:16.132Z",
"totalErrors": 545,
"counts": {
"src/components/admin/SellerDiscountLimitsPanel.tsx": {
"TS2322": 1,
"TS2345": 1
},
"src/components/admin/products/BulkImportDialog.tsx": {
"TS2322": 1
},
"src/components/admin/products/ProductFormFullscreen.tsx": {
"TS2352": 1
},
"src/components/admin/security/ActiveIpsList.tsx": {
"TS2345": 1
},
"src/components/admin/security/RecentAuditTable.tsx": {
"TS2538": 1
},
"src/components/admin/security/keys/audit/useMcpAuditFeed.ts": {
"TS2345": 1
},
"src/components/admin/security/keys/audit/useStepUpAttempts.ts": {
"TS2538": 1
},
"src/components/admin/security/keys/useMcpKeys.ts": {
"TS2345": 1
},
"src/components/admin/security/role-migration/RoleMigrationPanel.tsx": {
"TS2345": 2
},
"src/components/admin/users/RoleAuditLogPanel.tsx": {
"TS2345": 1
},
"src/components/admin/users/useUserManagement.ts": {
"TS2322": 1
},
"src/components/catalog/CatalogContent.tsx": {
"TS2322": 1,
"TS2741": 1
Expand Down Expand Up @@ -38,6 +66,16 @@
"TS2339": 1,
"TS7006": 5
},
"src/components/dashboard/MyClientsWidget.tsx": {
"TS2345": 1
},
"src/components/dashboard/MyRecentQuotesWidget.tsx": {
"TS2538": 1,
"TS2769": 1
},
"src/components/dashboard/RecentKitsWidget.tsx": {
"TS2345": 1
},
"src/components/dev/BridgeMetricsOverlay.tsx": {
"TS4104": 1
},
Expand All @@ -55,17 +93,19 @@
"TS2322": 1
},
"src/components/expert/chat/useExpertChat.ts": {
"TS1345": 2
"TS1345": 2,
"TS2322": 1
},
"src/components/favorites/FavoritesTrashView.tsx": {
"TS2322": 1
"TS2322": 1,
"TS2345": 1
},
"src/components/filters/ExternalCategoryFilter.tsx": {
"TS2345": 1
},
"src/components/filters/FilterPresets.ts": {
"TS2322": 1,
"TS2345": 1
"TS2322": 9,
"TS2345": 2
},
"src/components/filters/filter-panel/useFilterPanelState.ts": {
"TS2339": 2
Expand Down Expand Up @@ -257,7 +297,7 @@
"TS2339": 1
},
"src/components/search/useGlobalSearch.ts": {
"TS2322": 2,
"TS2322": 3,
"TS2339": 6,
"TS2345": 3,
"TS2352": 6,
Expand All @@ -266,6 +306,9 @@
"src/components/security/MfaEnrollmentDialog.tsx": {
"TS2367": 1
},
"src/components/security/SecurityDashboard.tsx": {
"TS2345": 1
},
"src/components/simulator/MockupPreview.tsx": {
"TS2339": 13,
"TS2551": 3
Expand Down Expand Up @@ -374,6 +417,14 @@
"src/hooks/intelligence/useMagicUpGeneration.ts": {
"TS2322": 1
},
"src/hooks/intelligence/useSalesHistory.ts": {
"TS2322": 4,
"TS2538": 1
},
"src/hooks/intelligence/useSalesHistoryMacro.ts": {
"TS2322": 2,
"TS2538": 1
},
"src/hooks/intelligence/useScheduledReports.ts": {
"TS2322": 1
},
Expand All @@ -389,16 +440,15 @@
"src/hooks/kit-builder/useKitBuilderTransformers.ts": {
"TS2345": 4
},
"src/hooks/kit-builder/useKitCollaboration.ts": {
"TS2322": 1
},
"src/hooks/kit-builder/useKitTemplates.ts": {
"TS2322": 3
},
"src/hooks/mockup/mockupGenerationService.ts": {
"TS2345": 1
},
"src/hooks/mockup/useMockupDraft.ts": {
"TS2345": 2,
"TS2769": 2
},
"src/hooks/mockup/useMockupGenerator.ts": {
"TS2339": 2,
"TS2345": 1
Expand All @@ -416,18 +466,12 @@
"src/hooks/products/useColorEnrichment.ts": {
"TS2322": 1
},
"src/hooks/products/useColorSystem.ts": {
"TS2345": 1,
"TS2352": 1,
"TS2769": 1
},
"src/hooks/products/useNoveltiesSelectionMode.ts": {
"TS2352": 1
},
"src/hooks/products/useProductInsights.ts": {
"TS18047": 1,
"TS2345": 1,
"TS2531": 1
"TS2322": 1,
"TS2345": 1
},
"src/hooks/products/useProductIntelligenceBadges.ts": {
"TS2339": 7,
Expand All @@ -442,9 +486,15 @@
"src/hooks/products/useSupplierFiscalData.ts": {
"TS2352": 2
},
"src/hooks/quotes/quoteHelpers.ts": {
"TS2322": 3
},
"src/hooks/quotes/useAutoSaveQuote.ts": {
"TS2339": 2
},
"src/hooks/quotes/useDiscountApproval.ts": {
"TS2322": 1
},
"src/hooks/quotes/useQuoteComments.ts": {
"TS2322": 3,
"TS2353": 1
Expand All @@ -455,6 +505,12 @@
"src/hooks/quotes/useQuoteHistory.ts": {
"TS2345": 1
},
"src/hooks/quotes/useQuoteTemplates.ts": {
"TS2345": 1
},
"src/hooks/quotes/useQuoteVersions.ts": {
"TS2322": 1
},
"src/hooks/simulation/simulationClipboard.ts": {
"TS2339": 26,
"TS2551": 2
Expand All @@ -475,10 +531,9 @@
},
"src/hooks/simulation/useSimulation.ts": {
"TS2339": 15,
"TS2345": 3,
"TS2345": 2,
"TS2352": 1,
"TS2561": 1,
"TS2589": 1,
"TS2769": 3,
"TS7006": 2
},
"src/hooks/simulation/useSimulatorPreferences.ts": {
Expand Down Expand Up @@ -517,6 +572,9 @@
"src/lib/crm-db.ts": {
"TS2322": 1
},
"src/lib/external-db/__tests__/kill-switch-client.test.ts": {
"TS2556": 1
},
"src/lib/external-db/batch-import.ts": {
"TS2352": 2
},
Expand All @@ -525,7 +583,7 @@
},
"src/lib/external-db/invoke.ts": {
"TS2322": 1,
"TS2353": 3
"TS2353": 5
},
"src/lib/kit-builder/types.ts": {
"TS18048": 2
Expand All @@ -546,6 +604,9 @@
"src/pages/SidebarQAPage.tsx": {
"TS2322": 1
},
"src/pages/admin/AdminSegurancaAcessoPage.tsx": {
"TS2345": 1
},
"src/pages/admin/DevChallengeExamplesPage.tsx": {
"TS2322": 1
},
Expand All @@ -556,6 +617,10 @@
"TS18046": 2,
"TS2345": 1
},
"src/pages/admin/SellerDiscountLimitsAdminPage.tsx": {
"TS2322": 1,
"TS2345": 2
},
"src/pages/admin/telemetry/useOptimizationQueue.ts": {
"TS2339": 1
},
Expand All @@ -576,9 +641,9 @@
"TS2345": 2
},
"src/pages/kit-builder/useKitBuilderQuote.ts": {
"TS1360": 1,
"TS2305": 1,
"TS2345": 2,
"TS2353": 1
"TS2345": 3
},
"src/pages/magic-up/MagicUpConfigPanel.tsx": {
"TS2322": 1,
Expand Down Expand Up @@ -612,10 +677,6 @@
"src/pages/quotes/QuoteBuilderPage.tsx": {
"TS2339": 1
},
"src/pages/quotes/QuotesKanbanPage.tsx": {
"TS2345": 1,
"TS2769": 1
},
"src/pages/quotes/QuotesListPage.tsx": {
"TS2345": 1,
"TS2554": 1
Expand Down
Loading
Loading