Skip to content

chore: enable strict-raw-types in supabase_lints and fix all violations#1582

Merged
spydon merged 1 commit into
mainfrom
lukasklingsbo/sdk-1288-enable-strict-raw-types
Jul 10, 2026
Merged

chore: enable strict-raw-types in supabase_lints and fix all violations#1582
spydon merged 1 commit into
mainfrom
lukasklingsbo/sdk-1288-enable-strict-raw-types

Conversation

@spydon

@spydon spydon commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

What

Enables the strict-raw-types analyzer language mode in the shared supabase_lints config and fixes the 33 resulting violations across the monorepo.

Why

Raw types (generics used without explicit type arguments) silently weaken type safety. Turning on strict-raw-types catches them and keeps new code from reintroducing them.

Changes

  • packages/supabase_lints/lib/analysis_options.yaml: enable analyzer: language: strict-raw-types: true.
  • Fix all 33 violations (22 in lib/, 11 in tests).

All changes are non-breaking:

  • Raw generic types made explicit as <dynamic> (identical type): MapMap<dynamic, dynamic>, ListList<dynamic>, StreamSubscription/CancelableOperation<dynamic>, PostgrestQueryBuilderPostgrestQueryBuilder<dynamic>, RawPostgrestBuilderRawPostgrestBuilder<dynamic, dynamic, dynamic>.
  • Four PostgrestFilterBuilder return types restored to <T> (likeAllOf, likeAnyOf, ilikeAllOf, ilikeAnyOf) — return-type narrowing, which is safe.
  • Local variable renamed arrarray in transformers.dart.

Out of scope

Actually threading real type parameters through the postgrest/supabase builders (instead of <dynamic>) is a breaking API change, tracked for v3 in #1581.

Verification

  • dart analyze packages → No issues found!
  • Code formatted with dart format.
  • gotrue mock-based unit tests pass.

Enables the strict-raw-types analyzer language mode in the shared
supabase_lints config and fixes the 33 resulting violations.

All changes are non-breaking: raw generic types are made explicit as
<dynamic> (identical type), four PostgrestFilterBuilder return types are
narrowed back to <T>, and a local variable is renamed from arr to array.
@spydon spydon requested a review from a team as a code owner July 10, 2026 13:10
@spydon spydon merged commit 88ede03 into main Jul 10, 2026
34 checks passed
@spydon spydon deleted the lukasklingsbo/sdk-1288-enable-strict-raw-types branch July 10, 2026 14:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants