-
-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[prefer-immutable-types] Doesn't take into consideration ignoreNamePattern with hash symbol #910
Comments
So the I could change this in the future to require a # for private fields, but this would be a breaking change. You could use the |
Not sure, need to test it. I was playing around source code of the lib and found the solution for myself which works, but the question is - is it a breaking change? Changing this
to this
I found that only hash symbol is recognized as |
BREAKING CHANGE: when using patterns to match against PrivateIdentifiers, their names are now prefixed with an #. fix #910 fix#911
After thinking about this for awhile, I believe that yes, that should be the desired behavior. It is a breaking change though. |
🎉 This issue has been resolved in version 8.0.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
##### [v8.0.0](https://github.com/eslint-functional/eslint-plugin-functional/blob/HEAD/CHANGELOG.md#800-2025-01-14) ##### Bug Fixes - prefix PrivateIdentifier names with a # ([#921](eslint-functional/eslint-plugin-functional#921)) ([09b6474](eslint-functional/eslint-plugin-functional@09b6474)), closes [#910](eslint-functional/eslint-plugin-functional#910) [#911](eslint-functional/eslint-plugin-functional#911) ##### BREAKING CHANGES - when using patterns to match against PrivateIdentifiers, their names are now prefixed with a #. ##### [v7.3.1](eslint-functional/eslint-plugin-functional@v7.3.0...v7.3.1) ##### [v7.3.0](https://github.com/eslint-functional/eslint-plugin-functional/blob/HEAD/CHANGELOG.md#730-2025-01-14) ##### Bug Fixes - **prefer-tacit:** improve suggestion message ([59194b2](eslint-functional/eslint-plugin-functional@59194b2)) ##### Features - **type-declaration-immutability:** allow defining custom suggestion messages ([037a3c7](eslint-functional/eslint-plugin-functional@037a3c7)) #### [7.2.2](eslint-functional/eslint-plugin-functional@v7.2.1...v7.2.2) (2025-01-14) #### [7.2.1](eslint-functional/eslint-plugin-functional@v7.2.0...v7.2.1) (2025-01-06) ##### [v7.2.2](https://github.com/eslint-functional/eslint-plugin-functional/blob/HEAD/CHANGELOG.md#722-2025-01-14)
##### [v8.0.0](https://github.com/eslint-functional/eslint-plugin-functional/blob/HEAD/CHANGELOG.md#800-2025-01-14) ##### Bug Fixes - prefix PrivateIdentifier names with a # ([#921](eslint-functional/eslint-plugin-functional#921)) ([09b6474](eslint-functional/eslint-plugin-functional@09b6474)), closes [#910](eslint-functional/eslint-plugin-functional#910) [#911](eslint-functional/eslint-plugin-functional#911) ##### BREAKING CHANGES - when using patterns to match against PrivateIdentifiers, their names are now prefixed with a #. ##### [v7.3.1](eslint-functional/eslint-plugin-functional@v7.3.0...v7.3.1) ##### [v7.3.0](https://github.com/eslint-functional/eslint-plugin-functional/blob/HEAD/CHANGELOG.md#730-2025-01-14) ##### Bug Fixes - **prefer-tacit:** improve suggestion message ([59194b2](eslint-functional/eslint-plugin-functional@59194b2)) ##### Features - **type-declaration-immutability:** allow defining custom suggestion messages ([037a3c7](eslint-functional/eslint-plugin-functional@037a3c7)) #### [7.2.2](eslint-functional/eslint-plugin-functional@v7.2.1...v7.2.2) (2025-01-14) #### [7.2.1](eslint-functional/eslint-plugin-functional@v7.2.0...v7.2.1) (2025-01-06) ##### [v7.2.2](https://github.com/eslint-functional/eslint-plugin-functional/blob/HEAD/CHANGELOG.md#722-2025-01-14)
##### [v8.0.0](https://github.com/eslint-functional/eslint-plugin-functional/blob/HEAD/CHANGELOG.md#800-2025-01-14) ##### Bug Fixes - prefix PrivateIdentifier names with a # ([#921](eslint-functional/eslint-plugin-functional#921)) ([09b6474](eslint-functional/eslint-plugin-functional@09b6474)), closes [#910](eslint-functional/eslint-plugin-functional#910) [#911](eslint-functional/eslint-plugin-functional#911) ##### BREAKING CHANGES - when using patterns to match against PrivateIdentifiers, their names are now prefixed with a #. ##### [v7.3.1](eslint-functional/eslint-plugin-functional@v7.3.0...v7.3.1) ##### [v7.3.0](https://github.com/eslint-functional/eslint-plugin-functional/blob/HEAD/CHANGELOG.md#730-2025-01-14) ##### Bug Fixes - **prefer-tacit:** improve suggestion message ([59194b2](eslint-functional/eslint-plugin-functional@59194b2)) ##### Features - **type-declaration-immutability:** allow defining custom suggestion messages ([037a3c7](eslint-functional/eslint-plugin-functional@037a3c7)) #### [7.2.2](eslint-functional/eslint-plugin-functional@v7.2.1...v7.2.2) (2025-01-14) #### [7.2.1](eslint-functional/eslint-plugin-functional@v7.2.0...v7.2.1) (2025-01-06) ##### [v7.2.2](https://github.com/eslint-functional/eslint-plugin-functional/blob/HEAD/CHANGELOG.md#722-2025-01-14)
##### [v8.0.0](https://github.com/eslint-functional/eslint-plugin-functional/blob/HEAD/CHANGELOG.md#800-2025-01-14) ##### Bug Fixes - prefix PrivateIdentifier names with a # ([#921](eslint-functional/eslint-plugin-functional#921)) ([09b6474](eslint-functional/eslint-plugin-functional@09b6474)), closes [#910](eslint-functional/eslint-plugin-functional#910) [#911](eslint-functional/eslint-plugin-functional#911) ##### BREAKING CHANGES - when using patterns to match against PrivateIdentifiers, their names are now prefixed with a #. ##### [v7.3.1](eslint-functional/eslint-plugin-functional@v7.3.0...v7.3.1)
##### [v8.0.0](https://github.com/eslint-functional/eslint-plugin-functional/blob/HEAD/CHANGELOG.md#800-2025-01-14) ##### Bug Fixes - prefix PrivateIdentifier names with a # ([#921](eslint-functional/eslint-plugin-functional#921)) ([09b6474](eslint-functional/eslint-plugin-functional@09b6474)), closes [#910](eslint-functional/eslint-plugin-functional#910) [#911](eslint-functional/eslint-plugin-functional#911) ##### BREAKING CHANGES - when using patterns to match against PrivateIdentifiers, their names are now prefixed with a #. ##### [v7.3.1](eslint-functional/eslint-plugin-functional@v7.3.0...v7.3.1)
##### [v8.0.0](https://github.com/eslint-functional/eslint-plugin-functional/blob/HEAD/CHANGELOG.md#800-2025-01-14) ##### Bug Fixes - prefix PrivateIdentifier names with a # ([#921](eslint-functional/eslint-plugin-functional#921)) ([09b6474](eslint-functional/eslint-plugin-functional@09b6474)), closes [#910](eslint-functional/eslint-plugin-functional#910) [#911](eslint-functional/eslint-plugin-functional#911) ##### BREAKING CHANGES - when using patterns to match against PrivateIdentifiers, their names are now prefixed with a #. ##### [v7.3.1](eslint-functional/eslint-plugin-functional@v7.3.0...v7.3.1)
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)
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
The text was updated successfully, but these errors were encountered: