Skip to content

Union of unknown and null in generated ts types in view row #4234

@dreinon

Description

@dreinon

Describe the bug
When ts types are generated for a view that has a column which type is not recognized by typescript, it sets the type to unknown, but since it is a view, because of the error mentioned in #577, all types have a union applied with null, and results into a type unknown | null, which throws the following eslint error:

488:26 error 'unknown' overrides all other types in this union type @typescript-eslint/no-redundant-type-constituents

To Reproduce
Steps to reproduce the behavior:

  1. In a project, create a view with a column which type is not recognized by typescript, for instance, a geolocation column.
  2. Generate types for that project with the cli, in a typescript+eslint project
  3. Go to that view, to the Row type
  4. Check the error

Expected behavior
Only unknown type with no union.

Screenshots
If applicable, add screenshots to help explain your problem.

Additional context
If applicable, add any other context about the problem here.

  • "eslint": "^9.36.0",
  • "typescript": "^5.9.3",
  • "typescript-eslint": "^8.45.0"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions