Open 0xtz opened 2 hours ago
If anyone is having this issue with Supabase's 'never' is overridden by other types in this union type.
, I found a temporary fix using ESLint overrides:
// Supabase `'never' is overridden by other types in this union type.` tmp fix
overrides: [
{
files: ["src/lib/db_types.ts"], // Adjust this path to where your Supabase schema file is generated
rules: {
"@typescript-eslint/no-redundant-type-constituents": "off",
},
},
],
This solution disables the rule only for the generated file and prevents you from having to manually comment in the file every time it's regenerated. Hopefully, this can help while Supabase works on a permanent fix!
You can adjust the file path (src/lib/db_types.ts
) as necessary before posting!
Bug report
Description:
I'm encountering an issue with the generated TypeScript types when using Supabase. For the past 4 days, the types generated by the command
supabase gen types typescript
are producing TypeScript errors such as'never' is overridden by other types in this union type.
as indicated by SonarLint (typescript:S6571
).Supabase and Environment Details:
^1.204.3
Error Details:
The error manifests in the generated file, specifically in union types where 'never' seems to be incorrectly set as the type.
Here’s a screenshot of the relevant section:
it's not an issue in 1 project No, its happening in 3 projects now, any idea ?