Skip to content

Should interfaces and their properties be implicitly readonly? #41

@ghost

Description

With the readonly-keyword rule, Interfaces throw errors if their properties don't have the keyword. Should interfaces and their properties be implicitly readonly?

// Error
export interface IUserAuthenticationResponse {
  result: boolean;
  data: any;
  errors: any[];
}
// Happy
export interface IUserAuthenticationResponse {
  readonly result: boolean;
  readonly data: any;
  readonly errors: any[];
}
// Error
readonly export interface IUserAuthenticationResponse {
  result: boolean;
  data: any;
  errors: any[];
}

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions