Skip to content

prefer-immutable-types How to require readonly on the class variable's type, but not the property field? #635

@foray1010

Description

@foray1010

I want to combine prefer-immutable-types with @typescript-eslint/prefer-readonly, so that I can keep all public and protected fields mutable but keep the data type immutable. But now seems prefer-immutable-types's variables setting apply to both the field immutability and also the variable type, and the ignoreClasses: "fieldsOnly" setting will turn off both. Is it possible to handle them separately? Thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Status: Awaiting ResponseIssue or PR awaits response from the creator.Status: StaleThere has not been activity on this issue or PR for quite some time.Type: IdeaMarks an idea, which might be accepted and implemented.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions