Skip to content

Consider re-enabling no-empty-object-type rule #1152

Description

@Maxim-Mazurok
"@typescript-eslint/no-empty-object-type": [
  "error",
  {
    "allowInterfaces": "always", // to allow `interface DismissApprovalRequestMessage {}` in AccessApproval-v1, etc.
    "allowObjectTypes": "always" // to allow `deleteAccessApprovalSettings(request?: {...}): Request<{}>` in AccessApproval-v1, etc.
  }
],

was added because of

   143:15  error  An empty interface declaration allows any non-nullish value, including literals like `0` and `""`.
- If that's what you want, disable this lint rule with an inline comment or configure the 'allowInterfaces' rule option.
- If you want a type meaning "any object", you probably want `object` instead.
- If you want a type meaning "any value", you probably want `unknown` instead   @typescript-eslint/no-empty-object-type

and

   429:19  error  The `{}` ("empty object") type allows any non-nullish value, including literals like `0` and `""`.
- If that's what you want, disable this lint rule with an inline comment or configure the 'allowObjectTypes' rule option.
- If you want a type meaning "any object", you probably want `object` instead.
- If you want a type meaning "any value", you probably want `unknown` instead  @typescript-eslint/no-empty-object-type

Perhaps we should be more strict? Will need to examine generated types and actual implementation more closely, maybe it being a bit more lax is a good thing, not sure.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions