Skip to content

supabase

A Supabase project: edge functions under Deno. Every storage bucket has a policy, and privileged keys stay in their allowed files. It requires postgres, javascript.

A scope has a project file supabase/config.toml.

Checks that every storage bucket in the project file has a policy on storage.objects that names it.

Runs at the commit stage, once per scope.

A bucket with no policy refuses every upload, and when public serves every file to anyone, and nobody recorded that choice.

Add a policy on storage.objects for the bucket in a migration.

A storage bucket with no policy on storage.objects reports a finding. Add a migration that defines access for that bucket.

Rule What it checks What to do
bucket-policy A migration policy on storage.objects names each bucket of supabase/config.toml. Add a policy on storage.objects that checks bucket_id for the bucket.
syntax A file that the check reads parses without errors. Fix the syntax at the reported line.
gspot ignore supabase/storage-policies --paths "<path>" --reason "<why>"
gspot ignore supabase/storage-policies --rule bucket-policy --reason "<why>"

Checks that each verify_jwt = false in the project file has a comment that says why.

Runs at the commit stage, once per scope.

A function with verify_jwt = false takes requests from anyone, and the reason belongs beside the setting.

Give the reason in a comment on the same line, or set verify_jwt = true.

verify_jwt = false with no comment reports verify-jwt. Write verify_jwt = false # A signed provider webhook. on the line.

gspot ignore supabase/verify-jwt --paths "<path>" --reason "<why>"

Checks that only edge functions and test files name a secret or service role key.

Runs at the commit stage.

Secret and service role keys bypass row-level security, so a client bundle that holds either exposes privileged database access.

Move code to edge functions or tests.

Client code that reads a Supabase service-role key reports a finding. Move the key and the privileged work into an edge function.

gspot ignore supabase/service-role-key --paths "<path>" --reason "<why>"

Runs deno lint over every edge function, with the function’s deno.json when it has one.

Runs at the commit stage, once per scope.

Edge functions run under Deno, and its linter covers runtime APIs that the Node rules miss.

Change the code the way the rule says; deno lint --rules explains each one.

An Edge Function declaring var greeting = "hello"; reports no-var. Use const greeting = "hello"; instead.

gspot ignore supabase/deno-lint --paths "<path>" --reason "<why>"

Runs deno check on the entry file of every edge function.

Runs at the push stage, once per scope, and needs network access.

The project compiler cannot resolve the import map of a function, so only Deno can check its types.

Fix the first error Deno prints; later ones often come from the same mistake.

An edge function that assigns a string to a number variable reports a type error. Correct the value or the type.

Rule What it checks What to do
type-error The entry file of each edge function passes deno check. Fix the type error at the reported line.
syntax A file that the check reads parses without errors. Fix the syntax at the reported line.
gspot ignore supabase/deno-check --paths "<path>" --reason "<why>"
gspot ignore supabase/deno-check --rule type-error --reason "<why>"

Compares supabase.types_file with the output the Supabase CLI writes from the local database.

Runs at the push stage, once per scope, and needs a running Docker daemon. It skips until you set supabase.types_file.

Stale types let code compile against a column the database dropped.

Run supabase gen types typescript --local and write the output to the file.

A types file that differs from the local Supabase schema reports drift. With the local database running, write the output of supabase gen types typescript --local to that file.

Rule What it checks What to do
stale Each committed file holds what the generator command writes now. Run the generator command, and commit the new file after you read the diff.
missing Each file that the check compares with the generator output exists. Run the generator command, then add the file to Git.
untracked Git tracks each file that the generator writes. Add the file with git add, and commit it.
gspot ignore supabase/stale-types --paths "<path>" --reason "<why>"
gspot ignore supabase/stale-types --rule stale --reason "<why>"
Setting What it sets
supabase.functions_folder The folder with one folder for each edge function.
supabase.schemas The database schemas to include in generated types.
supabase.types_file The committed database types file; without it, no type comparison runs.
Setting Value
postgres.client_schemas ["public"]
Rule file Installed when
.gspot/rules/SUPABASE.md Always
Tool Version
deno 2.9.7
supabase 2.0.0 or later, install it yourself