From a5f92e797dbba7536b28bda79a995bfdb1238531 Mon Sep 17 00:00:00 2001 From: Etienne Stalmans Date: Wed, 18 Feb 2026 08:28:21 +0100 Subject: [PATCH 1/2] chore: pg-meta quotes (#42941) ## I have read the [CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md) file. YES ## What kind of change does this PR introduce? Bug fix ## What is the current behavior? Manual replacement of quotes ## What is the new behavior? Uses defined SQL literal function ## Additional context No security risk, but builds better sql strings following best practice and avoids potential issues with frontend mis-escaping something --- apps/studio/lib/role-impersonation.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/apps/studio/lib/role-impersonation.ts b/apps/studio/lib/role-impersonation.ts index 29b45427c76b6..132286b47caa4 100644 --- a/apps/studio/lib/role-impersonation.ts +++ b/apps/studio/lib/role-impersonation.ts @@ -1,5 +1,7 @@ +import { ident, literal } from '@supabase/pg-meta/src/pg-format' import type { User } from 'data/auth/users-infinite-query' import { RoleImpersonationState as ValtioRoleImpersonationState } from 'state/role-impersonation-state' + import { uuidv4 } from './helpers' type PostgrestImpersonationRole = @@ -99,8 +101,8 @@ function getPostgrestRoleImpersonationSql( const unexpiredClaims = { ...claims, exp: getExp1HourFromNow() } return ` -select set_config('role', '${role.role}', true), -set_config('request.jwt.claims', '${JSON.stringify(unexpiredClaims).replaceAll("'", "''")}', true), +select set_config('role', ${literal(role.role)}, true), +set_config('request.jwt.claims', ${literal(JSON.stringify(unexpiredClaims))}, true), set_config('request.method', 'POST', true), set_config('request.path', '/impersonation-example-request-path', true), set_config('request.headers', '{"accept": "*/*"}', true); @@ -113,7 +115,7 @@ export const ROLE_IMPERSONATION_NO_RESULTS = 'ROLE_IMPERSONATION_NO_RESULTS' function getCustomRoleImpersonationSql(roleName: string) { return /* SQL */ ` - set local role '${roleName}'; + set local role ${literal(roleName)}; `.trim() } From 3d4459ef984ef0bb22958c887d8cfd3d975bbb16 Mon Sep 17 00:00:00 2001 From: Ivan Vasilov Date: Wed, 18 Feb 2026 09:11:54 +0100 Subject: [PATCH 2/2] chore: Add more ratchets for deprecated packages and default exports (#42948) This PR adds a new rule `no-restricted-imports` for deprecating old packages. For now, only `react-data-grid` and `react-contexify` have been added. The ratchet baselines has been rerun with the new rules. --- .../studio/.github/eslint-rule-baselines.json | 378 +++++++++++++++++- apps/studio/package.json | 2 +- packages/eslint-config-supabase/next.js | 11 + 3 files changed, 382 insertions(+), 9 deletions(-) diff --git a/apps/studio/.github/eslint-rule-baselines.json b/apps/studio/.github/eslint-rule-baselines.json index 94e3e7c1bb6ef..2fa5dbaf55a6c 100644 --- a/apps/studio/.github/eslint-rule-baselines.json +++ b/apps/studio/.github/eslint-rule-baselines.json @@ -1,9 +1,11 @@ { "rules": { - "react-hooks/exhaustive-deps": 211, + "react-hooks/exhaustive-deps": 209, "import/no-anonymous-default-export": 57, "@tanstack/query/exhaustive-deps": 13, - "@typescript-eslint/no-explicit-any": 1220 + "@typescript-eslint/no-explicit-any": 1215, + "no-restricted-exports": 301, + "no-restricted-imports": 59 }, "ruleFiles": { "react-hooks/exhaustive-deps": { @@ -65,7 +67,6 @@ "components/interfaces/Organization/Usage/Compute.tsx": 1, "components/interfaces/ProjectAPIDocs/Content/Entity.tsx": 1, "components/interfaces/ProjectAPIDocs/Content/RPC.tsx": 1, - "components/interfaces/QueryPerformance/QueryPerformanceChart.tsx": 1, "components/interfaces/Realtime/Inspector/MessagesTable.tsx": 1, "components/interfaces/Realtime/Inspector/useRealtimeMessages.ts": 2, "components/interfaces/Reports/ReportBlock/ChartBlock.tsx": 1, @@ -143,7 +144,6 @@ "hooks/misc/useSchemaQueryState.ts": 1, "hooks/misc/useTrackExperimentExposure.ts": 1, "hooks/misc/useUpgradePrompt.tsx": 1, - "hooks/ui/useCsvFileDrop.ts": 1, "pages/forgot-password-mfa.tsx": 1, "pages/integrations/vercel/[slug]/deploy-button/new-project.tsx": 1, "pages/integrations/vercel/install.tsx": 1, @@ -389,11 +389,12 @@ "components/interfaces/QueryPerformance/IndexAdvisor/IndexAdvisorDisabledState.tsx": 1, "components/interfaces/QueryPerformance/IndexAdvisor/index-advisor.utils.ts": 2, "components/interfaces/QueryPerformance/QueryPerformance.tsx": 1, + "components/interfaces/QueryPerformance/QueryPerformance.types.ts": 1, "components/interfaces/QueryPerformance/QueryPerformanceChart.tsx": 3, "components/interfaces/QueryPerformance/QueryPerformanceGrid.tsx": 3, - "components/interfaces/QueryPerformance/WithMonitor/WithMonitor.utils.ts": 2, "components/interfaces/QueryPerformance/WithStatements/WithStatements.tsx": 2, "components/interfaces/QueryPerformance/WithStatements/WithStatements.utils.ts": 1, + "components/interfaces/QueryPerformance/WithSupamonitor/WithSupamonitor.utils.ts": 1, "components/interfaces/Realtime/Inspector/Messages.types.ts": 1, "components/interfaces/Realtime/Inspector/RealtimeFilterPopover/TableSelector.tsx": 1, "components/interfaces/Realtime/Inspector/useRealtimeMessages.ts": 10, @@ -436,7 +437,7 @@ "components/interfaces/Settings/Infrastructure/InfrastructureConfiguration/InstanceNode.tsx": 1, "components/interfaces/Settings/Integrations/AWSPrivateLink/AWSPrivateLinkSection.tsx": 3, "components/interfaces/Settings/Logs/LogSelectionRenderers/DefaultPreviewSelectionRenderer.tsx": 1, - "components/interfaces/Settings/Logs/LogTable.tsx": 3, + "components/interfaces/Settings/Logs/LogTable.tsx": 2, "components/interfaces/Settings/Logs/Logs.constants.ts": 1, "components/interfaces/Settings/Logs/Logs.types.ts": 1, "components/interfaces/Settings/Logs/Logs.utils.ts": 11, @@ -532,7 +533,6 @@ "components/layouts/AccountLayout/WithSidebar.tsx": 3, "components/layouts/DocsLayout/DocsLayout.tsx": 2, "components/layouts/IntegrationsLayout/Integrations.utils.ts": 2, - "components/layouts/LogsLayout/LogsSidebarMenuV2.tsx": 1, "components/layouts/ProjectLayout/BuildingState.tsx": 1, "components/layouts/ProjectLayout/LayoutHeader/BreadcrumbsView.tsx": 2, "components/layouts/ProjectLayout/LayoutHeader/FeedbackDropdown/FeedbackWidget.tsx": 3, @@ -685,7 +685,7 @@ "hooks/ui/useClickedOutside.ts": 2, "hooks/ui/useFlag.ts": 1, "hooks/useStaticEffectEvent.ts": 1, - "instrumentation-client.ts": 5, + "instrumentation-client.ts": 2, "lib/ai/generate-assistant-response.ts": 2, "lib/ai/model.ts": 2, "lib/ai/model.utils.ts": 4, @@ -736,6 +736,368 @@ "types/form.ts": 1, "types/next.ts": 2, "types/ui.ts": 2 + }, + "no-restricted-exports": { + "__mocks__/hooks/analytics/useFillTimeseriesSorted.ts": 1, + "__mocks__/hooks/analytics/useLogsQuery.ts": 1, + "components/grid/components/grid/RowRenderer.tsx": 1, + "components/grid/components/header/filter/FilterRow.tsx": 1, + "components/grid/components/header/sort/SortRow.tsx": 1, + "components/interfaces/Account/TOTPFactors/DeleteFactorModal.tsx": 1, + "components/interfaces/App/CommandMenu/CommandMenu.tsx": 1, + "components/interfaces/App/FeaturePreview/FeaturePreviewModal.tsx": 1, + "components/interfaces/Auth/AuthProvidersForm/FormField.tsx": 1, + "components/interfaces/Auth/Policies/PolicyEditor/PolicyAllowedOperation.tsx": 1, + "components/interfaces/Auth/Policies/PolicyEditor/PolicyDefinition.tsx": 1, + "components/interfaces/Auth/Policies/PolicyEditor/PolicyEditorFooter.tsx": 1, + "components/interfaces/Auth/Policies/PolicyEditor/index.tsx": 1, + "components/interfaces/Auth/Policies/PolicyEditorModal/PolicyEditorModalTitle.tsx": 1, + "components/interfaces/Auth/Policies/PolicyEditorModal/index.tsx": 1, + "components/interfaces/Auth/Policies/PolicyReview.tsx": 1, + "components/interfaces/Auth/Policies/PolicySelection.tsx": 1, + "components/interfaces/Auth/Policies/PolicyTemplates/TemplatePreview.tsx": 1, + "components/interfaces/Auth/Policies/PolicyTemplates/TemplatesList.tsx": 1, + "components/interfaces/Auth/Policies/PolicyTemplates/index.tsx": 1, + "components/interfaces/Auth/SiteUrl/SiteUrl.tsx": 1, + "components/interfaces/Auth/Users/CreateUserModal.tsx": 1, + "components/interfaces/Auth/Users/InviteUserModal.tsx": 1, + "components/interfaces/Billing/InvoiceStatusBadge.tsx": 1, + "components/interfaces/Billing/Payment/AddNewPaymentMethodModal.tsx": 1, + "components/interfaces/Billing/Payment/AddPaymentMethodForm.tsx": 1, + "components/interfaces/Billing/Payment/PaymentMethods/ChangePaymentMethodModal.tsx": 1, + "components/interfaces/Billing/Payment/PaymentMethods/CreditCard.tsx": 1, + "components/interfaces/Billing/Payment/PaymentMethods/CurrentPaymentMethod.tsx": 1, + "components/interfaces/Billing/Payment/PaymentMethods/DeletePaymentMethodModal.tsx": 1, + "components/interfaces/Billing/Payment/PaymentMethods/PaymentMethods.tsx": 1, + "components/interfaces/Billing/SpendCapModal.tsx": 1, + "components/interfaces/BranchManagement/BranchStatusBadge.tsx": 1, + "components/interfaces/ConnectSheet/DirectConnectionExamples.tsx": 1, + "components/interfaces/Database/Backups/DatabaseBackupsNav.tsx": 1, + "components/interfaces/Database/Backups/PITR/PITRStatus.tsx": 1, + "components/interfaces/Database/Backups/PITR/TimeInput.tsx": 1, + "components/interfaces/Database/EnumeratedTypes/CreateEnumeratedTypeSidePanel.tsx": 1, + "components/interfaces/Database/EnumeratedTypes/DeleteEnumeratedTypeModal.tsx": 1, + "components/interfaces/Database/EnumeratedTypes/EditEnumeratedTypeSidePanel.tsx": 1, + "components/interfaces/Database/EnumeratedTypes/EnumeratedTypeValueRow.tsx": 1, + "components/interfaces/Database/Extensions/ExtensionCardSkeleton.tsx": 1, + "components/interfaces/Database/Functions/FunctionsList/FunctionList.tsx": 1, + "components/interfaces/Database/Functions/FunctionsList/FunctionsList.tsx": 1, + "components/interfaces/Database/Indexes/Indexes.tsx": 1, + "components/interfaces/Database/Migrations/Migrations.tsx": 1, + "components/interfaces/Database/Privileges/PrivilegesHead.tsx": 1, + "components/interfaces/Database/Privileges/PrivilegesTable.tsx": 1, + "components/interfaces/Database/Triggers/ChooseFunctionForm.tsx": 1, + "components/interfaces/DiskManagement/ui/FormMessage.tsx": 1, + "components/interfaces/Docs/Authentication.tsx": 1, + "components/interfaces/Docs/CodeSnippet.tsx": 1, + "components/interfaces/Docs/Description.tsx": 1, + "components/interfaces/Docs/Introduction.tsx": 1, + "components/interfaces/Docs/Pages/Rpc/Introduction.tsx": 1, + "components/interfaces/Docs/Pages/Tables/Introduction.tsx": 1, + "components/interfaces/Docs/Param.tsx": 1, + "components/interfaces/Docs/PublicSchemaNotEnabledAlert.tsx": 1, + "components/interfaces/Docs/Snippets.ts": 1, + "components/interfaces/Functions/CommandRender.tsx": 1, + "components/interfaces/Functions/EdgeFunctionSecrets/AddNewSecretForm.tsx": 1, + "components/interfaces/Functions/EdgeFunctionSecrets/EdgeFunctionSecret.tsx": 1, + "components/interfaces/Functions/FunctionsNav.tsx": 1, + "components/interfaces/GraphQL/GraphiQL.tsx": 1, + "components/interfaces/Home/ProjectUsage.tsx": 1, + "components/interfaces/Integrations/CronJobs/CronJobsEmptyState.tsx": 1, + "components/interfaces/Integrations/CronJobs/CronSyntaxChart.tsx": 1, + "components/interfaces/Integrations/Vercel/OrganizationPicker.tsx": 1, + "components/interfaces/Integrations/VercelGithub/ProjectLinker.tsx": 1, + "components/interfaces/Integrations/Wrappers/InputField.tsx": 1, + "components/interfaces/Integrations/Wrappers/WrapperDynamicColumns.tsx": 1, + "components/interfaces/Integrations/Wrappers/WrapperTableEditor.tsx": 1, + "components/interfaces/JwtSecrets/jwt-settings.tsx": 1, + "components/interfaces/Linter/LintDetail.tsx": 1, + "components/interfaces/Linter/LintPageTabs.tsx": 1, + "components/interfaces/Linter/LinterDataGrid.tsx": 1, + "components/interfaces/Linter/LinterFilters.tsx": 1, + "components/interfaces/Organization/BillingSettings/BillingBreakdown/BillingBreakdown.tsx": 1, + "components/interfaces/Organization/BillingSettings/BillingBreakdown/UpcomingInvoice.tsx": 1, + "components/interfaces/Organization/BillingSettings/BillingEmail.tsx": 1, + "components/interfaces/Organization/BillingSettings/CostControl/CostControl.tsx": 1, + "components/interfaces/Organization/BillingSettings/CostControl/SpendCapSidePanel.tsx": 1, + "components/interfaces/Organization/BillingSettings/CreditBalance.tsx": 1, + "components/interfaces/Organization/BillingSettings/ProjectUpdateDisabledTooltip.tsx": 1, + "components/interfaces/Organization/BillingSettings/Subscription/DowngradeModal.tsx": 1, + "components/interfaces/Organization/BillingSettings/Subscription/MembersExceedLimitModal.tsx": 1, + "components/interfaces/Organization/BillingSettings/Subscription/PaymentMethodSelection.tsx": 1, + "components/interfaces/Organization/BillingSettings/Subscription/Subscription.tsx": 1, + "components/interfaces/Organization/BillingSettings/Subscription/UpgradeModal.tsx": 1, + "components/interfaces/Organization/CloudMarketplace/AwsMarketplaceAutoRenewalWarning.tsx": 1, + "components/interfaces/Organization/CloudMarketplace/AwsMarketplaceContractNotLinkable.tsx": 1, + "components/interfaces/Organization/CloudMarketplace/AwsMarketplaceCreateNewOrg.tsx": 1, + "components/interfaces/Organization/CloudMarketplace/AwsMarketplaceOnboardingPlaceholder.tsx": 1, + "components/interfaces/Organization/CloudMarketplace/AwsMarketplaceOnboardingSuccessModal.tsx": 1, + "components/interfaces/Organization/CloudMarketplace/NewAwsMarketplaceOrgForm.tsx": 1, + "components/interfaces/Organization/CloudMarketplace/NewAwsMarketplaceOrgModal.tsx": 1, + "components/interfaces/Organization/IntegrationSettings/SidePanelVercelProjectLinker.tsx": 1, + "components/interfaces/Organization/InvoicesSettings/InvoicePayButton.tsx": 1, + "components/interfaces/Organization/TeamSettings/MembersView.tsx": 1, + "components/interfaces/Organization/Usage/ActiveCompute.tsx": 1, + "components/interfaces/Organization/Usage/Activity.tsx": 1, + "components/interfaces/Organization/Usage/Compute.tsx": 1, + "components/interfaces/Organization/Usage/Egress.tsx": 1, + "components/interfaces/Organization/Usage/OrgLogUsage.tsx": 1, + "components/interfaces/Organization/Usage/SectionHeader.tsx": 1, + "components/interfaces/Organization/Usage/SizeAndCounts.tsx": 1, + "components/interfaces/Organization/Usage/UsageBarChart.tsx": 1, + "components/interfaces/Organization/Usage/UsageSection/AttributeUsage.tsx": 1, + "components/interfaces/Organization/Usage/UsageSection/DatabaseSizeUsage.tsx": 1, + "components/interfaces/Organization/Usage/UsageSection/UsageSection.tsx": 1, + "components/interfaces/ProjectAPIDocs/ContentSnippet.tsx": 1, + "components/interfaces/ProjectAPIDocs/LanguageSelector.tsx": 1, + "components/interfaces/ProjectAPIDocs/ResourceContent.tsx": 1, + "components/interfaces/Realtime/Inspector/MessageSelection.tsx": 1, + "components/interfaces/Realtime/Inspector/MessagesTable.tsx": 1, + "components/interfaces/Realtime/Inspector/NoChannelEmptyState.tsx": 1, + "components/interfaces/Realtime/Inspector/RealtimeFilterPopover/TableSelector.tsx": 1, + "components/interfaces/Reports/ReportFilterBar.tsx": 1, + "components/interfaces/Reports/ReportHeader.tsx": 1, + "components/interfaces/Reports/ReportPadding.tsx": 1, + "components/interfaces/Reports/ReportStickyNav.tsx": 1, + "components/interfaces/Reports/ReportWidget.tsx": 1, + "components/interfaces/Reports/Reports.tsx": 1, + "components/interfaces/RoleImpersonationSelector/RoleImpersonationRadio.tsx": 1, + "components/interfaces/RoleImpersonationSelector/UserImpersonationSelector.tsx": 1, + "components/interfaces/SQLEditor/DownloadSnippetModal.tsx": 1, + "components/interfaces/SQLEditor/InlineWidget.tsx": 1, + "components/interfaces/SQLEditor/MonacoEditor.tsx": 1, + "components/interfaces/SQLEditor/RenameQueryModal.tsx": 1, + "components/interfaces/SQLEditor/SQLTemplates/SQLQuickstarts.tsx": 1, + "components/interfaces/SQLEditor/SQLTemplates/SQLTemplates.tsx": 1, + "components/interfaces/SQLEditor/UtilityPanel/ReadOnlyBadge.tsx": 1, + "components/interfaces/SQLEditor/UtilityPanel/Results.tsx": 1, + "components/interfaces/SQLEditor/UtilityPanel/SavingIndicator.tsx": 1, + "components/interfaces/SQLEditor/UtilityPanel/UtilityActions.tsx": 1, + "components/interfaces/SQLEditor/UtilityPanel/UtilityPanel.tsx": 1, + "components/interfaces/SQLEditor/UtilityPanel/UtilityTabResults.tsx": 1, + "components/interfaces/SQLEditor/hooks.ts": 1, + "components/interfaces/Settings/Addons/CustomDomainSidePanel.tsx": 1, + "components/interfaces/Settings/Addons/IPv4SidePanel.tsx": 1, + "components/interfaces/Settings/Addons/PITRSidePanel.tsx": 1, + "components/interfaces/Settings/Database/BannedIPs.tsx": 1, + "components/interfaces/Settings/Database/DatabaseSettings/ConfirmDisableReadOnlyModal.tsx": 1, + "components/interfaces/Settings/Database/DatabaseSettings/ResetDbPassword.tsx": 1, + "components/interfaces/Settings/Database/DiskSizeConfiguration.tsx": 1, + "components/interfaces/Settings/Database/DiskSizeConfigurationModal.tsx": 1, + "components/interfaces/Settings/Database/NetworkRestrictions/AddRestrictionModal.tsx": 1, + "components/interfaces/Settings/Database/NetworkRestrictions/AllowAllModal.tsx": 1, + "components/interfaces/Settings/Database/NetworkRestrictions/DisallowAllModal.tsx": 1, + "components/interfaces/Settings/Database/NetworkRestrictions/RemoveRestrictionModal.tsx": 1, + "components/interfaces/Settings/Database/SSLConfiguration.tsx": 1, + "components/interfaces/Settings/General/CustomDomainConfig/CustomDomainActivate.tsx": 1, + "components/interfaces/Settings/General/CustomDomainConfig/CustomDomainDelete.tsx": 1, + "components/interfaces/Settings/General/CustomDomainConfig/CustomDomainVerify.tsx": 1, + "components/interfaces/Settings/General/CustomDomainConfig/CustomDomainsConfigureHostname.tsx": 1, + "components/interfaces/Settings/General/CustomDomainConfig/CustomDomainsShimmerLoader.tsx": 1, + "components/interfaces/Settings/General/CustomDomainConfig/DNSRecord.tsx": 1, + "components/interfaces/Settings/General/Infrastructure/PauseProjectButton.tsx": 1, + "components/interfaces/Settings/General/Infrastructure/RestartServerButton.tsx": 1, + "components/interfaces/Settings/Infrastructure/InfrastructureConfiguration/DeployNewReplicaPanel.tsx": 1, + "components/interfaces/Settings/Infrastructure/InfrastructureConfiguration/DropAllReplicasConfirmationModal.tsx": 1, + "components/interfaces/Settings/Infrastructure/InfrastructureConfiguration/MapView.tsx": 1, + "components/interfaces/Settings/Integrations/GithubIntegration/GitHubIntegrationConnectionForm.tsx": 1, + "components/interfaces/Settings/Integrations/IntegrationsSettings.tsx": 1, + "components/interfaces/Settings/Integrations/VercelIntegration/VercelIntegrationConnectionForm.tsx": 1, + "components/interfaces/Settings/Logs/LogColumnRenderers/AuthColumnRenderer.tsx": 1, + "components/interfaces/Settings/Logs/LogColumnRenderers/DatabaseApiColumnRender.tsx": 1, + "components/interfaces/Settings/Logs/LogColumnRenderers/DatabasePostgresColumnRender.tsx": 1, + "components/interfaces/Settings/Logs/LogColumnRenderers/DefaultPreviewColumnRenderer.tsx": 1, + "components/interfaces/Settings/Logs/LogColumnRenderers/FunctionsEdgeColumnRender.tsx": 1, + "components/interfaces/Settings/Logs/LogColumnRenderers/FunctionsLogsColumnRender.tsx": 1, + "components/interfaces/Settings/Logs/LogSelection.tsx": 1, + "components/interfaces/Settings/Logs/LogSelectionRenderers/DefaultPreviewSelectionRenderer.tsx": 1, + "components/interfaces/Settings/Logs/Logs.Divider.tsx": 1, + "components/interfaces/Settings/Logs/Logs.SavedQueriesItem.tsx": 1, + "components/interfaces/Settings/Logs/Logs.SqlSnippetCode.tsx": 1, + "components/interfaces/Settings/Logs/LogsErrorRenderers/ResourcesExceededErrorRenderer.tsx": 1, + "components/interfaces/Settings/Logs/LogsFilterPopover.tsx": 1, + "components/interfaces/Settings/Logs/LogsQueryPanel.tsx": 1, + "components/interfaces/Settings/Logs/PreviewFilterPanel.tsx": 1, + "components/interfaces/Settings/Logs/RecentQueriesItem.tsx": 1, + "components/interfaces/Settings/Logs/UpgradePrompt.tsx": 1, + "components/interfaces/SignIn/PasswordConditionsHelper.tsx": 1, + "components/interfaces/SignIn/ResetPasswordForm.tsx": 1, + "components/interfaces/Storage/StorageBucketsError.tsx": 1, + "components/interfaces/Storage/StoragePolicies/StoragePoliciesEditPolicyModal.tsx": 1, + "components/interfaces/Storage/StoragePolicies/StoragePoliciesEditor.tsx": 1, + "components/interfaces/Storage/StoragePolicies/StoragePoliciesPlaceholder.tsx": 1, + "components/interfaces/Storage/StoragePolicies/StoragePoliciesReview.tsx": 1, + "components/interfaces/TableGridEditor/DeleteConfirmationDialogs.tsx": 1, + "components/interfaces/TableGridEditor/SidePanelEditor/ColumnEditor/ColumnDefaultValue.tsx": 1, + "components/interfaces/TableGridEditor/SidePanelEditor/ColumnEditor/ColumnForeignKey.tsx": 1, + "components/interfaces/TableGridEditor/SidePanelEditor/ColumnEditor/ColumnType.tsx": 1, + "components/interfaces/TableGridEditor/SidePanelEditor/ColumnEditor/HeaderTitle.tsx": 1, + "components/interfaces/TableGridEditor/SidePanelEditor/ColumnEditor/InputWithSuggestions.tsx": 1, + "components/interfaces/TableGridEditor/SidePanelEditor/RowEditor/ForeignRowSelector/Pagination.tsx": 1, + "components/interfaces/TableGridEditor/SidePanelEditor/RowEditor/ForeignRowSelector/SelectorGrid.tsx": 1, + "components/interfaces/TableGridEditor/SidePanelEditor/RowEditor/JsonEditor/DrilldownViewer/DrilldownBreadCrumbs.tsx": 1, + "components/interfaces/TableGridEditor/SidePanelEditor/RowEditor/JsonEditor/DrilldownViewer/DrilldownPane.tsx": 1, + "components/interfaces/TableGridEditor/SidePanelEditor/SpreadsheetImport/SpreadSheetFileUpload.tsx": 1, + "components/interfaces/TableGridEditor/SidePanelEditor/SpreadsheetImport/SpreadSheetImportConfiguration.tsx": 1, + "components/interfaces/TableGridEditor/SidePanelEditor/SpreadsheetImport/SpreadSheetTextInput.tsx": 1, + "components/interfaces/TableGridEditor/SidePanelEditor/SpreadsheetImport/SpreadsheetPreviewGrid.tsx": 1, + "components/interfaces/TableGridEditor/SidePanelEditor/TableEditor/Column.tsx": 1, + "components/interfaces/TableGridEditor/SidePanelEditor/TableEditor/ColumnManagement.tsx": 1, + "components/interfaces/TableGridEditor/ViewEntityAutofixSecurityModal.tsx": 1, + "components/layouts/APIAuthorizationLayout.tsx": 1, + "components/layouts/APIKeys/APIKeysLayout.tsx": 1, + "components/layouts/AccessTokens/AccessTokensLayout.tsx": 1, + "components/layouts/AccountLayout/AccountLayout.tsx": 1, + "components/layouts/AdvisorsLayout/AdvisorsLayout.tsx": 1, + "components/layouts/AppLayout/AppLayout.tsx": 1, + "components/layouts/AuthLayout/AuthLayout.tsx": 1, + "components/layouts/BranchLayout/BranchLayout.tsx": 1, + "components/layouts/DatabaseLayout/DatabaseLayout.tsx": 1, + "components/layouts/DatabaseLayout/DatabaseTriggersLayout.tsx": 1, + "components/layouts/DefaultLayout.tsx": 1, + "components/layouts/DocsLayout/DocsLayout.tsx": 1, + "components/layouts/EdgeFunctionsLayout/EdgeFunctionDetailsLayout.tsx": 1, + "components/layouts/EdgeFunctionsLayout/EdgeFunctionsLayout.tsx": 1, + "components/layouts/Integrations/layout.tsx": 1, + "components/layouts/IntegrationsLayout/IntegrationWindowLayout.tsx": 1, + "components/layouts/IntegrationsLayout/VercelIntegrationWindowLayout.tsx": 1, + "components/layouts/JWTKeys/JWTKeysLayout.tsx": 1, + "components/layouts/LinkAwsMarketplaceLayout.tsx": 1, + "components/layouts/LogsLayout/LogsLayout.tsx": 1, + "components/layouts/ObservabilityLayout/ObservabilityLayout.tsx": 1, + "components/layouts/ObservabilityLayout/ObservabilityMenu.tsx": 1, + "components/layouts/OrganizationLayout.tsx": 1, + "components/layouts/ProjectLayout/BuildingState.tsx": 1, + "components/layouts/ProjectLayout/ConnectingState.tsx": 1, + "components/layouts/ProjectLayout/NavigationBar/MobileNavigationBar.tsx": 1, + "components/layouts/ProjectLayout/NavigationBar/MobileViewNav.tsx": 1, + "components/layouts/ProjectLayout/NavigationBar/NavigationIconLink.tsx": 1, + "components/layouts/ProjectLayout/OrganizationSettingsLayout.tsx": 1, + "components/layouts/ProjectLayout/ProductMenuBar.tsx": 1, + "components/layouts/ProjectLayout/RestartingState.tsx": 1, + "components/layouts/ProjectLayout/RestoringState.tsx": 1, + "components/layouts/ProjectSettingsLayout/SettingsLayout.tsx": 1, + "components/layouts/RealtimeLayout/RealtimeLayout.tsx": 1, + "components/layouts/RedeemCreditsLayout.tsx": 1, + "components/layouts/ReportsLayout/ReportsLayout.tsx": 1, + "components/layouts/ReportsLayout/ReportsMenu.tsx": 1, + "components/layouts/SQLEditorLayout/SQLEditorLayout.tsx": 1, + "components/layouts/SQLEditorLayout/SQLEditorNavV2/SQLEditorLoadingSnippets.tsx": 1, + "components/layouts/SignInLayout/ForgotPasswordLayout.tsx": 1, + "components/layouts/SignInLayout/SignInLayout.tsx": 1, + "components/layouts/StorageLayout/StorageLayout.tsx": 1, + "components/layouts/TableEditorLayout/EditorMenuListSkeleton.tsx": 1, + "components/layouts/WizardLayout.tsx": 1, + "components/to-be-cleaned/AlphaPreview.tsx": 1, + "components/to-be-cleaned/KeyMap.tsx": 1, + "components/to-be-cleaned/ProductEmptyState.tsx": 1, + "components/to-be-cleaned/Table.tsx": 1, + "components/to-be-cleaned/forms/AutoTextArea.tsx": 1, + "components/ui/AIEditor/ResizableAIWidget.tsx": 1, + "components/ui/AlertError.tsx": 1, + "components/ui/CardButton.tsx": 1, + "components/ui/Charts/AreaChart.tsx": 1, + "components/ui/Charts/BarChart.tsx": 1, + "components/ui/Charts/ChartHandler.tsx": 1, + "components/ui/Charts/NoDataPlaceholder.tsx": 1, + "components/ui/Charts/StackedBarChart.tsx": 1, + "components/ui/CodeEditor/CodeEditor.tsx": 1, + "components/ui/CodeEditor/Providers/BackwardIterator.ts": 1, + "components/ui/CodeEditor/Providers/PgSQLCompletionProvider.ts": 1, + "components/ui/CodeEditor/Providers/PgSQLSignatureHelpProvider.ts": 1, + "components/ui/CopyButton.tsx": 1, + "components/ui/CountdownTimer/CountdownTimerRadial.tsx": 1, + "components/ui/CountdownTimer/CountdownTimerSpan.tsx": 1, + "components/ui/DateRangePicker.tsx": 1, + "components/ui/EditorPanel/EditorPanel.tsx": 1, + "components/ui/Error.tsx": 1, + "components/ui/FormBoxEmpty.tsx": 1, + "components/ui/FunctionSelector.tsx": 1, + "components/ui/GrafanaPromoBanner.tsx": 1, + "components/ui/InformationBox.tsx": 1, + "components/ui/LoadingOpacity.tsx": 1, + "components/ui/Logs/LogsExplorerHeader.tsx": 1, + "components/ui/NoPermission.tsx": 1, + "components/ui/Panel.tsx": 1, + "components/ui/PartnerIcon.tsx": 1, + "components/ui/PartnerManagedResource.tsx": 1, + "components/ui/SchemaSelector.tsx": 1, + "components/ui/ShimmerLine.tsx": 1, + "components/ui/SparkBar.tsx": 1, + "components/ui/SqlEditor.tsx": 1, + "components/ui/TwoOptionToggle.tsx": 1, + "data/prefetchers/PrefetchableLink.tsx": 1, + "hooks/analytics/useDbQuery.tsx": 1, + "hooks/analytics/useLogsPreview.tsx": 1, + "hooks/analytics/useLogsQuery.tsx": 1, + "hooks/analytics/useProjectUsageStats.tsx": 1, + "hooks/analytics/useSingleLog.tsx": 1, + "hooks/analytics/useTimeseriesUnixToIso.ts": 1, + "hooks/branches/useEdgeFunctionsDiff.ts": 1, + "hooks/misc/useLatest.ts": 1, + "lib/api/apiWrapper.ts": 1, + "lib/pingPostgrest.ts": 1, + "scripts/codegen.ts": 1, + "vitest.config.ts": 1 + }, + "no-restricted-imports": { + "components/grid/SupabaseGrid.tsx": 1, + "components/grid/SupabaseGrid.utils.ts": 1, + "components/grid/components/common/Shortcuts.tsx": 1, + "components/grid/components/editor/BooleanEditor.tsx": 1, + "components/grid/components/editor/DateTimeEditor.tsx": 1, + "components/grid/components/editor/JsonEditor.tsx": 1, + "components/grid/components/editor/NumberEditor.tsx": 1, + "components/grid/components/editor/SelectEditor.tsx": 1, + "components/grid/components/editor/TextEditor.tsx": 1, + "components/grid/components/editor/TimeEditor.tsx": 1, + "components/grid/components/formatter/BinaryFormatter.tsx": 1, + "components/grid/components/formatter/BooleanFormatter.tsx": 1, + "components/grid/components/formatter/DefaultFormatter.tsx": 1, + "components/grid/components/formatter/ForeignKeyFormatter.tsx": 1, + "components/grid/components/formatter/JsonFormatter.tsx": 1, + "components/grid/components/formatter/ReferenceRecordPeek.tsx": 1, + "components/grid/components/grid/AddColumn.tsx": 1, + "components/grid/components/grid/Grid.tsx": 1, + "components/grid/components/grid/Grid.utils.tsx": 1, + "components/grid/components/grid/RowRenderer.tsx": 2, + "components/grid/components/grid/SelectColumn.tsx": 1, + "components/grid/components/menu/ColumnMenu.tsx": 1, + "components/grid/components/menu/RowContextMenu.tsx": 1, + "components/grid/types/base.ts": 1, + "components/grid/utils/column.ts": 1, + "components/grid/utils/gridColumns.tsx": 1, + "components/interfaces/Auth/Users/Users.utils.tsx": 1, + "components/interfaces/Auth/Users/UsersGridComponents.tsx": 1, + "components/interfaces/Auth/Users/UsersV2.tsx": 1, + "components/interfaces/Integrations/CronJobs/CronJobs.utils.tsx": 1, + "components/interfaces/Integrations/CronJobs/CronJobsTab.DataGrid.tsx": 1, + "components/interfaces/Integrations/CronJobs/PreviousRunsTab.tsx": 1, + "components/interfaces/Integrations/Queues/Queues.utils.tsx": 1, + "components/interfaces/Integrations/Queues/QueuesTab.tsx": 1, + "components/interfaces/Integrations/Queues/SingleQueue/QueueDataGrid.tsx": 1, + "components/interfaces/Integrations/Vault/Secrets/Secrets.utils.tsx": 1, + "components/interfaces/Integrations/Vault/Secrets/SecretsManagement.tsx": 1, + "components/interfaces/Linter/LinterDataGrid.tsx": 1, + "components/interfaces/QueryPerformance/QueryPerformanceGrid.tsx": 1, + "components/interfaces/Realtime/Inspector/MessagesTable.tsx": 1, + "components/interfaces/Realtime/Inspector/RealtimeMessageColumnRenderer.tsx": 1, + "components/interfaces/SQLEditor/UtilityPanel/Results.tsx": 1, + "components/interfaces/Settings/Logs/LogColumnRenderers/AuthColumnRenderer.tsx": 1, + "components/interfaces/Settings/Logs/LogColumnRenderers/DatabaseApiColumnRender.tsx": 1, + "components/interfaces/Settings/Logs/LogColumnRenderers/DatabasePostgresColumnRender.tsx": 1, + "components/interfaces/Settings/Logs/LogColumnRenderers/DefaultPreviewColumnRenderer.tsx": 1, + "components/interfaces/Settings/Logs/LogColumnRenderers/FunctionsEdgeColumnRender.tsx": 1, + "components/interfaces/Settings/Logs/LogColumnRenderers/FunctionsLogsColumnRender.tsx": 1, + "components/interfaces/Settings/Logs/LogTable.tsx": 2, + "components/interfaces/Storage/StorageExplorer/ColumnContextMenu.tsx": 1, + "components/interfaces/Storage/StorageExplorer/FileExplorerColumn.tsx": 1, + "components/interfaces/Storage/StorageExplorer/FileExplorerRow.tsx": 1, + "components/interfaces/Storage/StorageExplorer/FolderContextMenu.tsx": 1, + "components/interfaces/Storage/StorageExplorer/ItemContextMenu.tsx": 1, + "components/interfaces/TableGridEditor/SidePanelEditor/RowEditor/ForeignRowSelector/SelectorGrid.tsx": 1, + "components/interfaces/TableGridEditor/SidePanelEditor/SpreadsheetImport/SpreadsheetPreviewGrid.tsx": 1, + "state/table-editor-table.tsx": 1 } } } diff --git a/apps/studio/package.json b/apps/studio/package.json index 83d5e295ec73f..6fb012a63d351 100644 --- a/apps/studio/package.json +++ b/apps/studio/package.json @@ -8,7 +8,7 @@ "build": "next build && if [ \"$SKIP_ASSET_UPLOAD\" != \"1\" ]; then ./../../scripts/upload-static-assets.sh; fi", "start": "next start -p 8082", "lint": "eslint .", - "lint:ratchet": "tsx scripts/ratchet-eslint-rules.ts --rule react-hooks/exhaustive-deps --rule import/no-anonymous-default-export --rule @tanstack/query/exhaustive-deps --rule @typescript-eslint/no-explicit-any", + "lint:ratchet": "tsx scripts/ratchet-eslint-rules.ts --rule react-hooks/exhaustive-deps --rule import/no-anonymous-default-export --rule @tanstack/query/exhaustive-deps --rule @typescript-eslint/no-explicit-any --rule no-restricted-imports --rule no-restricted-exports", "clean": "rimraf node_modules tsconfig.tsbuildinfo .next .turbo", "test": "vitest --run --coverage", "test:watch": "vitest watch", diff --git a/packages/eslint-config-supabase/next.js b/packages/eslint-config-supabase/next.js index 628fbd895a530..339e5bbcea10b 100644 --- a/packages/eslint-config-supabase/next.js +++ b/packages/eslint-config-supabase/next.js @@ -64,6 +64,17 @@ module.exports = defineConfig([ rules: { '@next/next/no-html-link-for-pages': 'off', 'react/jsx-key': 'off', + 'no-restricted-imports': [ + 'warn', + { + name: 'react-data-grid', + message: 'Please use @tanstack/react-table instead.', + }, + { + name: 'react-contexify', + message: 'Please use ContextMenu from the ui package instead.', + }, + ], }, }, {