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.
Selected when
Section titled “Selected when”A scope has a project file supabase/config.toml.
Checks
Section titled “Checks”storage-policies
Section titled “storage-policies”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.
What to do
Section titled “What to do”Add a policy on storage.objects for the bucket in a migration.
Example
Section titled “Example”A storage bucket with no policy on storage.objects reports a finding. Add a migration that defines access for that bucket.
Lint rules
Section titled “Lint rules”| 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. |
Turn it off
Section titled “Turn it off”gspot ignore supabase/storage-policies --paths "<path>" --reason "<why>"gspot ignore supabase/storage-policies --rule bucket-policy --reason "<why>"verify-jwt
Section titled “verify-jwt”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.
What to do
Section titled “What to do”Give the reason in a comment on the same line, or set verify_jwt = true.
Example
Section titled “Example”verify_jwt = false with no comment reports verify-jwt. Write verify_jwt = false # A signed provider webhook. on the line.
Turn it off
Section titled “Turn it off”gspot ignore supabase/verify-jwt --paths "<path>" --reason "<why>"service-role-key
Section titled “service-role-key”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.
What to do
Section titled “What to do”Move code to edge functions or tests.
Example
Section titled “Example”Client code that reads a Supabase service-role key reports a finding. Move the key and the privileged work into an edge function.
Turn it off
Section titled “Turn it off”gspot ignore supabase/service-role-key --paths "<path>" --reason "<why>"deno-lint
Section titled “deno-lint”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.
What to do
Section titled “What to do”Change the code the way the rule says; deno lint --rules explains each one.
Example
Section titled “Example”An Edge Function declaring var greeting = "hello"; reports no-var. Use const greeting = "hello"; instead.
Turn it off
Section titled “Turn it off”gspot ignore supabase/deno-lint --paths "<path>" --reason "<why>"deno-check
Section titled “deno-check”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.
What to do
Section titled “What to do”Fix the first error Deno prints; later ones often come from the same mistake.
Example
Section titled “Example”An edge function that assigns a string to a number variable reports a type error. Correct the value or the type.
Lint rules
Section titled “Lint rules”| 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. |
Turn it off
Section titled “Turn it off”gspot ignore supabase/deno-check --paths "<path>" --reason "<why>"gspot ignore supabase/deno-check --rule type-error --reason "<why>"stale-types
Section titled “stale-types”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.
What to do
Section titled “What to do”Run supabase gen types typescript --local and write the output to the file.
Example
Section titled “Example”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.
Lint rules
Section titled “Lint rules”| 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. |
Turn it off
Section titled “Turn it off”gspot ignore supabase/stale-types --paths "<path>" --reason "<why>"gspot ignore supabase/stale-types --rule stale --reason "<why>"Settings
Section titled “Settings”| 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. |
Defaults set for other configurations
Section titled “Defaults set for other configurations”| Setting | Value |
|---|---|
postgres.client_schemas |
["public"] |
Rules for coding agents
Section titled “Rules for coding agents”| Rule file | Installed when |
|---|---|
.gspot/rules/SUPABASE.md |
Always |
Tools and versions
Section titled “Tools and versions”| Tool | Version |
|---|---|
| deno | 2.9.7 |
| supabase | 2.0.0 or later, install it yourself |