Skip to content

[prefer-immutable-types] Doesn't take into consideration ignoreNamePattern with hash symbol #910

@Clarchik

Description

@Clarchik

Bug Report

Seems like rule does not work as intended.

Expected behavior

Rule below should not produce error for variables which follows # symbol (TS private modifier)

'functional/prefer-immutable-types': [
      'error',
      {
        ignoreNamePattern: ['_', '#']
      }
    ],

Actual behavior

Works for

_anyName variable

But produces error for

#anyName variable

Property should have a readonly modifier eslint [functional/prefer-immutable-types]

Steps to reproduce

Latest version (7.2.0) with the rule snippet above

Proposed changes

Metadata

Metadata

Assignees

No one assigned

    Labels

    Breaking ChangeThis change will require a new major release.Status: ReleasedIt's now live.Type: BugInconsistencies or issues which will cause a problem for users or implementors.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions